1
0
Fork 0
mirror of https://git.sr.ht/~seirdy/seirdy.one synced 2024-09-19 20:02:10 +00:00

Aria-current, shorter titles

This commit is contained in:
Rohan Kumar 2022-04-01 22:21:00 -07:00
parent 1ecf099145
commit 1a70b01374
No known key found for this signature in database
GPG key ID: 1E892DB2A5F84479
2 changed files with 17 additions and 15 deletions

View file

@ -7,7 +7,7 @@
<!-- IDC how much content is extracted from my pages, go knock yourself out. huge images, long snippets, whatever. -->
<meta name="robots" content="index,follow,max-image-preview:large,max-snippet=-1">
{{ end }}
<title>{{ .Title }}{{ if and (lt (len .Title) 66) (ne .RelPermalink "/") }} - Seirdy{{ end }}</title>
<title>{{ .Title }}{{ if and (lt (len .Title) 54) (ne .RelPermalink "/") }} - Seirdy{{ end }}</title>
<meta name="description" content="{{ if .Params.description }}{{ .Params.description }}{{ else }}{{ .Site.Params.Description }}{{ end }}">
<meta content="{{ .Site.Author.name }}" name="author">
<meta property="article:author" content="{{ .Site.Author.name }}">

View file

@ -1,12 +1,14 @@
<header id="banner" itemscope itemtype="https://schema.org/WPHeader">
<nav>
<nav aria-label="Main navigation">
<ul class="unstyled-list">
{{- $currentPage := . -}}
<li itemscope itemtype="https://schema.org/SiteNavigationElement">
<a rel="home" itemprop="url" href="{{ .Site.BaseURL }}"><span itemprop="name">{{ .Site.Title }}</span></a>
<a rel="home" itemprop="url" href="{{ .Site.BaseURL }}"{{- if eq $currentPage.Permalink .Site.BaseURL -}} aria-current="page"{{- end -}}><span itemprop="name">{{ .Site.Title }}</span></a>
</li>
{{ range .Site.Menus.main.ByWeight -}}
{{ range .Site.Menus.main -}}
<li itemscope itemtype="https://schema.org/SiteNavigationElement">
{{ .Pre }}<a href="{{ .URL }}" itemprop="url" title="{{ .Title }}"><span itemprop="name">{{- .Name -}}</span></a>{{ .Post }}
<a href="{{ .URL }}" itemprop="url" {{- if or (eq $currentPage.RelPermalink .URL) ($currentPage.HasMenuCurrent "main" .) -}} aria-current="page"{{- end -}}>
<span itemprop="name">{{- .Name -}}</span></a>
</li>
{{- end }}
</ul>