Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 15 additions & 14 deletions layouts/_default/content.html
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
<div class="td-content">
<h1>{{ .Title }}</h1>
{{ with .Params.description }}<div class="lead">{{ . | markdownify }}</div>{{ end }}
{{ if (and (not .Params.hide_readingtime) (.Site.Params.ui.readingtime.enable)) }}
{{ partial "reading-time.html" . }}
{{ partial "article_meta.html" . }}
<h1>{{ .Title }}</h1>
{{ with .Params.description }}<div class="lead">{{ . | markdownify }}</div>{{ 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 }}
<br />
{{ end }}
{{ if (.Site.Params.DisqusShortname) }}
<br />
{{ partial "disqus-comment.html" . }}
{{ end }}
<div class="text-muted mt-5 pt-3 border-top">{{ partial "page-meta-lastmod.html" . }}</div>
{{ .Content }}
{{ if (and (not .Params.hide_feedback) (.Site.Params.ui.feedback.enable) (.Site.GoogleAnalytics)) }}
{{ partial "feedback.html" .Site.Params.ui.feedback }}
<br />
{{ end }}
{{ if (.Site.Params.DisqusShortname) }}
<br />
{{ partial "disqus-comment.html" . }}
{{ end }}
<div class="text-muted mt-5 pt-3 border-top">{{ partial "page-meta-lastmod.html" . }}</div>
</div>
8 changes: 8 additions & 0 deletions layouts/_default/taxonomy.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{{ define "main" }}
<section>
{{ range .Pages }}
{{ partial "summary.html" . }}
{{ end }}
</section>
{{ end }}

13 changes: 13 additions & 0 deletions layouts/_default/terms.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{{ define "main" }}
<section>
<header>
<h4>List of article {{ .Section }}</h4>
</header>
</section>
{{ range $key, $value := .Data.Terms }}
{{ $postCount := len $value.Pages }}
<a href="{{ "/" | relLangURL }}{{ $.Data.Plural | urlize }}/{{ $key | urlize }}">
<h5>{{ $key }} :
<span class="badge badge-light">{{ $postCount }}</span></h5></a>
{{ end }}
{{ end }}
3 changes: 3 additions & 0 deletions layouts/partials/article_meta.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<header class="article-meta clearfix">
{{ partial "article_tags.html" . }}
</header>
7 changes: 7 additions & 0 deletions layouts/partials/article_tags.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{{ with (.GetTerms "tags")}}
<div class="article-tags">
{{ range . }}
<span class="badge badge-light"><a class="article-tags-link" href="{{ .Permalink }}">{{ .Name }}</a></span>
{{ end }}
</div>
{{end}}
12 changes: 12 additions & 0 deletions layouts/partials/summary.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<div class="pageinfo pageinfo-primary">
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tag-summary.html might be a better name, given it has an explicit purpose

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i also note that most files in docsy use dash as a separator rather than underscore, though i don't know if that was intended to be a rule; would be nice to be consistent

<div class = 'summary'>
<div class = 'summary_header'>
<h3 class = 'post_link'>
<a href='{{ .Permalink }}'>{{ .Title }}</a>
</h3>
{{ partial "article_meta.html" . }}
</div>
<p class = 'summary_section'>{{ .Summary | truncate 320 }}</p>
<a href='{{ .Permalink }}' class='excerpt_more button'>Read More</a>
</div>
</div>
14 changes: 14 additions & 0 deletions layouts/partials/tags.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<hr>
{{ if isset .Site.Taxonomies "tags" }}
{{ if not (eq (len .Site.Taxonomies.tags) 0) }}
<div class="tagslist">
<p class="asidetitle">{{ .Site.Params.Strings.Tags | default "Tag Cloud" }}</p>
<ul class="clearfix">
{{ range $name, $items := .Site.Taxonomies.tags }}
<li><a href="{{ .Page.Permalink }}" title="{{ $name }}">{{ .Page.Title }}<sup>{{ len $items }}</sup></a></li>
{{ end }}
</ul>
</div>
{{ end }}
{{ end }}
<hr>
3 changes: 2 additions & 1 deletion layouts/partials/toc.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@
{{ . }}
{{ end }}
{{ end }}
{{ end }}
<!-- {{ partial "tags.html" . }} -->
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

presumably this could use partialCached as it only needs to be constructed once for the whole site

{{ end }}
2 changes: 1 addition & 1 deletion netlify.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
3 changes: 2 additions & 1 deletion userguide/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ defaultContentLanguageInSubdir = false
# Useful when translating.
enableMissingTranslationPlaceholders = true

disableKinds = ["taxonomy", "taxonomyTerm"]
[taxonomies]
tags = "tags"

# Highlighting config
pygmentsCodeFences = true
Expand Down
19 changes: 19 additions & 0 deletions userguide/content/en/docs/Best practices/site-guidance.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

<img src="/images/tag-demo-2.PNG" width='700px'>
<br>

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.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd much prefer to have a config param for this so as not to have to make a copy of the partial just to change one line

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i actually attempted to use a param that could be set with an if statement in toc.html, but I couldn't get it to work in my testing. I'd rather it be accomplished that way as well.


<img src="/images/tag-demo-1.PNG" width='700px'>
<br>
3 changes: 3 additions & 0 deletions userguide/content/en/docs/Examples/_index.md
Original file line number Diff line number Diff line change
@@ -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!
Expand All @@ -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

Expand Down
Binary file added userguide/static/images/tag-demo-1.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added userguide/static/images/tag-demo-2.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.