From f2d3ff157287a3c9be955af4ff05de27ab966557 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nuno=20Cora=C3=A7=C3=A3o?= Date: Sat, 5 Nov 2022 15:11:20 +0000 Subject: [PATCH 1/2] implemented card gallery for lists --- assets/css/compiled/main.css | 96 +++++++++---- assets/css/main.css | 7 + config/_default/params.toml | 4 + exampleSite/assets/js/home.js | 51 ++++++- exampleSite/config/_default/params.toml | 11 +- exampleSite/content/.Ulysses-Settings.plist | 14 -- exampleSite/content/_index.md | 2 +- .../content/docs/configuration/index.md | 4 + .../content/docs/homepage-layout/index.md | 6 +- exampleSite/content/samples/_index.md | 2 +- exampleSite/layouts/partials/home/custom.html | 13 +- .../partials/recent-articles-demo.html | 64 +++++++++ layouts/_default/list.html | 130 +++++++++++++----- layouts/partials/article-link-card.html | 64 +++++++++ layouts/partials/article-link.html | 4 +- layouts/partials/recent-articles.html | 63 ++++++--- 16 files changed, 429 insertions(+), 106 deletions(-) delete mode 100644 exampleSite/content/.Ulysses-Settings.plist create mode 100644 exampleSite/layouts/partials/recent-articles-demo.html create mode 100644 layouts/partials/article-link-card.html diff --git a/assets/css/compiled/main.css b/assets/css/compiled/main.css index 2dc412e17..704b73374 100644 --- a/assets/css/compiled/main.css +++ b/assets/css/compiled/main.css @@ -1413,14 +1413,18 @@ select { top: calc(100vh - 5.5rem); } -.top-20 { - top: 5rem; -} - .top-0 { top: 0px; } +.right-0 { + right: 0px; +} + +.top-20 { + top: 5rem; +} + .z-50 { z-index: 50; } @@ -1441,6 +1445,10 @@ select { margin: auto; } +.m-2 { + margin: 0.5rem; +} + .m-1 { margin: 0.25rem; } @@ -1499,6 +1507,10 @@ select { margin-top: 3rem; } +.mb-5 { + margin-bottom: 1.25rem; +} + .mt-10 { margin-top: 2.5rem; } @@ -1575,10 +1587,6 @@ select { margin-top: 0.5rem; } -.mb-5 { - margin-bottom: 1.25rem; -} - .\!mb-9 { margin-bottom: 2.25rem !important; } @@ -1671,6 +1679,10 @@ select { width: 3rem; } +.w-screen { + width: 100vw; +} + .w-full { width: 100%; } @@ -1683,10 +1695,6 @@ select { width: 6rem; } -.w-screen { - width: 100vw; -} - .w-8 { width: 2rem; } @@ -1699,6 +1707,10 @@ select { min-width: 0px; } +.min-w-full { + min-width: 100%; +} + .min-w-\[1\.8rem\] { min-width: 1.8rem; } @@ -1844,14 +1856,14 @@ select { border-radius: 9999px; } -.rounded-md { - border-radius: 0.375rem; -} - .rounded { border-radius: 0.25rem; } +.rounded-md { + border-radius: 0.375rem; +} + .rounded-lg { border-radius: 0.5rem; } @@ -1889,14 +1901,14 @@ select { border-style: dotted; } -.border-neutral-400 { +.border-neutral-300 { --tw-border-opacity: 1; - border-color: rgba(var(--color-neutral-400), var(--tw-border-opacity)); + border-color: rgba(var(--color-neutral-300), var(--tw-border-opacity)); } -.border-neutral-300 { +.border-neutral-400 { --tw-border-opacity: 1; - border-color: rgba(var(--color-neutral-300), var(--tw-border-opacity)); + border-color: rgba(var(--color-neutral-400), var(--tw-border-opacity)); } .border-neutral-200 { @@ -2055,6 +2067,11 @@ select { padding-right: 0.5rem; } +.py-4 { + padding-top: 1rem; + padding-bottom: 1rem; +} + .px-1 { padding-left: 0.25rem; padding-right: 0.25rem; @@ -2095,6 +2112,14 @@ select { padding-bottom: 4rem; } +.pl-8 { + padding-left: 2rem; +} + +.pr-8 { + padding-right: 2rem; +} + .pt-8 { padding-top: 2rem; } @@ -2103,6 +2128,14 @@ select { padding-top: 0.75rem; } +.pt-4 { + padding-top: 1rem; +} + +.pb-2 { + padding-bottom: 0.5rem; +} + .pl-2 { padding-left: 0.5rem; } @@ -2111,10 +2144,6 @@ select { padding-bottom: 1rem; } -.pt-4 { - padding-top: 1rem; -} - .pt-16 { padding-top: 4rem; } @@ -2311,6 +2340,12 @@ select { mix-blend-mode: multiply; } +.shadow-2xl { + --tw-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.25); + --tw-shadow-colored: 0 25px 50px -12px var(--tw-shadow-color); + box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow); +} + .shadow-lg { --tw-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1); --tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color); @@ -3015,6 +3050,13 @@ body:has(#menu-controller:checked) { background-position:center; } +.thumbnail_card { + height: 300px; + background-repeat:no-repeat; + background-size:cover; + background-position:center; +} + .single_hero_basic { background-repeat:no-repeat; background-size:cover; @@ -3771,4 +3813,10 @@ body:has(#menu-controller:checked) { .xl\:w-1\/4 { width: 25%; } +} + +@media (min-width: 1536px) { + .\32xl\:w-1\/5 { + width: 20%; + } } \ No newline at end of file diff --git a/assets/css/main.css b/assets/css/main.css index fb16a5f28..9fe984caa 100644 --- a/assets/css/main.css +++ b/assets/css/main.css @@ -347,6 +347,13 @@ body:has(#menu-controller:checked) { background-position:center; } +.thumbnail_card { + height: 300px; + background-repeat:no-repeat; + background-size:cover; + background-position:center; +} + .single_hero_basic { background-repeat:no-repeat; background-size:cover; diff --git a/config/_default/params.toml b/config/_default/params.toml index 5c5b4f87e..967dbdac5 100644 --- a/config/_default/params.toml +++ b/config/_default/params.toml @@ -29,6 +29,8 @@ enableCodeCopy = true showRecentItems = 5 showMoreLink = false showMoreLinkDest = "/posts" + cardView = false + cardViewScreenWidth = false [article] showDate = true @@ -61,6 +63,8 @@ enableCodeCopy = true showTableOfContents = false showCards = false groupByYear = true + cardView = false + cardViewScreenWidth = false [sitemap] excludedKinds = [] diff --git a/exampleSite/assets/js/home.js b/exampleSite/assets/js/home.js index 509b29653..7e3918be7 100644 --- a/exampleSite/assets/js/home.js +++ b/exampleSite/assets/js/home.js @@ -1,9 +1,9 @@ var layouts = [ + "profile", "background", "hero", - "profile", - "card", - "page" + "page", + "card" ] var currentLayout = 0 @@ -33,3 +33,48 @@ window.addEventListener("DOMContentLoaded", (event) => { }) ); }); + +var list_config = [ + "CardViewProse", + "CardViewScreenWidth", + "NormalView" +] + +var titles = { + "CardViewProse" : "card view with constrained width", + "CardViewScreenWidth" : "card view with full width", + "NormalView" : "standard list view" +} + +var currentConfig = 0 + +function switchList() { + + var old = currentConfig + currentConfig = currentConfig == list_config.length - 1 ? 0 : currentConfig + 1 + + var oldDiv = document.getElementById(list_config[old]) + var currentDiv = document.getElementById(list_config[currentConfig]) + const configCode = document.querySelectorAll("code[id=config]"); + + console.log(currentConfig) + console.log(oldDiv) + console.log(currentDiv) + + currentDiv.style.display = "block"; + oldDiv.style.display = "none"; + + configCode.forEach(function (el) { + el.innerText = titles[list_config[currentConfig]]; + }); + +} + +window.addEventListener("DOMContentLoaded", (event) => { + document.querySelectorAll("#switch-config-button").forEach((button) => + button.addEventListener("click", function (e) { + e.preventDefault(); + switchList(); + }) + ); +}); diff --git a/exampleSite/config/_default/params.toml b/exampleSite/config/_default/params.toml index da1577b0f..5c51c9700 100644 --- a/exampleSite/config/_default/params.toml +++ b/exampleSite/config/_default/params.toml @@ -25,10 +25,13 @@ mainSections = ["docs"] [homepage] layout = "custom" # valid options: page, profile, hero, card, background, custom homepageImage = "/img/iceland.jpg" # used in: hero, and card - showRecent = true - showRecentItems = 5 + showRecent = false + showRecentItems = 10 showMoreLink = true showMoreLinkDest = "docs" + cardView = true + cardViewScreenWidth = false + [article] showDate = false @@ -57,10 +60,12 @@ mainSections = ["docs"] [list] showBreadcrumbs = false - showSummary = true + showSummary = false showTableOfContents = true showCards = true groupByYear = false + cardView = true + cardViewScreenWidth = false [sitemap] excludedKinds = ["taxonomy","term"] diff --git a/exampleSite/content/.Ulysses-Settings.plist b/exampleSite/content/.Ulysses-Settings.plist deleted file mode 100644 index fe51321ed..000000000 --- a/exampleSite/content/.Ulysses-Settings.plist +++ /dev/null @@ -1,14 +0,0 @@ - - - - - defaultPathExtensions - md - enforceFencedCodeBlocks - - sheetFormat - foreign - useInlineLinks - - - diff --git a/exampleSite/content/_index.md b/exampleSite/content/_index.md index 46fc8aea5..704d3ec1f 100755 --- a/exampleSite/content/_index.md +++ b/exampleSite/content/_index.md @@ -10,7 +10,7 @@ This is a demo site built entirely using Blowfish. It also contains a complete s {{< icon "triangle-exclamation" >}} - This is a demo of the background layout. + This is a demo of the profile layout. + + + +
+
+
+ {{ range first $recentArticles (.Paginate (where .Site.RegularPages "Type" "in" + .Site.Params.mainSections)).Pages }} +
+ {{ partial "article-link-card.html" . }} +
+ {{ end }} +
+
+
+ + + +{{ if .Site.Params.homepage.showMoreLink | default false }} +{{ if index .Site.Params.homepage "showRecentItems" }} +{{ $showMoreLinkDest = .Site.Params.homepage.showMoreLinkDest }} +{{ end }} +
+ + + +
+{{ end }} \ No newline at end of file diff --git a/layouts/_default/list.html b/layouts/_default/list.html index 4462abef9..ab9161623 100644 --- a/layouts/_default/list.html +++ b/layouts/_default/list.html @@ -1,49 +1,111 @@ {{ define "main" }} - {{ $toc := and (.Params.showTableOfContents | default (.Site.Params.list.showTableOfContents | default false)) (in .TableOfContents " - {{ if .Params.showBreadcrumbs | default (.Site.Params.list.showBreadcrumbs | default false) }} - {{ partial "breadcrumbs.html" . }} - {{ end }} -

{{ .Title }}

+{{ $toc := and (.Params.showTableOfContents | default (.Site.Params.list.showTableOfContents | default false)) (in +.TableOfContents " + {{ if .Params.showBreadcrumbs | default (.Site.Params.list.showBreadcrumbs | default false) }} + {{ partial "breadcrumbs.html" . }} + {{ end }} +

{{ .Title }}

-
+ {{- end }} prose flex max-w-full flex-col dark:prose-invert lg:flex-row"> {{ if $toc }} -
-
- {{ partial "toc.html" . }} -
+
+
+ {{ partial "toc.html" . }}
+
{{ end }}
{{ .Content | emojify }}
{{ if gt .Pages 0 }} -
- {{ range (.Paginate (.Pages.GroupByDate "2006")).PageGroups }} - {{ if $.Params.groupByYear | default ($.Site.Params.list.groupByYear | default true) }} -

+ + {{ if .Site.Params.list.cardView | default false }} + + {{ $cardViewScreenWidth := .Site.Params.list.cardViewScreenWidth}} + + {{ if not $.Params.groupByYear | default ($.Site.Params.list.groupByYear | default true) }} + + {{ if $cardViewScreenWidth }} +
+
+ {{ else }} +
+
+ {{ end }} + + {{ end }} + + + + {{ range (.Paginate (.Pages.GroupByDate "2006")).PageGroups }} + {{ if $.Params.groupByYear | default ($.Site.Params.list.groupByYear | default true) }} +

{{ .Key }}

-
- {{ end }} - {{ range .Pages }} - {{ partial "article-link.html" . }} - {{ end }} - {{ end }} -
- {{ partial "pagination.html" . }} - {{ else }} -
-

- {{ i18n "list.no_articles" | emojify }} -

-
- {{ end }} -{{ end }} + {{ else }} + {{ end }} + + {{ if $.Params.groupByYear | default ($.Site.Params.list.groupByYear | default true) }} + + {{ if $cardViewScreenWidth}} +
+
+ {{ else }} +
+
+ {{ end }} + {{ end }} + + {{ range .Pages }} + + {{ if $cardViewScreenWidth }} +
+ {{ else }} +
+ {{ end }} + + {{ partial "article-link-card.html" . }} +
+ {{ end }} + {{ if $.Params.groupByYear | default ($.Site.Params.list.groupByYear | default true) }} +
+
+ {{ end }} + + + {{ end }} + + {{ if not $.Params.groupByYear | default ($.Site.Params.list.groupByYear | default true) }} +
+
+ {{ end }} + + {{ else }} +
+ {{ range (.Paginate (.Pages.GroupByDate "2006")).PageGroups }} + {{ if $.Params.groupByYear | default ($.Site.Params.list.groupByYear | default true) }} +

+ {{ .Key }} +

+ {{ end }} + {{ range .Pages }} + {{ partial "article-link.html" . }} + {{ end }} + {{ end }} +
+ {{ partial "pagination.html" . }} + {{ end }} + + {{ else }} +
+

+ {{ i18n "list.no_articles" | emojify }} +

+
+ {{ end }} + {{ end }} \ No newline at end of file diff --git a/layouts/partials/article-link-card.html b/layouts/partials/article-link-card.html new file mode 100644 index 000000000..4f26f1cb3 --- /dev/null +++ b/layouts/partials/article-link-card.html @@ -0,0 +1,64 @@ +{{ with .Params.externalUrl }} + + {{ else }} + + {{ end }} +
+ + {{- with $.Params.images -}} + {{- range first 6 . }} + {{ end -}} + {{- else -}} + {{- $images := $.Resources.ByType "image" -}} + {{- $featured := $images.GetMatch "*feature*" -}} + {{- if not $featured }}{{ $featured = $images.GetMatch "{*cover*,*thumbnail*}" }}{{ end -}} + {{- with $featured -}} + {{ with .Resize "600x" }} +
+ {{ end }} + {{- else -}} + {{- with $.Site.Params.images }} + {{ end -}} + {{- end -}} + {{- end -}} + + + {{ if and .Draft .Site.Params.article.showDraftLabel }} + + {{ partial "badge.html" (i18n "article.draft" | emojify) }} + + {{ end }} + +
+ + {{ with .Params.externalUrl }} +
+
+ {{ $.Title | emojify }} + + + + +
+
+ {{ else }} +
{{ .Title | emojify }}
+ {{ end }} + +
+ {{ partial "article-meta.html" . }} +
+ + {{ if .Params.showSummary | default (.Site.Params.list.showSummary | default false) }} +
+ {{ .Summary | emojify }} +
+ {{ end }} +
+
+ +
+
+
\ No newline at end of file diff --git a/layouts/partials/article-link.html b/layouts/partials/article-link.html index 06dfb4e31..a429e8aff 100644 --- a/layouts/partials/article-link.html +++ b/layouts/partials/article-link.html @@ -45,7 +45,7 @@ {{ with .Params.externalUrl }}
+ class="font-bold text-xl text-neutral-800 decoration-primary-500 hover:underline hover:underline-offset-2 dark:text-neutral"> {{ $.Title | emojify }} @@ -54,7 +54,7 @@
{{ else }} -
{{ .Title | emojify }}
{{ end }} {{ if and .Draft .Site.Params.article.showDraftLabel }} diff --git a/layouts/partials/recent-articles.html b/layouts/partials/recent-articles.html index bd5fac0be..a80fc6907 100644 --- a/layouts/partials/recent-articles.html +++ b/layouts/partials/recent-articles.html @@ -5,21 +5,48 @@ {{ $recentArticles = .Site.Params.homepage.showRecentItems }} {{ end }}

{{ i18n "shortcode.recent_articles" | emojify }}

-
- {{ range first $recentArticles (.Paginate (where .Site.RegularPages "Type" "in" .Site.Params.mainSections)).Pages }} - {{ partial "article-link.html" . }} - {{ end }} -
-{{ if .Site.Params.homepage.showMoreLink | default false }} -{{ if index .Site.Params.homepage "showRecentItems" }} -{{ $showMoreLinkDest = .Site.Params.homepage.showMoreLinkDest }} -{{ end }} - -{{ end }} -{{ end }} \ No newline at end of file + +{{ if .Site.Params.homepage.cardView | default false }} +{{ if .Site.Params.homepage.cardViewScreenWidth | default false }} +
+
+ {{ else }} +
+
+ {{ end }} + + {{ range first $recentArticles (.Paginate (where .Site.RegularPages "Type" "in" + .Site.Params.mainSections)).Pages }} + + {{ if .Site.Params.homepage.cardViewScreenWidth | default false }} +
+ {{ else }} +
+ {{ end }} + + {{ partial "article-link-card.html" . }} +
+ {{ end }} +
+
+ {{ else }} +
+ {{ range first $recentArticles (.Paginate (where .Site.RegularPages "Type" "in" .Site.Params.mainSections)).Pages + }} + {{ partial "article-link.html" . }} + {{ end }} +
+ {{ end }} + {{ if .Site.Params.homepage.showMoreLink | default false }} + {{ if index .Site.Params.homepage "showRecentItems" }} + {{ $showMoreLinkDest = .Site.Params.homepage.showMoreLinkDest }} + {{ end }} + + {{ end }} + {{ end }} \ No newline at end of file From 79e2046a5a636106b5816cc6f3cbb28b1b832dc3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nuno=20Cora=C3=A7=C3=A3o?= Date: Sat, 5 Nov 2022 15:13:11 +0000 Subject: [PATCH 2/2] fixed conflicts --- .../content/docs/configuration/index.md | 234 +++++++++--------- 1 file changed, 117 insertions(+), 117 deletions(-) diff --git a/exampleSite/content/docs/configuration/index.md b/exampleSite/content/docs/configuration/index.md index 836357a73..f53479ae7 100644 --- a/exampleSite/content/docs/configuration/index.md +++ b/exampleSite/content/docs/configuration/index.md @@ -30,17 +30,17 @@ The site configuration is managed through the `config/_default/config.toml` file Note that the variable names provided in this table use dot notation to simplify the TOML data structure (ie. `outputs.home` refers to `[outputs] home`). -|Name|Default|Description| -|---|---|---| -|`theme`|`"blowfish"`|When using Hugo Modules this config value should be removed. For all other installation types, this must be set to `blowfish` for the theme to function.| -|`baseURL`|_Not set_|The URL to the root of the website.| -|`defaultContentLanguage`|`"en"`|This value determines the default language of theme components and content. Refer to the [language and i18n](#language-and-i18n) section below for supported language codes.| -|`enableRobotsTXT`|`true`|When enabled, a `robots.txt` file will be created in the site root that allows search engines to crawl the entire site. If you prefer to provide your own pre-made `robots.txt`, set to `false` and place your file in the `static` directory. For complete control, you may provide a [custom layout]({{< ref "content-examples#custom-layouts" >}}) to generate this file.| -|`paginate`|`10`|The number of articles listed on each page of the article listing.| -|`summaryLength`|`0`|The number of words that are used to generate the article summary when one is not provided in the [front matter]({{< ref "front-matter" >}}). A value of `0` will use the first sentence. This value has no effect when summaries are hidden.| -|`outputs.home`|`["HTML", "RSS", "JSON"]`|The output formats that are generated for the site. Blowfish requires HTML, RSS and JSON for all theme components to work correctly.| -|`permalinks`|_Not set_|Refer to the [Hugo docs](https://gohugo.io/content-management/urls/#permalinks) for permalink configuration.| -|`taxonomies`|_Not set_|Refer to the [Organising content]({{< ref "getting-started#organising-content" >}}) section for taxonomy configuration.| +| Name | Default | Description | +| ------------------------ | ------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `theme` | `"blowfish"` | When using Hugo Modules this config value should be removed. For all other installation types, this must be set to `blowfish` for the theme to function. | +| `baseURL` | _Not set_ | The URL to the root of the website. | +| `defaultContentLanguage` | `"en"` | This value determines the default language of theme components and content. Refer to the [language and i18n](#language-and-i18n) section below for supported language codes. | +| `enableRobotsTXT` | `true` | When enabled, a `robots.txt` file will be created in the site root that allows search engines to crawl the entire site. If you prefer to provide your own pre-made `robots.txt`, set to `false` and place your file in the `static` directory. For complete control, you may provide a [custom layout]({{< ref "content-examples#custom-layouts" >}}) to generate this file. | +| `paginate` | `10` | The number of articles listed on each page of the article listing. | +| `summaryLength` | `0` | The number of words that are used to generate the article summary when one is not provided in the [front matter]({{< ref "front-matter" >}}). A value of `0` will use the first sentence. This value has no effect when summaries are hidden. | +| `outputs.home` | `["HTML", "RSS", "JSON"]` | The output formats that are generated for the site. Blowfish requires HTML, RSS and JSON for all theme components to work correctly. | +| `permalinks` | _Not set_ | Refer to the [Hugo docs](https://gohugo.io/content-management/urls/#permalinks) for permalink configuration. | +| `taxonomies` | _Not set_ | Refer to the [Organising content]({{< ref "getting-started#organising-content" >}}) section for taxonomy configuration. | ## Thumbnails @@ -55,26 +55,26 @@ Blowfish is optimised for full multilingual websites and theme assets are transl The theme currently supports the following languages by default: -| Language | Code | -| -------------------------------------- | ------- | -| :gb: English | `en` | -| :bangladesh: Bengali | `bn` | -| :cn: Simplified Chinese (China) | `zh-cn` | -| :taiwan: Traditional Chinese (Taiwan) | `zh-tw` | -| :finland: Finnish | `fi` | -| :fr: French | `fr` | -| :de: German | `de` | -| :israel: Hebrew | `he` | -| :hungary: Hungarian | `hu` | -| :it: Italian | `it` | -| :jp: Japanese | `ja` | -| :brazil: Portuguese (Brazil) | `pt-br` | -| :portugal: Portuguese (Portugal) | `pt-pt` | -| :poland: Polish | `pl` | -| :romania: Romanian | `ro` | -| :es: Spanish (Spain) | `es` | -| :tr: Turkish | `tr` | -| 🇭🇷 Croatian | `hr` | +| Language | Code | +| ------------------------------------- | ------- | +| :gb: English | `en` | +| :bangladesh: Bengali | `bn` | +| :cn: Simplified Chinese (China) | `zh-cn` | +| :taiwan: Traditional Chinese (Taiwan) | `zh-tw` | +| :finland: Finnish | `fi` | +| :fr: French | `fr` | +| :de: German | `de` | +| :israel: Hebrew | `he` | +| :hungary: Hungarian | `hu` | +| :it: Italian | `it` | +| :jp: Japanese | `ja` | +| :brazil: Portuguese (Brazil) | `pt-br` | +| :portugal: Portuguese (Portugal) | `pt-pt` | +| :poland: Polish | `pl` | +| :romania: Romanian | `ro` | +| :es: Spanish (Spain) | `es` | +| :tr: Turkish | `tr` | +| 🇭🇷 Croatian | `hr` | The default translations can be overridden by creating a custom file in `i18n/[code].yaml` that contains the translation strings. You can also use this method to add new languages. If you'd like to share a new translation with the community, please [open a pull request](https://github.com/nunocoracao/blowfish/pulls). @@ -89,23 +89,23 @@ The default file can be used as a template to create additional languages, or re {{< /alert >}} -|Name|Default|Description| -|---|---|---| -|`languageCode`|`"en"`|The Hugo language code for this file. It can be a top-level language (ie. `en`) or a sub-variant (ie. `en-au`) and should match the language code in the filename. Hugo expects this value to always be in lowercase. For proper HTML compliance, set the `isoCode` parameter which is case-sensitive.| -|`languageName`|`"English"`|The name of the language.| -|`displayName`|`"EN"`|The name used when the language appears on the website.| -|`isoCode`|`"en"`|The ISO language code for HTML metadata purposes. It can be a top-level language (ie. `en`) or a sub-variant (ie. `en-AU`).| -|`weight`|`1`|The weight determines the order of languages when building multilingual sites.| -|`rtl`|`false`|Whether or not this is a RTL language. Set to `true` to reflow content from right-to-left. Blowfish fully supports using RTL and LTR languages at the same time and will dynamically adjust to both.| -|`dateFormat`|`"2 January 2006"`|How dates are formatted in this language. Refer to the [Hugo docs](https://gohugo.io/functions/format/#gos-layout-string) for acceptable formats.| -|`title`|`"Blowfish"`|The title of the website. This will be displayed in the site header and footer.| -|`description`|_Not set_|The website description. This will be used in the site metadata.| -|`copyright`|_Not set_|A Markdown string containing the copyright message to be displayed in the site footer. If none is provided, Blowfish will automatically generate a copyright string using the site `title`.| -|`author.name`|_Not set_|The author's name. This will be displayed in article footers, and on the homepage when the profile layout is used.| -|`author.image`|_Not set_|Path to the image file of the author. The image should be a 1:1 aspect ratio and placed in the site's `assets/` folder.| -|`author.headline`|_Not set_|A Markdown string containing the author's headline. It will be displayed on the profile homepage under the author's name.| -|`author.bio`|_Not set_|A Markdown string containing the author's bio. It will be displayed in article footers.| -|`author.links`|_Not set_|The links to display alongside the author's details. The config file contains example links which can simply be uncommented to enable. The order that the links are displayed is determined by the order they appear in the array. Custom links can be added by providing corresponding SVG icon assets in `assets/icons/`.| +| Name | Default | Description | +| ----------------- | ------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `languageCode` | `"en"` | The Hugo language code for this file. It can be a top-level language (ie. `en`) or a sub-variant (ie. `en-au`) and should match the language code in the filename. Hugo expects this value to always be in lowercase. For proper HTML compliance, set the `isoCode` parameter which is case-sensitive. | +| `languageName` | `"English"` | The name of the language. | +| `displayName` | `"EN"` | The name used when the language appears on the website. | +| `isoCode` | `"en"` | The ISO language code for HTML metadata purposes. It can be a top-level language (ie. `en`) or a sub-variant (ie. `en-AU`). | +| `weight` | `1` | The weight determines the order of languages when building multilingual sites. | +| `rtl` | `false` | Whether or not this is a RTL language. Set to `true` to reflow content from right-to-left. Blowfish fully supports using RTL and LTR languages at the same time and will dynamically adjust to both. | +| `dateFormat` | `"2 January 2006"` | How dates are formatted in this language. Refer to the [Hugo docs](https://gohugo.io/functions/format/#gos-layout-string) for acceptable formats. | +| `title` | `"Blowfish"` | The title of the website. This will be displayed in the site header and footer. | +| `description` | _Not set_ | The website description. This will be used in the site metadata. | +| `copyright` | _Not set_ | A Markdown string containing the copyright message to be displayed in the site footer. If none is provided, Blowfish will automatically generate a copyright string using the site `title`. | +| `author.name` | _Not set_ | The author's name. This will be displayed in article footers, and on the homepage when the profile layout is used. | +| `author.image` | _Not set_ | Path to the image file of the author. The image should be a 1:1 aspect ratio and placed in the site's `assets/` folder. | +| `author.headline` | _Not set_ | A Markdown string containing the author's headline. It will be displayed on the profile homepage under the author's name. | +| `author.bio` | _Not set_ | A Markdown string containing the author's bio. It will be displayed in article footers. | +| `author.links` | _Not set_ | The links to display alongside the author's details. The config file contains example links which can simply be uncommented to enable. The order that the links are displayed is determined by the order they appear in the array. Custom links can be added by providing corresponding SVG icon assets in `assets/icons/`. | ### Menus @@ -123,75 +123,75 @@ Blowfish provides a large number of configuration parameters that control how th Many of the article defaults here can be overridden on a per article basis by specifying it in the front matter. Refer to the [Front Matter]({{< ref "front-matter" >}}) section for further details. -|Name|Default|Description| -|---|---|---| -|`colorScheme`|`"blowfish"`|The theme colour scheme to use. Valid values are `blowfish` (default), `avocado`, `ocean`, `fire` and `slate`. Refer to the [Colour Schemes]({{< ref "getting-started#colour-schemes" >}}) section for more details.| -|`defaultAppearance`|`"light"`|The default theme appearance, either `light` or `dark`.| -|`autoSwitchAppearance`|`true`|Whether the theme appearance automatically switches based upon the visitor's operating system preference. Set to `false` to force the site to always use the `defaultAppearance`.| -|`enableSearch`|`false`|Whether site search is enabled. Set to `true` to enable search functionality. Note that the search feature depends on the `outputs.home` setting in the [site configuration](#site-configuration) being set correctly.| -|`enableCodeCopy`|`false`|Whether copy-to-clipboard buttons are enabled for `` blocks. The `highlight.noClasses` parameter must be set to `false` for code copy to function correctly. Read more about [other configuration files](#other-configuration-files) below.| -|`logo`|_Not set_|The relative path to the site logo file within the `assets/` folder. The logo file should be provided at 2x resolution and supports any image dimensions.| -|`mainSections`|_Not set_|The sections that should be displayed in the recent articles list. If not provided the section with the greatest number of articles is used.| -|`robots`|_Not set_|String that indicates how robots should handle your site. If set, it will be output in the page head. Refer to [Google's docs](https://developers.google.com/search/docs/advanced/robots/robots_meta_tag#directives) for valid values.| -|`disableImageZoom`|`false`|Disables image zoom feature across all the images in the site.| -|`footer.showMenu`|`true`|Show/hide the footer menu, which can be configured in the `[[footer]]` section of the `config/_default/menus.en.toml` file.| -|`footer.showCopyright`|`true`|Whether or not to show the copyright string in the site footer. Note that the string itself can be customised using the `copyright` parameter in the [languages configuration](#language-and-i18n).| -|`footer.showThemeAttribution`|`true`|Whether or not to show the "powered by" theme attribution in the site footer. If you choose to disable this message, please consider attributing the theme somewhere else on your site (for example, on your about page).| -|`footer.showAppearanceSwitcher`|`false`|Whether or not to show the appearance switcher in the site footer. The browser's local storage is used to persist the visitor's preference.| -|`footer.showScrollToTop`|`true`|When set to `true` the scroll to top arrow is displayed.| -|`homepage.layout`|`"profile"`|The layout of the homepage. Valid values are `page`, `profile`, `hero`, `card`, `background`, or `custom`. When set to `custom`, you must provide your own layout by creating a `/layouts/partials/home/custom.html` file. Refer to the [Homepage Layout]({{< ref "homepage-layout" >}}) section for more details.| -|`homepage.homepageImage`|_Not set_|Image to be used in `hero` and `card` layouts. Refer to the [Homepage Layout]({{< ref "homepage-layout" >}}) section for more details.| -|`homepage.showRecent`|`false`|Whether or not to display the recent articles list on the homepage.| -|`homepage.showRecentItems`|5|How many articles to display if showRecent is true. If variable is set to 0 or if it isn't defined the system will default to 5 articles.| -|`homepage.showMoreLink`|'false'|Wether or not to display a show more link at the end of your posts that takes the user to a predefined place.| -|`homepage.showMoreLinkDest`|'/posts'|The destination of the show more button.| -|`homepage.cardView`|`false`|Display recent articles as a gallery of cards.| -|`homepage.cardViewScreenWidth`|`false`|Enhance the width of the recent articles card gallery to take the full width available.| -|`article.showDate`|`true`|Whether or not article dates are displayed.| -|`article.showViews`|`false`|Whether or not article views are displayed. This requires firebase integrations to be enabled, look below.| -|`article.showLikes`|`false`|Whether or not article likes are displayed. This requires firebase integrations to be enabled, look below.| -|`article.showDateUpdated`|`false`|Whether or not the dates articles were updated are displayed.| -|`article.showAuthor`|`true`|Whether or not the author box is displayed in the article footer.| -|`article.showHero`|`true`|Whether the thumbnail image will be shown as a hero image within each article page.| -|`heroStyle`|`basic`|Style to display the hero image, valid options are: `basic`, `big`, `background`.| -|`article.showBreadcrumbs`|`false`|Whether or not breadcrumbs are displayed in the article header.| -|`article.showDraftLabel`|`true`|Whether or not the draft indicator is shown next to articles when site is built with `--buildDrafts`.| -|`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.| -|`article.showReadingTime`|`true`|Whether or not article reading times are displayed.| -|`article.showTableOfContents`|`false`|Whether or not the table of contents is displayed on articles.| -|`article.showTaxonomies`|`false`|Whether or not the taxonomies related to this article are displayed.| -|`article.showAuthorsBadges`|`false`|Whether the `authors` taxonomies are are displayed in the article or list header. This requires the setup of `multiple authors` and the `authors` taxonomy. Check [this page]({{< ref "multi-author" >}}) for more details on how to configure that feature.| -|`article.showWordCount`|`false`|Whether or not article word counts are displayed.| -|`article.showComments`|`false`|Whether or not the [comments partial]({{< ref "partials#comments" >}}) is included after the article footer.| -|`article.sharingLinks`|_Not set_|Which sharing links to display at the end of each article. When not provided, or set to `false` no links will be displayed.| -|`list.showBreadcrumbs`|`false`|Whether or not breadcrumbs are displayed in the header on list pages.| -|`list.showTableOfContents`|`false`|Whether or not the table of contents is displayed on list pages.| -|`list.showSummary`|`false`|Whether or not article summaries are displayed on list pages. If a summary is not provided in the [front matter]({{< ref "front-matter" >}}), one will be auto generated using the `summaryLength` parameter in the [site configuration](#site-configuration).| -|`list.showCards`|`false`|Whether or not each article is displayed as a card or as simple inline text.| -|`list.groupByYear`|`true`|Whether or not articles are grouped by year on list pages.| -|`list.cardView`|`false`|Display lists as a gallery of cards.| -|`list.cardViewScreenWidth`|`false`|Enhance the width of card galleries in lists to take the full width available.| -|`sitemap.excludedKinds`|`["taxonomy", "term"]`|Kinds of content that should be excluded from the generated `/sitemap.xml` file. Refer to the [Hugo docs](https://gohugo.io/templates/section-templates/#page-kinds) for acceptable values.| -|`taxonomy.showTermCount`|`true`|Whether or not the number of articles within a taxonomy term is displayed on the taxonomy listing.| -|`firebase.apiKey`|_Not set_|Firebase apiKey, required to integrate against Firebase. Check [this page]({{< ref "firebase-views" >}}) for a guide on how to integrate Firebase into Blowfish| -|`firebase.authDomain`|_Not set_|Firebase authDomain, required to integrate against Firebase. Check [this page]({{< ref "firebase-views" >}}) for a guide on how to integrate Firebase into Blowfish| -|`firebase.projectId`|_Not set_|Firebase projectId, required to integrate against Firebase. Check [this page]({{< ref "firebase-views" >}}) for a guide on how to integrate Firebase into Blowfish| -|`firebase.storageBucket`|_Not set_|Firebase storageBucket, required to integrate against Firebase. Check [this page]({{< ref "firebase-views" >}}) for a guide on how to integrate Firebase into Blowfish| -|`firebase.messagingSenderId`|_Not set_|Firebase messagingSenderId, required to integrate against Firebase. Check [this page]({{< ref "firebase-views" >}}) for a guide on how to integrate Firebase into Blowfish| -|`firebase.appId`|_Not set_|Firebase appId, required to integrate against Firebase. Check [this page]({{< ref "firebase-views" >}}) for a guide on how to integrate Firebase into Blowfish| -|`firebase.measurementId`|_Not set_|Firebase measurementId, required to integrate against Firebase. Check [this page]({{< ref "firebase-views" >}}) for a guide on how to integrate Firebase into Blowfish| -|`fathomAnalytics.site`|_Not set_|The site code generated by Fathom Analytics for the website. Refer to the [Analytics docs]({{< ref "partials#analytics" >}}) for more details.| -|`fathomAnalytics.domain`|_Not set_|If using a custom domain with Fathom Analytics, provide it here to serve `script.js` from the custom domain.| -|`verification.google`|_Not set_|The site verification string provided by Google to be included in the site metadata.| -|`verification.bing`|_Not set_|The site verification string provided by Bing to be included in the site metadata.| -|`verification.pinterest`|_Not set_|The site verification string provided by Pinterest to be included in the site metadata.| -|`verification.yandex`|_Not set_|The site verification string provided by Yandex to be included in the site metadata.| +| Name | Default | Description | +| ------------------------------- | ---------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `colorScheme` | `"blowfish"` | The theme colour scheme to use. Valid values are `blowfish` (default), `avocado`, `ocean`, `fire` and `slate`. Refer to the [Colour Schemes]({{< ref "getting-started#colour-schemes" >}}) section for more details. | +| `defaultAppearance` | `"light"` | The default theme appearance, either `light` or `dark`. | +| `autoSwitchAppearance` | `true` | Whether the theme appearance automatically switches based upon the visitor's operating system preference. Set to `false` to force the site to always use the `defaultAppearance`. | +| `enableSearch` | `false` | Whether site search is enabled. Set to `true` to enable search functionality. Note that the search feature depends on the `outputs.home` setting in the [site configuration](#site-configuration) being set correctly. | +| `enableCodeCopy` | `false` | Whether copy-to-clipboard buttons are enabled for `` blocks. The `highlight.noClasses` parameter must be set to `false` for code copy to function correctly. Read more about [other configuration files](#other-configuration-files) below. | +| `logo` | _Not set_ | The relative path to the site logo file within the `assets/` folder. The logo file should be provided at 2x resolution and supports any image dimensions. | +| `mainSections` | _Not set_ | The sections that should be displayed in the recent articles list. If not provided the section with the greatest number of articles is used. | +| `robots` | _Not set_ | String that indicates how robots should handle your site. If set, it will be output in the page head. Refer to [Google's docs](https://developers.google.com/search/docs/advanced/robots/robots_meta_tag#directives) for valid values. | +| `disableImageZoom` | `false` | Disables image zoom feature across all the images in the site. | +| `footer.showMenu` | `true` | Show/hide the footer menu, which can be configured in the `[[footer]]` section of the `config/_default/menus.en.toml` file. | +| `footer.showCopyright` | `true` | Whether or not to show the copyright string in the site footer. Note that the string itself can be customised using the `copyright` parameter in the [languages configuration](#language-and-i18n). | +| `footer.showThemeAttribution` | `true` | Whether or not to show the "powered by" theme attribution in the site footer. If you choose to disable this message, please consider attributing the theme somewhere else on your site (for example, on your about page). | +| `footer.showAppearanceSwitcher` | `false` | Whether or not to show the appearance switcher in the site footer. The browser's local storage is used to persist the visitor's preference. | +| `footer.showScrollToTop` | `true` | When set to `true` the scroll to top arrow is displayed. | +| `homepage.layout` | `"profile"` | The layout of the homepage. Valid values are `page`, `profile`, `hero`, `card`, `background`, or `custom`. When set to `custom`, you must provide your own layout by creating a `/layouts/partials/home/custom.html` file. Refer to the [Homepage Layout]({{< ref "homepage-layout" >}}) section for more details. | +| `homepage.homepageImage` | _Not set_ | Image to be used in `hero` and `card` layouts. Refer to the [Homepage Layout]({{< ref "homepage-layout" >}}) section for more details. | +| `homepage.showRecent` | `false` | Whether or not to display the recent articles list on the homepage. | +| `homepage.showRecentItems` | 5 | How many articles to display if showRecent is true. If variable is set to 0 or if it isn't defined the system will default to 5 articles. | +| `homepage.showMoreLink` | 'false' | Wether or not to display a show more link at the end of your posts that takes the user to a predefined place. | +| `homepage.showMoreLinkDest` | '/posts' | The destination of the show more button. | +| `homepage.cardView` | `false` | Display recent articles as a gallery of cards. | +| `homepage.cardViewScreenWidth` | `false` | Enhance the width of the recent articles card gallery to take the full width available. | +| `article.showDate` | `true` | Whether or not article dates are displayed. | +| `article.showViews` | `false` | Whether or not article views are displayed. This requires firebase integrations to be enabled, look below. | +| `article.showLikes` | `false` | Whether or not article likes are displayed. This requires firebase integrations to be enabled, look below. | +| `article.showDateUpdated` | `false` | Whether or not the dates articles were updated are displayed. | +| `article.showAuthor` | `true` | Whether or not the author box is displayed in the article footer. | +| `article.showHero` | `true` | Whether the thumbnail image will be shown as a hero image within each article page. | +| `heroStyle` | `basic` | Style to display the hero image, valid options are: `basic`, `big`, `background`. | +| `article.showBreadcrumbs` | `false` | Whether or not breadcrumbs are displayed in the article header. | +| `article.showDraftLabel` | `true` | Whether or not the draft indicator is shown next to articles when site is built with `--buildDrafts`. | +| `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. | +| `article.showReadingTime` | `true` | Whether or not article reading times are displayed. | +| `article.showTableOfContents` | `false` | Whether or not the table of contents is displayed on articles. | +| `article.showTaxonomies` | `false` | Whether or not the taxonomies related to this article are displayed. | +| `article.showAuthorsBadges` | `false` | Whether the `authors` taxonomies are are displayed in the article or list header. This requires the setup of `multiple authors` and the `authors` taxonomy. Check [this page]({{< ref "multi-author" >}}) for more details on how to configure that feature. | +| `article.showWordCount` | `false` | Whether or not article word counts are displayed. | +| `article.showComments` | `false` | Whether or not the [comments partial]({{< ref "partials#comments" >}}) is included after the article footer. | +| `article.sharingLinks` | _Not set_ | Which sharing links to display at the end of each article. When not provided, or set to `false` no links will be displayed. | +| `list.showBreadcrumbs` | `false` | Whether or not breadcrumbs are displayed in the header on list pages. | +| `list.showTableOfContents` | `false` | Whether or not the table of contents is displayed on list pages. | +| `list.showSummary` | `false` | Whether or not article summaries are displayed on list pages. If a summary is not provided in the [front matter]({{< ref "front-matter" >}}), one will be auto generated using the `summaryLength` parameter in the [site configuration](#site-configuration). | +| `list.showCards` | `false` | Whether or not each article is displayed as a card or as simple inline text. | +| `list.groupByYear` | `true` | Whether or not articles are grouped by year on list pages. | +| `list.cardView` | `false` | Display lists as a gallery of cards. | +| `list.cardViewScreenWidth` | `false` | Enhance the width of card galleries in lists to take the full width available. | +| `sitemap.excludedKinds` | `["taxonomy", "term"]` | Kinds of content that should be excluded from the generated `/sitemap.xml` file. Refer to the [Hugo docs](https://gohugo.io/templates/section-templates/#page-kinds) for acceptable values. | +| `taxonomy.showTermCount` | `true` | Whether or not the number of articles within a taxonomy term is displayed on the taxonomy listing. | +| `firebase.apiKey` | _Not set_ | Firebase apiKey, required to integrate against Firebase. Check [this page]({{< ref "firebase-views" >}}) for a guide on how to integrate Firebase into Blowfish | +| `firebase.authDomain` | _Not set_ | Firebase authDomain, required to integrate against Firebase. Check [this page]({{< ref "firebase-views" >}}) for a guide on how to integrate Firebase into Blowfish | +| `firebase.projectId` | _Not set_ | Firebase projectId, required to integrate against Firebase. Check [this page]({{< ref "firebase-views" >}}) for a guide on how to integrate Firebase into Blowfish | +| `firebase.storageBucket` | _Not set_ | Firebase storageBucket, required to integrate against Firebase. Check [this page]({{< ref "firebase-views" >}}) for a guide on how to integrate Firebase into Blowfish | +| `firebase.messagingSenderId` | _Not set_ | Firebase messagingSenderId, required to integrate against Firebase. Check [this page]({{< ref "firebase-views" >}}) for a guide on how to integrate Firebase into Blowfish | +| `firebase.appId` | _Not set_ | Firebase appId, required to integrate against Firebase. Check [this page]({{< ref "firebase-views" >}}) for a guide on how to integrate Firebase into Blowfish | +| `firebase.measurementId` | _Not set_ | Firebase measurementId, required to integrate against Firebase. Check [this page]({{< ref "firebase-views" >}}) for a guide on how to integrate Firebase into Blowfish | +| `fathomAnalytics.site` | _Not set_ | The site code generated by Fathom Analytics for the website. Refer to the [Analytics docs]({{< ref "partials#analytics" >}}) for more details. | +| `fathomAnalytics.domain` | _Not set_ | If using a custom domain with Fathom Analytics, provide it here to serve `script.js` from the custom domain. | +| `verification.google` | _Not set_ | The site verification string provided by Google to be included in the site metadata. | +| `verification.bing` | _Not set_ | The site verification string provided by Bing to be included in the site metadata. | +| `verification.pinterest` | _Not set_ | The site verification string provided by Pinterest to be included in the site metadata. | +| `verification.yandex` | _Not set_ | The site verification string provided by Yandex to be included in the site metadata. | ## Other configuration files