-
Notifications
You must be signed in to change notification settings - Fork 968
Issue #272 Add tagging support #324
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
7254c53
ecfc6ef
b2e70ca
5bc80d7
6b927b8
99efb75
9344e63
25aca3c
419edb1
57a9c5b
6b53d12
79f325e
e8e4908
6361d91
b6a63c3
a10ebf8
adde333
7acec37
32e7a19
63ddc3e
d55cec7
fa881dd
ec00013
672856c
c2a226e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| 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> |
| 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 }} | ||
|
|
| 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 }} |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| <header class="article-meta clearfix"> | ||
| {{ partial "article_tags.html" . }} | ||
| </header> |
| 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}} |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| <div class="pageinfo pageinfo-primary"> | ||
| <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> | ||
| 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> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,4 +5,5 @@ | |
| {{ . }} | ||
| {{ end }} | ||
| {{ end }} | ||
| {{ end }} | ||
| <!-- {{ partial "tags.html" . }} --> | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. presumably this could use |
||
| {{ end }} | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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> | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tag-summary.htmlmight be a better name, given it has an explicit purposeThere was a problem hiding this comment.
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