wrap up series module and added docs

This commit is contained in:
Nuno Coração 2022-10-17 22:28:39 +01:00
parent a3d301e386
commit a7a780971c
28 changed files with 94 additions and 43 deletions

View file

@ -1570,6 +1570,10 @@ select {
margin-left: 0.5rem;
}
.ml-0 {
margin-left: 0px;
}
.\!mb-9 {
margin-bottom: 2.25rem !important;
}
@ -3382,16 +3386,16 @@ body:has(#menu-controller:checked) {
background-color: rgba(var(--color-neutral-700), var(--tw-bg-opacity));
}
.dark .dark\:bg-primary-900 {
--tw-bg-opacity: 1;
background-color: rgba(var(--color-primary-900), var(--tw-bg-opacity));
}
.dark .dark\:bg-primary-800 {
--tw-bg-opacity: 1;
background-color: rgba(var(--color-primary-800), var(--tw-bg-opacity));
}
.dark .dark\:bg-primary-900 {
--tw-bg-opacity: 1;
background-color: rgba(var(--color-primary-900), var(--tw-bg-opacity));
}
.dark .dark\:from-neutral-800 {
--tw-gradient-from: rgba(var(--color-neutral-800), 1);
--tw-gradient-to: rgba(var(--color-neutral-800), 0);

View file

@ -2,6 +2,7 @@
# Refer to the theme docs for more details about each of these parameters.
# https://nunocoracao.github.io/blowfish/docs/getting-started/
# theme = "blowfish"
# baseURL = "https://your_domain.com/"
defaultContentLanguage = "en"

View file

@ -42,6 +42,7 @@ enableCodeCopy = true
showEdit = true
# editURL = "https://github.com/username/repo/"
editAppendPath = true
seriesOpened = false
showHeadingAnchors = true
showPagination = true
invertPagination = false

View file

@ -42,6 +42,7 @@ mainSections = ["docs"]
showEdit = true
editURL = "https://github.com/nunocoracao/blowfish/tree/main/exampleSite/content"
editAppendPath = true
seriesOpened = false
showHeadingAnchors = true
showPagination = true
invertPagination = false

View file

@ -5,8 +5,8 @@ draft: false
description: "Learn how to build Blowfish manually."
slug: "advanced-customisation"
tags: ["advanced", "css", "docs"]
series: ["Docs"]
series_order: 12
series: ["Documentation"]
series_order: 13
---
There are many ways you can make advanced changes to Blowfish. Read below to learn more about what can be customised and the best way of achieving your desired result.

View file

@ -5,7 +5,7 @@ draft: false
description: "All the configuration variables available in Blowfish."
slug: "configuration"
tags: ["config", "docs"]
series: ["Docs"]
series: ["Documentation"]
series_order: 4
---
@ -155,6 +155,7 @@ Many of the article defaults here can be overridden on a per article basis by sp
|`article.showEdit`|`false`|Whether or not the link to edit the article content should be displayed.|
|`article.editURL`|_Not set_|When `article.showEdit` is active, the URL for the edit link.|
|`article.editAppendPath`|`true`|When `article.showEdit` is active, whether or not the path to the current article should be appended to the URL set at `article.editURL`.|
|`article.seriesOpened`|`false`|Whether or not the series module will be displayed open by default or not.|
|`article.showHeadingAnchors`|`true`|Whether or not heading anchor links are displayed alongside headings within articles.|
|`article.showPagination`|`true`|Whether or not the next/previous article links are displayed in the article footer.|
|`article.invertPagination`|`false`|Whether or not to flip the direction of the next/previous article links.|

View file

@ -5,8 +5,8 @@ draft: false
description: "All the partials available in Blowfish."
slug: "content-examples"
tags: ["content", "example"]
series: ["Docs"]
series_order: 11
series: ["Documentation"]
series_order: 12
---
If you've been reading the documentation in order, you should now know about all the features and configurations available in Blowfish. This page is designed to pull everything together and offer some worked examples that you might like to use in your Hugo project.

View file

@ -5,8 +5,8 @@ draft: false
description: "Learn how to integrate Firebase and get dynamic data for views and likes."
slug: "firebase-views"
tags: ["firebase", "views", likes]
series: ["Docs"]
series_order: 14
series: ["Documentation"]
series_order: 15
---
In order to be able to support dynamic data across your website we've added the support to integrate Firebase. This will allow you to use the views feature across lists and posts.

View file

@ -5,7 +5,7 @@ draft: false
description: "All the front matter variables available in Blowfish."
slug: "front-matter"
tags: ["front matter", "config", "docs"]
series: ["Docs"]
series: ["Documentation"]
series_order: 7
---
@ -45,6 +45,9 @@ Front matter parameter default values are inherited from the theme's [base confi
|`showSummary`|`list.showSummary`|Whether or not the article summary should be displayed on list pages.|
|`showViews`|`article.showViews`|Whether or not the article views should be displayed in lists and detailed view. This requires a firebase integration. Check [this page]({{< ref "firebase-views" >}}) for a guide on how to integrate Firebase into Blowfish|
|`showLikes`|`article.showLikes`|Whether or not the article likes should be displayed in lists and detailed view. This requires a firebase integration. Check [this page]({{< ref "firebase-views" >}}) for a guide on how to integrate Firebase into Blowfish|
|`seriesOpened`|`article.seriesOpened`|Whether or not the series module will be displayed open by default or not.|
|`series`|_Not set_|Array of series the article belongs to, we recommend using only one series per article.|
|`series_order`|_Not set_|Number of the article within the series.|
|`summary`|Auto generated using `summaryLength` (see [site configuration]({{< ref "configuration#site-configuration" >}}))|When `showSummary` is enabled, this is the Markdown string to be used as the summary for this article.|
|`xml`|`true` unless excluded by `sitemap.excludedKinds`|Whether or not this article is included in the generated `/sitemap.xml` file.|
<!-- prettier-ignore-end -->

View file

@ -5,7 +5,7 @@ draft: false
description: "All the front matter variables available in Blowfish."
slug: "getting-started"
tags: ["installation", "docs"]
series: ["Docs"]
series: ["Documentation"]
series_order: 3
---

View file

@ -5,7 +5,7 @@ draft: false
description: "Configuring the homepage layout in the Blowfish theme."
slug: "homepage-layout"
tags: ["homepage", "layouts", "docs"]
series: ["Docs"]
series: ["Documentation"]
series_order: 5
---

View file

@ -5,8 +5,8 @@ draft: false
description: "Learn how to deploy a Blowfish site."
slug: "hosting-deployment"
tags: ["hosting", "deployment", "docs", "github", "netlify", "render"]
series: ["Docs"]
series_order: 13
series: ["Documentation"]
series_order: 14
---
There are many ways to deploy your Hugo website built with Blowfish. The theme is designed to be flexible in almost any deployment scenario.

View file

@ -5,7 +5,7 @@ draft: false
description: "How to install the Blowfish theme."
slug: "installation"
tags: ["installation", "docs"]
series: ["Docs"]
series: ["Documentation"]
series_order: 2
---

View file

@ -5,7 +5,7 @@ draft: false
description: "Configure multiple authors for your articles."
slug: "multi-author"
tags: ["authors", "config", "docs"]
series: ["Docs"]
series: ["Documentation"]
series_order: 10
showAuthor: true
authors:

View file

@ -5,7 +5,7 @@ draft: false
description: "All the partials available in Blowfish."
slug: "partials"
tags: ["partials", "analytics", "privacy", "comments", "favicons", "icon", "docs"]
series: ["Docs"]
series: ["Documentation"]
series_order: 9
---

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 MiB

View file

@ -0,0 +1,36 @@
---
title: "Series"
date: 2020-08-09
draft: false
description: "Learn how to group articles under a series."
slug: "series"
tags: ["series", "docs"]
series: ["Documentation"]
series_order: 11
seriesOpened: true
---
Blowfish provides a feature to group a set of articles together under a "series". Placing an article under a series will display the rest of the series articles in each single page and provide a quick way to navigate amongst them. You can see an example of this above.
## Create Taxonomy
The first step to enable series is to create the `series` taxonomy. For doing this just add the `series` taxonomy to your taxonomy list in the `config.toml`.
```toml
[taxonomies]
tag = "tags"
category = "categories"
author = "authors"
series = "series"
```
## Mark Articles
Then you just need to mark each article using the `series` parameter and the `series_order`. The `series` parameter will be the id and name of the series you are placing the article into (even though the variable is an array we recommend keeping each article to a single series.). And the `series_order` defines the order of that article within the series. In the example below the article is number `11` in the `Documentation` series.
```md
series: ["Documentation"]
series_order: 11
```
## Series Behavior
Marking an article as part of a series will automatically display the series module as you see in this page for example. You can choose whether that module starts opened or not using the `article.seriesOpened` global variable in `params.toml` or the front-matter parameter `seriesOpened` to specify an override at the article level.

View file

@ -5,7 +5,7 @@ draft: false
description: "All the shortcodes available in Blowfish."
slug: "shortcodes"
tags: ["shortcodes", "mermaid", "icon", "lead", "docs"]
series: ["Docs"]
series: ["Documentation"]
series_order: 8
---

View file

@ -5,7 +5,7 @@ draft: false
description: "Turn on thumbnails for your articles."
slug: "thumbnails"
tags: ["thumbnail", "config", "docs"]
series: ["Docs"]
series: ["Documentation"]
series_order: 6
---

View file

@ -4,7 +4,7 @@ date: 2022-01-19
draft: false
description: "Discover what's new in Blowfish version 2.0."
tags: ["new", "docs"]
series: ["Docs"]
series: ["Documentation"]
series_order: 1
---

View file

@ -64,7 +64,7 @@
{{ if .Params.showTaxonomies | default (.Site.Params.article.showTaxonomies | default false) }}
<div class="flex flex-row flex-wrap items-center">
{{ range $taxonomy, $terms := .Site.Taxonomies }}
{{ if not (eq $taxonomy "authors")}}
{{ if and (not (eq $taxonomy "authors")) (not (eq $taxonomy "series"))}}
{{ if (gt (len ($context.GetTerms $taxonomy)) 0) }}
{{ range $context.GetTerms $taxonomy }}
<span style="margin-top:0.5rem" class="mr-2" onclick="window.open({{ .RelPermalink }});">

View file

@ -1,20 +1,24 @@
{{ if .Params.series }}
<div>
<h4>This article is part of a series.</h4>
<ul class="list-group">
{{ range $post := sort (index .Site.Taxonomies.series (index .Params.series 0 | urlize)) "Params.series_order" }}
{{ if eq $post.Permalink $.Page.Permalink }}
<li class="list-group-item my-0 active">
Part {{ $post.Params.series_order }}: This Article
</li>
{{ else }}
<li class="list-group-item my-0">
<a href="{{$post.Permalink}}">
Part {{ $post.Params.series_order }}: {{ $post.Params.title}}
</a>
</li>
{{end}}
{{end}}
</ul>
</div>
{{end}}
<details style="margin-left:0px" class="mt-0 ml-0 overflow-hidden rounded-lg ltr:-ml-5 ltr:pl-5 rtl:-mr-5 rtl:pr-5" {{ if .Params.seriesOpened | default (.Site.Params.article.seriesOpened | default false) }} open {{ end }}>
<summary
class="py-1 text-lg font-semibold cursor-pointer bg-primary-200 text-neutral-800 ltr:-ml-5 ltr:pl-5 rtl:-mr-5 rtl:pr-5 dark:bg-primary-800 dark:text-neutral-100">
{{ index .Params.series 0 }} - This article is part of a series.
</summary>
{{ range $post := sort (index .Site.Taxonomies.series (index .Params.series 0 | urlize)) "Params.series_order" }}
{{ if eq $post.Permalink $.Page.Permalink }}
<div
class="py-1 border-dotted border-neutral-300 ltr:-ml-5 ltr:border-l ltr:pl-5 rtl:-mr-5 rtl:border-r rtl:pr-5 dark:border-neutral-600">
Part {{ $post.Params.series_order }}: This Article
</div>
{{ else }}
<div
class="py-1 border-dotted border-neutral-300 ltr:-ml-5 ltr:border-l ltr:pl-5 rtl:-mr-5 rtl:border-r rtl:pr-5 dark:border-neutral-600">
<a href="{{$post.Permalink}}">
Part {{ $post.Params.series_order }}: {{ $post.Params.title}}
</a>
</div>
{{end}}
{{end}}
</details>
{{end}}