mirror of
https://github.com/McShelby/hugo-theme-relearn.git
synced 2024-11-23 07:47:54 +00:00
taxonomy: warn on missing term title #709
This commit is contained in:
parent
5a35a4a7ac
commit
ec482bb3de
3 changed files with 9 additions and 2 deletions
|
@ -2,9 +2,12 @@
|
|||
title = "a secret"
|
||||
+++
|
||||
|
||||
This lists all pages that are hidden from the home page. This includes pages that define `hidden=true` in their frontmatter as weill as descendents of hidden pages.
|
||||
This lists all pages that are hidden from the home page. This includes pages that define `hidden=true` in their frontmatter as well as descendents of hidden pages.
|
||||
|
||||
When giving term pages, you should give it a title. Otherwise it will print out a warning and will use the urlized title, which may looks weird.
|
||||
|
||||
While internally this term is called `hidden`, it is referenced in the resulting english pages as `a secret` and as `hush, matey` in the piratish translation.
|
||||
|
||||
This tag also has a title. While internally it is called `hidden`, it is referenced in the resulting pages as `a secret`.
|
||||
|
||||
## Just an example heading
|
||||
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
+++
|
||||
title = "hush, matey"
|
||||
+++
|
||||
{{< piratify >}}
|
|
@ -14,6 +14,9 @@
|
|||
{{- $terms := slice }}
|
||||
{{- range .Data.Terms }}
|
||||
{{- $terms = $terms | append (dict "Title" (default .Page.Data.Term .Page.Title) "Term" . )}}
|
||||
{{- if not .Page.Title }}
|
||||
{{- warnf "%q: You have not given a 'title' in the frontmatter of your term page, the urlized title will be used instead" .Page.File.Filename }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- range sort $terms ".Title" }}
|
||||
{{- $capital := substr .Title 0 1 | upper }}
|
||||
|
|
Loading…
Reference in a new issue