theme: use disabled anchor for last bread crumb #84

because otherwise Hugo will not generate a relative URL for the itemprop value
This commit is contained in:
Sören Weber 2021-09-10 01:08:39 +02:00
parent 03db2cc387
commit 87a86876e9
No known key found for this signature in database
GPG key ID: 07D17FF580AE7589
2 changed files with 15 additions and 13 deletions

View file

@ -108,19 +108,13 @@
{{ if $parent }} {{ if $parent }}
{{ template "breadcrumb" dict "page" $parent "depth" $depth }} {{ template "breadcrumb" dict "page" $parent "depth" $depth }}
{{end}} {{end}}
{{ if .depth }}
<li itemscope itemtype="https://schema.org/ListItem" itemprop="itemListElement"> <li itemscope itemtype="https://schema.org/ListItem" itemprop="itemListElement">
<meta itemprop="position" content="{{ $depth }}" /> <meta itemprop="position" content="{{ $depth }}" />
<a itemprop="item" href="{{ .page.RelPermalink }}"> <a itemprop="item" href="{{ .page.RelPermalink }}"{{if not .depth}} aria-disabled="true"{{end}}>
<span itemprop="name">{{ .page.Title }}</span> <span itemprop="name">{{ .page.Title }}</span>
</a> </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> </li>
{{ if .depth }}
>
{{end}} {{end}}
{{end}} {{end}}

View file

@ -1015,6 +1015,14 @@ td {
#body #breadcrumbs .links meta { #body #breadcrumbs .links meta {
display: none; 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) { @media only all and (max-width: 59.938em) {
#sidebar { #sidebar {
width: 230px; width: 230px;