diff --git a/layouts/_default/content.html b/layouts/_default/content.html index f6f47475ad..9022e2bec8 100644 --- a/layouts/_default/content.html +++ b/layouts/_default/content.html @@ -1,17 +1,18 @@
-

{{ .Title }}

- {{ with .Params.description }}
{{ . | markdownify }}
{{ end }} - {{ if (and (not .Params.hide_readingtime) (.Site.Params.ui.readingtime.enable)) }} - {{ partial "reading-time.html" . }} + {{ partial "article_meta.html" . }} +

{{ .Title }}

+ {{ with .Params.description }}
{{ . | markdownify }}
{{ end }} + {{ if (and (not .Params.hide_readingtime) (.Site.Params.ui.readingtime.enable)) }} + {{ partial "reading-time.html" . }} {{ end }} - {{ .Content }} - {{ if (and (not .Params.hide_feedback) (.Site.Params.ui.feedback.enable) (.Site.GoogleAnalytics)) }} - {{ partial "feedback.html" .Site.Params.ui.feedback }} -
- {{ end }} - {{ if (.Site.Params.DisqusShortname) }} -
- {{ partial "disqus-comment.html" . }} - {{ end }} -
{{ partial "page-meta-lastmod.html" . }}
+ {{ .Content }} + {{ if (and (not .Params.hide_feedback) (.Site.Params.ui.feedback.enable) (.Site.GoogleAnalytics)) }} + {{ partial "feedback.html" .Site.Params.ui.feedback }} +
+ {{ end }} + {{ if (.Site.Params.DisqusShortname) }} +
+ {{ partial "disqus-comment.html" . }} + {{ end }} +
{{ partial "page-meta-lastmod.html" . }}
diff --git a/layouts/_default/taxonomy.html b/layouts/_default/taxonomy.html new file mode 100644 index 0000000000..d0c4e9e2f8 --- /dev/null +++ b/layouts/_default/taxonomy.html @@ -0,0 +1,8 @@ +{{ define "main" }} +
+ {{ range .Pages }} + {{ partial "summary.html" . }} + {{ end }} +
+{{ end }} + diff --git a/layouts/_default/terms.html b/layouts/_default/terms.html new file mode 100644 index 0000000000..96ade75bd7 --- /dev/null +++ b/layouts/_default/terms.html @@ -0,0 +1,13 @@ +{{ define "main" }} +
+
+

List of article {{ .Section }}

+
+
+ {{ range $key, $value := .Data.Terms }} + {{ $postCount := len $value.Pages }} + +
{{ $key }} : + {{ $postCount }}
+ {{ end }} +{{ end }} diff --git a/layouts/partials/article_meta.html b/layouts/partials/article_meta.html new file mode 100644 index 0000000000..e19857ceb7 --- /dev/null +++ b/layouts/partials/article_meta.html @@ -0,0 +1,3 @@ +
+ {{ partial "article_tags.html" . }} +
diff --git a/layouts/partials/article_tags.html b/layouts/partials/article_tags.html new file mode 100644 index 0000000000..2bdc2c153a --- /dev/null +++ b/layouts/partials/article_tags.html @@ -0,0 +1,7 @@ +{{ with (.GetTerms "tags")}} +
+ {{ range . }} + + {{ end }} +
+{{end}} diff --git a/layouts/partials/summary.html b/layouts/partials/summary.html new file mode 100644 index 0000000000..a32ea3e7df --- /dev/null +++ b/layouts/partials/summary.html @@ -0,0 +1,12 @@ +
+
+
+

+ {{ .Title }} +

+ {{ partial "article_meta.html" . }} +
+

{{ .Summary | truncate 320 }}

+ Read More +
+
diff --git a/layouts/partials/tags.html b/layouts/partials/tags.html new file mode 100644 index 0000000000..f6f0eee28c --- /dev/null +++ b/layouts/partials/tags.html @@ -0,0 +1,14 @@ +
+{{ if isset .Site.Taxonomies "tags" }} +{{ if not (eq (len .Site.Taxonomies.tags) 0) }} +
+

{{ .Site.Params.Strings.Tags | default "Tag Cloud" }}

