Browse Source

Add accessibility features for the theme

master
dtluna 7 months ago
parent
commit
6b4d390c25

+ 1
- 1
layouts/_default/single.html View File

@@ -1,7 +1,7 @@
{{- define "main" -}}
<div class="row">
<div class="col">
<h1>{{- .Title -}}</h1>
{{- partial "post-title.html" . -}}
</div>
</div>
<div class="row mt-4">

+ 1
- 1
layouts/index.html View File

@@ -2,7 +2,7 @@
{{- with .Site.Params.description -}}
<div class="jumbotron jumbotron-fluid">
<div class="container container-fluid">
<h1 class="display-4">Non Serviam Media</h1>
<h1>Non Serviam Media</h1>
<p class="lead">{{ . }}</p>
</div>
</div>

+ 1
- 1
layouts/partials/audio.html View File

@@ -8,7 +8,7 @@
{{ end }}

{{ if $haslink }}
<h4><i class="fas fa-podcast"></i> Listen to audio</h4>
<p class="h4"><i class="fas fa-podcast"></i> Listen to audio</p>
<audio class="w-100" controls>
{{ range $.Site.Params.audio_links }}
{{ $audioFile := $.Param .param_name }}

+ 1
- 1
layouts/partials/banner.html View File

@@ -1 +1 @@
<img class="img-fluid" src="{{ . }}" />
<img class="img-fluid" alt="banner" src="{{ . }}" />

+ 1
- 1
layouts/partials/commento.html View File

@@ -1,5 +1,5 @@
{{ with .Param "commento_url" }}
<h3><i class="fas fa-comments"></i> Comments</h3>
<p class="h4"><i class="fas fa-comments"></i> Comments</p>
<div id="commento"></div>
<script src="{{ . }}/js/commento.js"></script>
<noscript>

+ 1
- 1
layouts/partials/downloads.html View File

@@ -1,4 +1,4 @@
<h4><i class="fas fa-download"></i> Downloads</h4>
<p class="h4"><i class="fas fa-download"></i> Downloads</p>
<ul>
{{ range $.Site.Params.audio_links }}
{{ $audioFile := $.Param .param_name }}

+ 2
- 2
layouts/partials/footer.html View File

@@ -1,7 +1,7 @@
<footer class="pt-4 my-md-5 pt-md-5 border-top">
<div class="row">
<div class="col-md border-right">
<h5>Powered by</h5>
<p>Powered by</p>
<ul class="list-unstyled">
<li>
<a href="https://gohugo.io/">Hugo</a>
@@ -17,7 +17,7 @@

{{- with $.Site.Params.source -}}
<div class="col-md">
<h5><a class="text-big" href="{{ . }}">Website source code</a></h5>
<a class="text-big" href="{{ . }}">Website source code</a>
</div>
{{- end -}}


+ 2
- 2
layouts/partials/page-summary.html View File

@@ -1,8 +1,8 @@
<article itemprop="citation" itemscope itemtype="https://schema.org/CreativeWork">
<header>
<h3 itemprop="name">
<p class="h3" itemprop="name">
<a href="{{ .RelPermalink }}" rel="bookmark">{{ .Title }}</a>
</h3>
</p>
</header>
<p>{{ partial "post-meta.html" . }}</p>


+ 40
- 0
layouts/partials/pagination.html View File

@@ -0,0 +1,40 @@
{{ $pag := $.Paginator }}
{{ if gt $pag.TotalPages 1 }}
<ul class="pagination">
{{ with $pag.First }}
<li class="page-item">
<a href="{{ .URL }}" class="page-link" aria-label="First"><span aria-hidden="true">&laquo;&laquo;</span></a>
</li>
{{ end }}
<li class="page-item{{ if not $pag.HasPrev }} disabled{{ end }}">
<a href="{{ if $pag.HasPrev }}{{ $pag.Prev.URL }}{{ end }}" class="page-link" aria-label="Previous"><span aria-hidden="true">&laquo;</span></a>
</li>
{{ $ellipsed := false }}
{{ $shouldEllipse := false }}
{{ range $pag.Pagers }}
{{ $right := sub .TotalPages .PageNumber }}
{{ $showNumber := or (le .PageNumber 3) (eq $right 0) }}
{{ $showNumber := or $showNumber (and (gt .PageNumber (sub $pag.PageNumber 2)) (lt .PageNumber (add $pag.PageNumber 2))) }}
{{ if $showNumber }}
{{ $ellipsed = false }}
{{ $shouldEllipse = false }}
{{ else }}
{{ $shouldEllipse = not $ellipsed }}
{{ $ellipsed = true }}
{{ end }}
{{ if $showNumber }}
<li class="page-item{{ if eq . $pag }} active{{ end }}"><a class="page-link" href="{{ .URL }}" aria-label="Page number {{ .PageNumber }}">{{ .PageNumber }}</a></li>
{{ else if $shouldEllipse }}
<li class="page-item disabled"><span aria-hidden="true">&nbsp;&hellip;&nbsp;</span></li>
{{ end }}
{{ end }}
<li class="page-item{{ if not $pag.HasNext }} disabled{{ end }}">
<a href="{{ if $pag.HasNext }}{{ $pag.Next.URL }}{{ end }}" class="page-link" aria-label="Next"><span aria-hidden="true">&raquo;</span></a>
</li>
{{ with $pag.Last }}
<li class="page-item">
<a href="{{ .URL }}" class="page-link" aria-label="Last"><span aria-hidden="true">&raquo;&raquo;</span></a>
</li>
{{ end }}
</ul>
{{ end }}

+ 1
- 1
layouts/partials/podcast-list.html View File

@@ -6,5 +6,5 @@
{{- end -}}
</ul>
<div class="d-flex justify-content-center">
{{ template "_internal/pagination.html" . }}
{{- partial "pagination.html" . -}}
</div>

+ 1
- 0
layouts/partials/post-title.html View File

@@ -0,0 +1 @@
<h1>{{- .Title -}}</h1>

+ 1
- 1
layouts/partials/related-content.html View File

@@ -2,7 +2,7 @@
{{ $related := .Site.RegularPages.Related . | first $num_to_show }}
{{- with $related -}}
<aside>
<h4><i class="fas fa-paperclip"></i> Related Content</h4>
<p class="h4"><i class="fas fa-paperclip"></i> Related Content</p>
<ul>
{{- range . -}}
<li><a href="{{ .RelPermalink }}">{{ .Title }}</a>

+ 1
- 1
layouts/partials/tags.html View File

@@ -1,4 +1,4 @@
<h4><i class="fas fa-tags"></i> Tags</h4>
<p class="h4"><i class="fas fa-tags"></i> Tags</p>
<p>
{{ $taxo := "tags" }} <!-- Use the plural form here -->
{{ $elems := .Param $taxo }}

+ 1
- 1
layouts/podcasts/single.html View File

@@ -1,7 +1,7 @@
{{- define "main" -}}
<div class="row">
<div class="col">
<h1>{{- .Title -}}</h1>
{{- partial "post-title.html" . -}}
<p>{{- partial "post-meta.html" . -}}</p>
</div>
</div>

Loading…
Cancel
Save