Skip to content

Commit

Permalink
theme: use disabled anchor for last bread crumb #84
Browse files Browse the repository at this point in the history
because otherwise Hugo will not generate a relative URL for the itemprop value
  • Loading branch information
McShelby committed Sep 9, 2021
1 parent 03db2cc commit 87a8687
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 13 deletions.
20 changes: 7 additions & 13 deletions layouts/partials/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -108,19 +108,13 @@ <h1>
{{ if $parent }}
{{ template "breadcrumb" dict "page" $parent "depth" $depth }}
{{end}}
<li itemscope itemtype="https://schema.org/ListItem" itemprop="itemListElement">
<meta itemprop="position" content="{{ $depth }}" />
<a itemprop="item" href="{{ .page.RelPermalink }}"{{if not .depth}} aria-disabled="true"{{end}}>
<span itemprop="name">{{ .page.Title }}</span>
</a>
</li>
{{ if .depth }}
<li itemscope itemtype="https://schema.org/ListItem" itemprop="itemListElement">
<meta itemprop="position" content="{{ $depth }}" />
<a itemprop="item" href="{{ .page.RelPermalink }}">
<span itemprop="name">{{ .page.Title }}</span>
</a>
</li> >
{{else}}
<li itemscope itemtype="https://schema.org/ListItem" itemprop="itemListElement">
<meta itemprop="position" content="{{ $depth }}" />
<data itemprop="item" value="{{ .page.RelPermalink }}">
<span itemprop="name">{{ .page.Title }}</span>
</data>
</li>
>
{{end}}
{{end}}
8 changes: 8 additions & 0 deletions static/css/theme.css
Original file line number Diff line number Diff line change
Expand Up @@ -1015,6 +1015,14 @@ td {
#body #breadcrumbs .links meta {
display: none;
}
#body #breadcrumbs .links li:last-of-type {
cursor: text;
}
a[aria-disabled="true"] {
color: inherit;
pointer-events: none;
text-decoration: none;
}
@media only all and (max-width: 59.938em) {
#sidebar {
width: 230px;
Expand Down

0 comments on commit 87a8687

Please sign in to comment.