diff --git a/assets/css/compiled/main.css b/assets/css/compiled/main.css index baebb65c..e05cb96f 100644 --- a/assets/css/compiled/main.css +++ b/assets/css/compiled/main.css @@ -4914,6 +4914,10 @@ body:has(#menu-controller:checked) { /* Custom */ +pre { + text-align: left; +} + .thumbnail { min-width: 300px; height: 180px; diff --git a/assets/css/main.css b/assets/css/main.css index bc69caeb..fbb6ce8e 100644 --- a/assets/css/main.css +++ b/assets/css/main.css @@ -339,6 +339,10 @@ body:has(#menu-controller:checked) { /* Custom */ +pre { + text-align: left; +} + .thumbnail { min-width: 300px; height: 180px; diff --git a/config/_default/params.toml b/config/_default/params.toml index 7ac39c58..7ddfd3b5 100644 --- a/config/_default/params.toml +++ b/config/_default/params.toml @@ -15,7 +15,8 @@ enableCodeCopy = false # mainSections = ["section1", "section2"] # robots = "" -disableImageOptimization = true +disableImageOptimization = false +disableTextInHeader = false # defaultBackgroundImage = "IMAGE.jpg" # used as default for background images # defaultFeaturedImage = "IMAGE.jpg" # used as default for featured images in all articles diff --git a/exampleSite/config/_default/params.toml b/exampleSite/config/_default/params.toml index ff6665f5..ccdbb1c4 100644 --- a/exampleSite/config/_default/params.toml +++ b/exampleSite/config/_default/params.toml @@ -16,6 +16,7 @@ mainSections = ["docs"] # robots = "" disableImageOptimization = false +disableTextInHeader = false defaultBackgroundImage = "/img/ocean.jpg" defaultFeaturedImage = "/img/ocean.jpg" diff --git a/exampleSite/content/docs/configuration/index.md b/exampleSite/content/docs/configuration/index.md index 5d570ccc..87b1e790 100644 --- a/exampleSite/content/docs/configuration/index.md +++ b/exampleSite/content/docs/configuration/index.md @@ -167,6 +167,7 @@ Many of the article defaults here can be overridden on a per article basis by sp | `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. | | `disableImageOptimization` | `false` | Disables image resize and optimization features across all the images in the site. | +| `disableTextInHeader` | `false` | Disables text in header, useful for logo based headers. | | `defaultBackgroundImage` | _Not set_ | Default background image for both `background` homepage layout and `background` hero style | | `defaultFeaturedImage` | _Not set_ | Default background image for all `featured` images across articles, will be overriden by a local `featured` image. | | `highlightCurrentMenuArea` | _Not set_ | Marks menu entries in the main manu when selected | diff --git a/exampleSite/content/docs/shortcodes/index.md b/exampleSite/content/docs/shortcodes/index.md index 19b425b3..156bf607 100644 --- a/exampleSite/content/docs/shortcodes/index.md +++ b/exampleSite/content/docs/shortcodes/index.md @@ -16,12 +16,12 @@ In addition to all the [default Hugo shortcodes](https://gohugo.io/content-manag `alert` outputs its contents as a stylised message box within your article. It's useful for drawing attention to important information that you don't want the reader to miss. -| Parameter | Description | -| -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `icon` | **Optional.** the icon to display on the left side.
**Default:** `exclaimation triangle icon` (Check out the [icon shortcode](#icon) for more details on using icons.) | -| `iconColor` | **Optional.** the color for the icon in basic CSS style.
Can be either hex values (`#FFFFFF`) or color names (`white`)
By default chosen based on the current color theme . | -| `cardColor` | **Optional.** the color for the card background in basic CSS style.
Can be either hex values (`#FFFFFF`) or color names (`white`)
By default chosen based on the current color theme . | -| `textColor` | **Optional.** the color for the text in basic CSS style.
Can be either hex values (`#FFFFFF`) or color names (`white`)
By default chosen based on the current color theme . | +| Parameter | Description | +| ----------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `icon` | **Optional.** the icon to display on the left side.
**Default:** `exclaimation triangle icon` (Check out the [icon shortcode](#icon) for more details on using icons.) | +| `iconColor` | **Optional.** the color for the icon in basic CSS style.
Can be either hex values (`#FFFFFF`) or color names (`white`)
By default chosen based on the current color theme . | +| `cardColor` | **Optional.** the color for the card background in basic CSS style.
Can be either hex values (`#FFFFFF`) or color names (`white`)
By default chosen based on the current color theme . | +| `textColor` | **Optional.** the color for the text in basic CSS style.
Can be either hex values (`#FFFFFF`) or color names (`white`)
By default chosen based on the current color theme . | The input is written in Markdown so you can format it however you please. @@ -297,7 +297,7 @@ In order to add images to the gallery, use `img` tags for each image and add `cl | Parameter | Description | -|-----------|-------------------------------------------------------| +| --------- | ----------------------------------------------------- | | `repo` | [String] github repo in the format of `username/repo` | @@ -320,7 +320,7 @@ Finaly custom GitLab instace URL can be provided, as long as the `api/v4/project | Parameter | Description | -|-------------|------------------------------------------------------------------------| +| ----------- | ---------------------------------------------------------------------- | | `projectID` | [String] gitlab numeric ProjectID | | `baseURL` | [String] optional gitlab instace URL, default is `https://gitlab.com/` | @@ -400,12 +400,13 @@ When life gives you lemons, make lemonade. `List` will display a list of recent articles. This shortcode requires a limit value to constraint the list. Additionally, it supports a `where` and a `value` in order to filter articles by their parameters. Note that this shortcode will not display its parent page but it will count for the limit value. -| Parameter | Description | -| --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `limit` | **Required.** the number of recent articles to display. | -| `title` | Optional title for the list, default is `Recent` | -| `where` | The variable to be used for the query of articles e.g. `Type` | -| `value` | The value that will need to match the parameter defined in `where` for the query of articles e.g. for `where` == `Type` a valid value could be `sample` | +| Parameter | Description | +| ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `limit` | **Required.** the number of recent articles to display. | +| `title` | Optional title for the list, default is `Recent` | +| `cardView` | Optional card view enabled for the list, default is `false` | +| `where` | The variable to be used for the query of articles e.g. `Type` | +| `value` | The value that will need to match the parameter defined in `where` for the query of articles e.g. for `where` == `Type` a valid value could be `sample` | {{< alert >}} The `where` and `value` values are used in the following query `where .Site.RegularPages $where $value` in the code of the shortcode. Check [Hugo docs](https://gohugo.io/variables/page/) to learn more about which parameters are available to use. @@ -424,10 +425,10 @@ The `where` and `value` values are used in the following query `where .Site.Regu **Example #2:** ```md -{{}} +{{}} ``` -{{< list title="Samples" limit=5 where="Type" value="sample">}} +{{< list title="Samples" cardView=true limit=6 where="Type" value="sample">}}


diff --git a/layouts/_default/_markup/render-heading.html b/layouts/_default/_markup/render-heading.html index cb1514e6..f76eb43c 100644 --- a/layouts/_default/_markup/render-heading.html +++ b/layouts/_default/_markup/render-heading.html @@ -1,8 +1,10 @@ -
{{ .Text | safeHTML }} - {{ if.Page.Params.showHeadingAnchors | default (.Page.Site.Params.article.showHeadingAnchors | default true) }} + {{ if.Page.Params.showHeadingAnchors | default (.Page.Site.Params.article.showHeadingAnchors | default true) }} + # + style="text-decoration-line: none !important;" href="#{{ .Anchor | safeURL }}" aria-label="{{ i18n "article.anchor_label" }}"># + {{ end }} diff --git a/layouts/partials/article-meta/basic.html b/layouts/partials/article-meta/basic.html index dcb87597..8608663f 100644 --- a/layouts/partials/article-meta/basic.html +++ b/layouts/partials/article-meta/basic.html @@ -47,7 +47,7 @@ {{ end }} -
+
{{/* Output partials */}} {{ with ($meta.Get "partials") }} {{ delimit . "·" | safeHTML }} @@ -60,7 +60,7 @@
{{ if .Params.showAuthorsBadges | default (.Site.Params.article.showAuthorsBadges | default false) }} -
+
{{ range $taxonomy, $terms := .Site.Taxonomies }} {{ if (eq $taxonomy "authors")}} {{ if (gt (len ($context.GetTerms $taxonomy)) 0) }} @@ -75,7 +75,7 @@ {{/* Output taxonomies */}} {{ if .Params.showTaxonomies | default (.Site.Params.article.showTaxonomies | default false) }} -
+
{{ range $taxonomy, $terms := .Site.Taxonomies }} {{ if and (not (eq $taxonomy "authors")) (not (eq $taxonomy "series"))}} {{ if (gt (len ($context.GetTerms $taxonomy)) 0) }} diff --git a/layouts/partials/header/basic.html b/layouts/partials/header/basic.html index 720964c2..6446136a 100644 --- a/layouts/partials/header/basic.html +++ b/layouts/partials/header/basic.html @@ -17,10 +17,11 @@
diff --git a/layouts/partials/home/background.html b/layouts/partials/home/background.html index 4ea65da9..c5e9ea81 100644 --- a/layouts/partials/home/background.html +++ b/layouts/partials/home/background.html @@ -42,7 +42,7 @@
{{ range $links := . }} {{ range $name, $url := $links }} - {{ partial "icon.html" $name }} {{ end }} diff --git a/layouts/partials/home/hero.html b/layouts/partials/home/hero.html index b654a6fc..8cf60984 100644 --- a/layouts/partials/home/hero.html +++ b/layouts/partials/home/hero.html @@ -39,7 +39,7 @@
{{ range $links := . }} {{ range $name, $url := $links }} - {{ partial "icon.html" $name }} {{ end }} diff --git a/layouts/shortcodes/list.html b/layouts/shortcodes/list.html index 18fa486d..f46e96e4 100644 --- a/layouts/shortcodes/list.html +++ b/layouts/shortcodes/list.html @@ -2,9 +2,32 @@ {{ $limit := .Get "limit" | default 1 }} {{ $title := .Get "title" | default (i18n "shortcode.recent_articles" | emojify) }} {{ $parent := .Page.RelPermalink }} +{{ $cardView := .Get "cardView" }} {{ $where := .Get "where" }} {{ $value := .Get "value" }}

{{ $title }}

+ + +{{ if $cardView | default false}} + +
+ {{ if $where }} + {{ range ( where .Site.RegularPages $where $value | first $limit ) }} + {{ if not (eq .RelPermalink $parent) }} + {{ partial "article-link/card.html" . }} + {{ end }} + {{end}} + {{ else }} + {{ range .Site.RegularPages | first $limit }} + {{ if not (eq .RelPermalink $parent) }} + {{ partial "article-link/card.html" . }} + {{ end }} + {{end}} + {{ end }} +
+ +{{ else }} +
{{ if $where }} {{ range ( where .Site.RegularPages $where $value | first $limit ) }} @@ -19,4 +42,6 @@ {{ end }} {{end}} {{ end }} -
\ No newline at end of file + + +{{ end }}