diff options
author | Caio Lente <7017340+clente@users.noreply.github.com> | 2023-10-17 00:06:07 -0300 |
---|---|---|
committer | Caio Lente <7017340+clente@users.noreply.github.com> | 2023-10-17 00:06:07 -0300 |
commit | d796205bf80157a95fe92cb2a4d11b785fd6359f (patch) | |
tree | 801226dd4d375da3d98e91f0b7b6329166fe8910 | |
parent | f991890cc202aac9d00578c9fa3d6004e9f9ece0 (diff) | |
parent | cfb20f68513fda3a72f49c43da6fa84190855d25 (diff) | |
download | hugo-bearcub-d796205bf80157a95fe92cb2a4d11b785fd6359f.tar.gz hugo-bearcub-d796205bf80157a95fe92cb2a4d11b785fd6359f.tar.bz2 |
Merge origin/main into style/herman
-rw-r--r-- | README.md | 8 | ||||
-rw-r--r-- | assets/herman.css | 14 | ||||
-rw-r--r-- | exampleSite/config.toml | 4 | ||||
-rw-r--r-- | i18n/en.toml | 5 | ||||
-rw-r--r-- | i18n/pt.toml | 5 | ||||
-rw-r--r-- | layouts/_default/baseof.html | 2 | ||||
-rw-r--r-- | layouts/partials/header.html | 2 | ||||
-rw-r--r-- | layouts/partials/nav.html | 2 | ||||
-rw-r--r-- | theme.toml | 2 |
9 files changed, 35 insertions, 9 deletions
@@ -106,6 +106,10 @@ already implemented: `render: false` to your [build options](https://gohugo.io/content-management/build-options/#readout) to avoid rendering a blank post. +- Skip link: a "skip to main content" link that is temporarily invisible, but + can be focused by people who need a keyboard to navigate the web (see [PR + #5](https://github.com/clente/hugo-bearcub/pull/5) by + [@2kool4idkwhat](https://github.com/2kool4idkwhat) for more information). - Single-use CSS (EXPERIMENTAL): you can add some styles to a single page by writing the CSS you need in `assets/{custom_css}.css` and then including `style: "{custom_css}.css"` in the [front @@ -158,7 +162,7 @@ enableRobotsTXT = true LanguageCode = "en-US" contentDir = "content" [languages.en.params] - blogPath = "/blog" # Path to your blog section (used by RSS) + blogPath = "blog" # Path to your blog section (used by RSS) madeWith = "Made with [Bear Cub](https://github.com/clente/hugo-bearcub)" [languages.pt] title = "Bear Cub" @@ -166,7 +170,7 @@ enableRobotsTXT = true LanguageCode = "pt-BR" contentDir = "content.pt" [languages.pt.params] - blogPath = "/pt/blog" # Path to your blog section (used by RSS) + blogPath = "blog" # Path to your blog section (used by RSS) madeWith = "Feito com [Bear Cub](https://github.com/clente/hugo-bearcub)" [params] diff --git a/assets/herman.css b/assets/herman.css index a61d6c9..cd84aec 100644 --- a/assets/herman.css +++ b/assets/herman.css @@ -176,3 +176,17 @@ td { gap: calc(var(--spacing) / 2); } } + +/* "Skip to main content" link */ +.skip-link { + position: absolute; + top: 5; + transform: translateY(-600%); + transition: transform 0.5s; + background-color: #181a20; + padding: 6px; +} + +.skip-link:focus { + transform: translateY(0%); +} diff --git a/exampleSite/config.toml b/exampleSite/config.toml index cecd754..3b68b53 100644 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -33,7 +33,7 @@ enableRobotsTXT = true LanguageCode = "en-US" contentDir = "content" [languages.en.params] - blogPath = "/blog" # Path to your blog section (used by RSS) + blogPath = "blog" # Path to your blog section (used by RSS) madeWith = "Made with [Bear Cub](https://github.com/clente/hugo-bearcub)" [languages.pt] title = "Bear Cub" @@ -41,7 +41,7 @@ enableRobotsTXT = true LanguageCode = "pt-BR" contentDir = "content.pt" [languages.pt.params] - blogPath = "/pt/blog" # Path to your blog section (used by RSS) + blogPath = "blog" # Path to your blog section (used by RSS) madeWith = "Feito com [Bear Cub](https://github.com/clente/hugo-bearcub)" [params] diff --git a/i18n/en.toml b/i18n/en.toml index 1a89360..b7738dd 100644 --- a/i18n/en.toml +++ b/i18n/en.toml @@ -5,4 +5,7 @@ other = "No posts yet" [email-subject] - other = "Reply to "
\ No newline at end of file + other = "Reply to " + +[skip-link] + other = "Skip to main content"
\ No newline at end of file diff --git a/i18n/pt.toml b/i18n/pt.toml index a139b0f..33fc65f 100644 --- a/i18n/pt.toml +++ b/i18n/pt.toml @@ -5,4 +5,7 @@ other = "Nenhum post ainda" [email-subject] - other = "Resposta a "
\ No newline at end of file + other = "Resposta a " + +[skip-link] + other = "Pular para conteúdo principal"
\ No newline at end of file diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index 0b0cdff..bddfe68 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -36,7 +36,7 @@ <header> {{- partial "header.html" . -}} </header> - <main> + <main id="main-content"> {{- block "main" . }}{{- end }} </main> <footer> diff --git a/layouts/partials/header.html b/layouts/partials/header.html index fccb41f..5a66907 100644 --- a/layouts/partials/header.html +++ b/layouts/partials/header.html @@ -1,2 +1,4 @@ +<a class="skip-link" href="#main-content">{{ i18n "skip-link" }}</a> + <a href="{{ relURL .Site.Home.Permalink }}" class="title"><h1>{{ .Site.Title }}</h1></a> <nav>{{- partial "nav.html" . -}}</nav> diff --git a/layouts/partials/nav.html b/layouts/partials/nav.html index 5ee4552..2cc03a2 100644 --- a/layouts/partials/nav.html +++ b/layouts/partials/nav.html @@ -1,5 +1,5 @@ {{ range .Site.Menus.main.ByWeight }} - <a href="{{ relLangURL .URL }}">{{ .Name }}</a> + <a href="{{ .URL }}">{{ .Name }}</a> {{ end }} {{ with .Site.Social.email }} <a href='mailto:{{ . }}?subject={{ i18n "email-subject" }}"{{ default $.Site.Title $.Page.Title }}"'>Email</a> @@ -1,7 +1,7 @@ name = "Bear Cub" license = "MIT" licenselink = "https://github.com/clente/hugo-bearcub/blob/master/LICENSE" -description = "Theme description" +description = "A lightweight Hugo theme based on Bear Blog and Hugo Bear Blog. It is free, multilingual, optimized for search engines, no-nonsense, responsive, light, and fast. Really fast." # The home page of the theme, where the source can be found. homepage = "https://github.com/clente/hugo-bearcub" |