Compare commits

...

14 Commits

8 changed files with 52 additions and 39 deletions

View File

@ -28,11 +28,15 @@ the
[archive](https://schlomp.space/tastytea/hugo-theme-nocolor/archive/main.tar.gz)
into `themes/nocolor`.
### Breaking changes:
- 2021-09-25: Don't automatically add RSS hyperlink.
## Configuration & Modification
Please take a look at the [configuration example for
Slick](https://github.com/spookey/slick/blob/master/_sites/example/config.toml). It
is valid for nocolor too, with these exceptions:
Slick](https://github.com/spookey/slick/blob/main/_sites/example/config.toml).
It is valid for nocolor too, with these exceptions:
* `favicon` and `css` have to be in in the assets folder.
@ -42,6 +46,10 @@ template `extra_head.html` or above the footer by overwriting
`layouts/partials/extra_head.html` or `layouts/partials/extra_foot.html`,
respectively.
Maybe the [configuration file for my
blog](https://schlomp.space/tastytea/blog/src/branch/main/config.toml) is
helpful, too.
### Custom ARIA labels
Some elements can't be labeled by default because we don't know what's going to
@ -49,8 +57,7 @@ be in it. Custom [ARIA
labels](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/Navigation_Role)
are supported for the top menu and the bottom menu.
.`config.toml`
`config.toml`:
``` toml
[params]
[params.aria]
@ -63,8 +70,7 @@ are supported for the top menu and the bottom menu.
If you want source code highlighting with AsciiDoc, you'll need pygmentize from
the package [pygments](https://pygments.org/). Set this in your config file:
.`config.toml`
`config.toml`:
``` toml
pygmentsCodefences = true
pygmentsCodeFencesGuessSyntax = false
@ -80,7 +86,8 @@ pygmentize -f html -S <style> -a .highlight \
```
And add `:source-highlighter: pygments` at the top of your posts, below the
front matter. Make sure to include the generated CSS file.
front matter. Make sure to include the generated CSS file. You can also set the
`source-highlighter` attribute in your config file.[^1]
### Table of contents
@ -97,3 +104,5 @@ blog.
## Contributing
See <https://schlomp.space/tastytea/hugo-theme-nocolor/src/branch/main/CONTRIBUTING.adoc>.
[^1]: https://gohugo.io/content-management/formats/#external-helper-asciidoctor

View File

@ -1,6 +1,12 @@
html
{
font-family: serif;
hyphens: auto;
}
textarea, pre, code
{
hyphens: manual;
}
body
@ -12,11 +18,11 @@ body
/* Minimum margin for small screens. */
body>*
{
margin-left: 5px;
margin-right: 5px;
margin-left: 0.2em;
margin-right: 0.2em;
}
.header
.header .title
{
font-size: 150%;
margin-bottom: 1em;
@ -28,9 +34,9 @@ body>*
content: " ";
}
.header .description
.nav-top
{
font-size: 75%;
margin-top: 1em;
}
.nav ul, .pagination ul
@ -94,8 +100,7 @@ li > p
.admonitionblock
{
margin-bottom: 1em;
margin-left: 1em;
margin: 0.5em auto 0.5em 1em; /* trbl */
}
.admonitionblock td

View File

@ -1,5 +1,5 @@
<!DOCTYPE html>
<html lang="{{ default "en" .Site.LanguageCode }}">
<html lang="{{ default "en" .Lang }}">
<head>
<meta charset="utf-8" />
<title>{{ if and (.Title) (not (eq .Title .Site.Title)) }}{{ .Title }} | {{ end }}{{ .Site.Title }}</title>

View File

@ -1,5 +1,5 @@
{{- define "main" }}
<section aria-labelledby="nocolor_list">
<section class="list" aria-labelledby="nocolor_list">
<h1 id="nocolor_list">{{ .Title }}:</h1>
<ul>
{{- range .Paginator.Pages }}

View File

@ -11,7 +11,7 @@
<link>{{ .Permalink }}</link>
<description>Recent content {{ if ne .Title .Site.Title }}{{ with .Title }}in {{ . }} {{ end }}{{ end }}on {{ .Site.Title }}</description>
<generator>Hugo {{ hugo.Version }} -- gohugo.io</generator>
{{- with .Site.LanguageCode }}
{{- with .Lang }}
<language>{{ . }}</language>
{{- end }}
{{- with .Site.Author.email }}

View File

@ -1,5 +1,5 @@
{{- define "main" }}
<section aria-labelledby="nocolor_terms">
<section class="terms" aria-labelledby="nocolor_terms">
<h1 id="nocolor_terms">{{ .Title }}:</h1>
<ul>
{{- range .Data.Terms.ByCount }}

View File

@ -3,18 +3,15 @@
<nav class="nav nav-bottom"{{- with .Site.Params.aria.menu_bottom }} aria-label="{{ . }}"{{- end }}>
<ul>
{{- range .Site.Menus.footer }}
<li>
{{ with .Pre }}{{ . }}{{ end }}
<li{{ with .Params.class }} class="{{ . }}"{{ end }}>
{{- if .URL }}
<a href="{{ .URL }}">{{ .Name }}</a>
<a href="{{ .URL }}"{{ with .Title }} title="{{ . }}"{{ end }}>{{ .Name }}</a>
{{- else }}
{{ .Name }}
{{- end }}
</li>
{{- end }}
{{- with .Site.Home.OutputFormats.Get "RSS" }}
<li>
<a href="{{ .RelPermalink }}">RSS</a>
</li>
{{ with .Post }}{{ . }}{{ end }}
{{- end }}
</ul>
</nav>

View File

@ -3,19 +3,21 @@
{{- with .Site.Params.subtitle }}
<span class="description">{{ . }}</span>
{{- end }}
<nav class="nav nav-top"{{- with .Site.Params.aria.menu_top }} aria-label="{{ . }}"{{- end }}>
<ul>
{{- $curr := . }}
{{- range .Site.Menus.main }}
{{ with .Pre }}{{ . }}{{ end }}
<li{{ with .Params.class }} class="{{ . }}"{{ end }}>
{{- if .URL }}
<a href="{{ .URL }}"{{ with .Title }} title="{{ . }}"{{ end }}>{{ .Name }}</a>
{{- else }}
<li>{{ .Name }}</li>
{{- end }}
</li>
{{ with .Post }}{{ . }}{{ end }}
{{- end }}
</ul>
</nav>
</header>
<nav class="nav nav-top"{{- with .Site.Params.aria.menu_top }} aria-label="{{ . }}"{{- end }}>
<ul>
{{- $curr := . }}
{{- range .Site.Menus.main }}
{{- if .URL }}
<li>
<a href="{{ .URL }}">{{ .Name }}</a>
</li>
{{- else }}
{{ .Name }}
{{- end }}
{{- end }}
</ul>
</nav>
<hr>