+ +
+{{ end }} +{{ end }} +
diff --git a/layouts/partials/toc.html b/layouts/partials/toc.html index f155f8b13a..b65dfa085c 100644 --- a/layouts/partials/toc.html +++ b/layouts/partials/toc.html @@ -5,4 +5,5 @@ {{ . }} {{ end }} {{ end }} -{{ end }} \ No newline at end of file + +{{ end }} diff --git a/netlify.toml b/netlify.toml index f75501a74f..a896e243be 100644 --- a/netlify.toml +++ b/netlify.toml @@ -8,6 +8,6 @@ # "production" environment specific build settings [build.environment] - HUGO_VERSION = "0.76.5" + HUGO_VERSION = "0.79.0" HUGO_THEME = "repo" HUGO_ENV = "production" diff --git a/userguide/config.toml b/userguide/config.toml index ac19a18dd1..c01a90f2bb 100644 --- a/userguide/config.toml +++ b/userguide/config.toml @@ -16,7 +16,8 @@ defaultContentLanguageInSubdir = false # Useful when translating. enableMissingTranslationPlaceholders = true -disableKinds = ["taxonomy", "taxonomyTerm"] +[taxonomies] +tags = "tags" # Highlighting config pygmentsCodeFences = true diff --git a/userguide/content/en/docs/Best practices/site-guidance.md b/userguide/content/en/docs/Best practices/site-guidance.md index 16ebc5ee9f..8c9c480c3c 100644 --- a/userguide/content/en/docs/Best practices/site-guidance.md +++ b/userguide/content/en/docs/Best practices/site-guidance.md @@ -39,3 +39,22 @@ find and automatically link to your file named `filename.md`. Note, however, that `ref` and `relref` links don't work with `_index` or `index` files (for example, this site's [content landing page](/docs/adding-content/)): you'll need to use regular Markdown links to section landing or other index pages. Specify these links relative to the site's root URL, for example: `/docs/adding-content/`. [Learn more about linking](/docs/adding-content/content/#working-with-links). + +## Tagging + +An example of Tagging on a live site can be seen at the [TrueNAS Docs Site](https://www.truenas.com/docs/hub/). + +Tagging is enabled on articles, but can be disabled by adding the line: `disableKinds = ["taxonomy", "taxonomyTerm"]` in config.toml. +To add tags to an article, add a 'tags:' line to the front matter on each article. +Example: `tags: ["tag1"]` +Multiple tags can be added separated by commas: `tags: ["tag1","tag2","tag3"]` + +This will enable a list that will show ever article with that tag when someone clicks on it. + + +
+ +A Tag Cloud is available that will display all tags and numbers of each tag in the right sidebar. To enable the tag cloud, uncomment line 8 of toc.html in the partials subdirectory. + + +
diff --git a/userguide/content/en/docs/Examples/_index.md b/userguide/content/en/docs/Examples/_index.md index 2c0e10bb24..462c5822da 100644 --- a/userguide/content/en/docs/Examples/_index.md +++ b/userguide/content/en/docs/Examples/_index.md @@ -1,8 +1,10 @@ --- title: "Examples" weight: 8 +tags: ["examples"] description: > Some examples of Docsy in action! + --- One of the best ways to see what Docsy can do, and learn how to configure a site with it, is to see some real projects. In addition to our provided Docsy Example Project, there are several live sites already using the theme. Please add your own examples once you've got a production site up and running with Docsy! @@ -20,6 +22,7 @@ Example sites that have low to no customization: | https://googlecontainertools.github.io/kpt/ | https://github.com/GoogleContainerTools/kpt/tree/master/docs | | [Navidrome Music Server](https://www.navidrome.org) | https://github.com/navidrome/website | | https://docs.agilebase.co.uk/ | https://github.com/okohll/abdocs | +| [TrueNAS Docs](https://docs.truenas.com/) | https://github.com/freenas/documentation | ## Customized Docsy examples diff --git a/userguide/static/images/tag-demo-1.PNG b/userguide/static/images/tag-demo-1.PNG new file mode 100644 index 0000000000..8f3e10f019 Binary files /dev/null and b/userguide/static/images/tag-demo-1.PNG differ diff --git a/userguide/static/images/tag-demo-2.PNG b/userguide/static/images/tag-demo-2.PNG new file mode 100644 index 0000000000..ea03445548 Binary files /dev/null and b/userguide/static/images/tag-demo-2.PNG differ