From 90e0636170fefcf764abbb64421b7dcbb9df8d5e Mon Sep 17 00:00:00 2001 From: Nicolas MASSE Date: Sun, 4 Oct 2026 10:58:08 +0200 Subject: [PATCH] upgrade to Hugo 0.167 and replace the ./hugo script with mounts Hugo upgrade (0.121.2 -> 0.167.0): - remove the blackfriday and pygments* settings (markup.highlight instead) - languageName -> label, _build -> build, .Scratch -> .Store, .Sites -> hugo.Sites, .LanguageName -> .Label, .LanguageCode -> .Locale - move the templates to the new layout tree (_partials, _shortcodes, home.html, page.html, term.html, taxonomy.html, section.html) - use the embedded pagination, opengraph and twitter_cards partials - fix the term filtering in post-metadata.html (.Data. is gone) - keep the taxonomy terms as written (capitalizeListTitles: false) and give a proper title to the blog section ("Articles" instead of "Blogs") - is raw HTML (omitted by Goldmark): use ~~ instead - use relref for a relative link that was broken in the RSS feeds Mounts: - the english content not translated in french is now published in the french site through module mounts, instead of symlinks created by the ./hugo script. hugo and hugo server can be used directly. - chroma.css is now versioned instead of generated at each build - remove the ./hugo script and realpath.py The generated site has the same set of files. The remaining differences come from the new minifier, the new embedded templates (og:locale, empty meta tags removed, youtube iframe) and the new summary computation. Refs #11 Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01YNHsWYTXPThURz6TbVS1j3 --- README.md | 15 +++-- assets/css/.gitignore | 1 - assets/css/chroma.css | 62 +++++++++++++++++++ config.yaml | 44 ++++++++----- content/english/blog/_index.md | 3 + .../blog/deploying-invidious-openshift.md | 2 +- .../blog/deploying-miniflux-openshift.md | 2 +- ...pis-as-a-product-get-started-in-no-time.md | 2 +- content/french/blog/_index.md | 3 + find-internal-redirects | 4 +- hugo | 42 ------------- .../article-headline.html | 2 +- layouts/{partials => _partials}/head.html | 30 ++++----- layouts/{partials => _partials}/icons/en.svg | 0 layouts/{partials => _partials}/icons/fr.svg | 0 .../{partials => _partials}/icons/label.svg | 0 .../{partials => _partials}/icons/link.svg | 0 .../icons/rss_feed.svg | 0 .../icons/schedule.svg | 0 .../{partials => _partials}/icons/search.svg | 0 .../icons/vertical_align_top.svg | 0 .../lang-detection.html | 4 +- layouts/{partials => _partials}/mathjax.html | 0 layouts/{partials => _partials}/menu.html | 2 +- .../post-metadata.html | 4 +- .../real-translations.html | 2 +- layouts/{partials => _partials}/toolbar.html | 0 .../attachedFigure.html | 0 .../attachedFileLink.html | 0 .../{shortcodes => _shortcodes}/baseurl.html | 0 .../embeddedVideo.html | 0 .../{shortcodes => _shortcodes}/figure.html | 0 .../highlightFile.html | 0 .../highlightWithTitle.html | 0 .../internalLink.html | 8 +-- .../screenshotOf.html | 0 layouts/{_default => }/baseof.html | 0 layouts/blog/{list.html => section.html} | 4 +- layouts/{index.html => home.html} | 2 +- layouts/{_default/single.html => page.html} | 4 +- layouts/{_default => }/search.html | 28 ++++----- layouts/{_default => }/section.html | 0 layouts/{_default => }/sitemap.xml | 6 +- layouts/speaking/{list.html => section.html} | 2 +- .../{_default/terms.html => taxonomy.html} | 2 +- layouts/{_default/taxonomy.html => term.html} | 4 +- layouts/writing/{list.html => section.html} | 2 +- netlify.toml | 8 +-- realpath.py | 7 --- 49 files changed, 169 insertions(+), 132 deletions(-) delete mode 100644 assets/css/.gitignore create mode 100644 assets/css/chroma.css create mode 100644 content/english/blog/_index.md create mode 100644 content/french/blog/_index.md delete mode 100755 hugo rename layouts/{partials => _partials}/article-headline.html (85%) rename layouts/{partials => _partials}/head.html (80%) rename layouts/{partials => _partials}/icons/en.svg (100%) rename layouts/{partials => _partials}/icons/fr.svg (100%) rename layouts/{partials => _partials}/icons/label.svg (100%) rename layouts/{partials => _partials}/icons/link.svg (100%) rename layouts/{partials => _partials}/icons/rss_feed.svg (100%) rename layouts/{partials => _partials}/icons/schedule.svg (100%) rename layouts/{partials => _partials}/icons/search.svg (100%) rename layouts/{partials => _partials}/icons/vertical_align_top.svg (100%) rename layouts/{partials => _partials}/lang-detection.html (84%) rename layouts/{partials => _partials}/mathjax.html (100%) rename layouts/{partials => _partials}/menu.html (98%) rename layouts/{partials => _partials}/post-metadata.html (84%) rename layouts/{partials => _partials}/real-translations.html (86%) rename layouts/{partials => _partials}/toolbar.html (100%) rename layouts/{shortcodes => _shortcodes}/attachedFigure.html (100%) rename layouts/{shortcodes => _shortcodes}/attachedFileLink.html (100%) rename layouts/{shortcodes => _shortcodes}/baseurl.html (100%) rename layouts/{shortcodes => _shortcodes}/embeddedVideo.html (100%) rename layouts/{shortcodes => _shortcodes}/figure.html (100%) rename layouts/{shortcodes => _shortcodes}/highlightFile.html (100%) rename layouts/{shortcodes => _shortcodes}/highlightWithTitle.html (100%) rename layouts/{shortcodes => _shortcodes}/internalLink.html (81%) rename layouts/{shortcodes => _shortcodes}/screenshotOf.html (100%) rename layouts/{_default => }/baseof.html (100%) rename layouts/blog/{list.html => section.html} (69%) rename layouts/{index.html => home.html} (87%) rename layouts/{_default/single.html => page.html} (78%) rename layouts/{_default => }/search.html (84%) rename layouts/{_default => }/section.html (100%) rename layouts/{_default => }/sitemap.xml (86%) rename layouts/speaking/{list.html => section.html} (77%) rename layouts/{_default/terms.html => taxonomy.html} (73%) rename layouts/{_default/taxonomy.html => term.html} (74%) rename layouts/writing/{list.html => section.html} (78%) delete mode 100755 realpath.py diff --git a/README.md b/README.md index 23b473d..22ed3ad 100644 --- a/README.md +++ b/README.md @@ -17,13 +17,16 @@ Create a new branch: git checkout -b "$(date +%F)-update" ``` -Create a new page: +Create a new page (in english or in french): ```sh -hugo new speaking/my-wonderful-event.md -vim content/speaking/my-wonderful-event.md +hugo new content content/english/speaking/my-wonderful-event.md +hugo new content content/french/speaking/my-wonderful-event.md ``` +English pages that are not translated are automatically published in the +french site too (see the `module.mounts` section of `config.yaml`). + Check locally that your changes are OK: ```sh @@ -74,6 +77,6 @@ and released under the MIT license (see [LICENSE-theme](LICENSE-theme)). ## How to change the Chroma style for syntax highlighting -The Chroma style sheet is generated by the `./hugo` script in -`assets/css/chroma.css`. To change the style, edit the `--style` argument -of the `hugo gen chromastyles` command in the `./hugo` script. +```sh +hugo gen chromastyles --style=borland > assets/css/chroma.css +``` diff --git a/assets/css/.gitignore b/assets/css/.gitignore deleted file mode 100644 index c94d1fd..0000000 --- a/assets/css/.gitignore +++ /dev/null @@ -1 +0,0 @@ -chroma.css \ No newline at end of file diff --git a/assets/css/chroma.css b/assets/css/chroma.css new file mode 100644 index 0000000..6a8a14c --- /dev/null +++ b/assets/css/chroma.css @@ -0,0 +1,62 @@ +/* Generated using: hugo gen chromastyles --style=borland */ + +/* Background */ .bg { background-color:#fff; } +/* PreWrapper */ .chroma { background-color:#fff;-webkit-text-size-adjust:none; } +/* Error */ .chroma .err { color:#a61717;background-color:#e3d2d2 } +/* LineLink */ .chroma .lnlinks { outline:none;text-decoration:none;color:inherit } +/* LineTableTD */ .chroma .lntd { vertical-align:top;padding:0;margin:0;border:0; } +/* LineTable */ .chroma .lntable { border-spacing:0;padding:0;margin:0;border:0; } +/* LineHighlight */ .chroma .hl { background-color:#e5e5e5 } +/* LineNumbersTable */ .chroma .lnt { white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f } +/* LineNumbers */ .chroma .ln { white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f } +/* Line */ .chroma .line { display:flex; } +/* Keyword */ .chroma .k { color:#000080;font-weight:bold } +/* KeywordConstant */ .chroma .kc { color:#000080;font-weight:bold } +/* KeywordDeclaration */ .chroma .kd { color:#000080;font-weight:bold } +/* KeywordNamespace */ .chroma .kn { color:#000080;font-weight:bold } +/* KeywordPseudo */ .chroma .kp { color:#000080;font-weight:bold } +/* KeywordReserved */ .chroma .kr { color:#000080;font-weight:bold } +/* KeywordType */ .chroma .kt { color:#000080;font-weight:bold } +/* NameAttribute */ .chroma .na { color:#f00 } +/* NameTag */ .chroma .nt { color:#000080;font-weight:bold } +/* LiteralString */ .chroma .s { color:#00f } +/* LiteralStringAffix */ .chroma .sa { color:#00f } +/* LiteralStringBacktick */ .chroma .sb { color:#00f } +/* LiteralStringChar */ .chroma .sc { color:#800080 } +/* LiteralStringDelimiter */ .chroma .dl { color:#00f } +/* LiteralStringDoc */ .chroma .sd { color:#00f } +/* LiteralStringDouble */ .chroma .s2 { color:#00f } +/* LiteralStringEscape */ .chroma .se { color:#00f } +/* LiteralStringHeredoc */ .chroma .sh { color:#00f } +/* LiteralStringInterpol */ .chroma .si { color:#00f } +/* LiteralStringOther */ .chroma .sx { color:#00f } +/* LiteralStringRegex */ .chroma .sr { color:#00f } +/* LiteralStringSingle */ .chroma .s1 { color:#00f } +/* LiteralStringSymbol */ .chroma .ss { color:#00f } +/* LiteralNumber */ .chroma .m { color:#00f } +/* LiteralNumberBin */ .chroma .mb { color:#00f } +/* LiteralNumberFloat */ .chroma .mf { color:#00f } +/* LiteralNumberHex */ .chroma .mh { color:#00f } +/* LiteralNumberInteger */ .chroma .mi { color:#00f } +/* LiteralNumberIntegerLong */ .chroma .il { color:#00f } +/* LiteralNumberOct */ .chroma .mo { color:#00f } +/* OperatorWord */ .chroma .ow { font-weight:bold } +/* Comment */ .chroma .c { color:#080;font-style:italic } +/* CommentHashbang */ .chroma .ch { color:#080;font-style:italic } +/* CommentMultiline */ .chroma .cm { color:#080;font-style:italic } +/* CommentSingle */ .chroma .c1 { color:#080;font-style:italic } +/* CommentSpecial */ .chroma .cs { color:#080;font-weight:bold } +/* CommentPreproc */ .chroma .cp { color:#008080 } +/* CommentPreprocFile */ .chroma .cpf { color:#008080 } +/* GenericDeleted */ .chroma .gd { color:#000;background-color:#fdd } +/* GenericEmph */ .chroma .ge { font-style:italic } +/* GenericError */ .chroma .gr { color:#a00 } +/* GenericHeading */ .chroma .gh { color:#999 } +/* GenericInserted */ .chroma .gi { color:#000;background-color:#dfd } +/* GenericOutput */ .chroma .go { color:#888 } +/* GenericPrompt */ .chroma .gp { color:#555 } +/* GenericStrong */ .chroma .gs { font-weight:bold } +/* GenericSubheading */ .chroma .gu { color:#aaa } +/* GenericTraceback */ .chroma .gt { color:#a00 } +/* GenericUnderline */ .chroma .gl { text-decoration:underline } +/* TextWhitespace */ .chroma .w { color:#bbb } diff --git a/config.yaml b/config.yaml index 648cdd4..7b32cd9 100644 --- a/config.yaml +++ b/config.yaml @@ -1,24 +1,21 @@ baseURL: "/" title: "Nicolas Massé" author: "Nicolas Massé" -# pygmentsUseClasses implies a style sheet that can be generated as follow: -# hugo gen chromastyles --style=borland > assets/css/chroma.css -# (this is done automatically by the ./hugo script) -pygmentsUseClasses: true -pygmentsCodefences: true enableRobotsTXT: true +# Keep the taxonomy terms as they are written in the front matter +capitalizeListTitles: false -blackfriday: - extensionsmask: - # No "a" tag on bare links - - autolink +markup: + highlight: + # Use CSS classes for syntax highlighting. The style sheet is generated with: + # hugo gen chromastyles --style=borland > assets/css/chroma.css + noClasses: false defaultContentLanguage: "en" languages: en: weight: 1 - languageName: English - contentDir: content/english + label: English menu: main: - name: "Articles" @@ -44,8 +41,7 @@ languages: url: "https://www.linkedin.com/in/nicolasmasse/" fr: weight: 2 - languageName: Français - contentDir: content/french + label: Français menu: main: - name: "Articles" @@ -70,6 +66,26 @@ languages: weight: 70 url: "https://www.linkedin.com/in/nicolasmasse/" +# The french site contains the french content plus the english content that +# has not been translated (french files take precedence over english files). +module: + mounts: + - source: content/english + target: content + sites: + matrix: + languages: [en] + - source: content/french + target: content + sites: + matrix: + languages: [fr] + - source: content/english + target: content + sites: + matrix: + languages: [fr] + taxonomies: opensource: "opensource" topic: "topics" @@ -84,5 +100,5 @@ params: # files, etc.) and not the source files that sit next to them (xcf, heic, # raw videos, etc.). cascade: - _build: + build: publishResources: false diff --git a/content/english/blog/_index.md b/content/english/blog/_index.md new file mode 100644 index 0000000..6c1acb3 --- /dev/null +++ b/content/english/blog/_index.md @@ -0,0 +1,3 @@ +--- +title: "Articles" +--- diff --git a/content/english/blog/deploying-invidious-openshift.md b/content/english/blog/deploying-invidious-openshift.md index 09c002c..be1d071 100644 --- a/content/english/blog/deploying-invidious-openshift.md +++ b/content/english/blog/deploying-invidious-openshift.md @@ -65,7 +65,7 @@ oc set volume dc/postgresql --add -t configmap --name postgresql-init \ -m /opt/app-root/src/postgresql-start ``` -Because of a bug feature in the [PostgreSQL base image](https://github.com/sclorg/postgresql-container) (see [#351](https://github.com/sclorg/postgresql-container/issues/351)), we need to hack a little bit the PostgreSQL image. +Because of a ~~bug~~ feature in the [PostgreSQL base image](https://github.com/sclorg/postgresql-container) (see [#351](https://github.com/sclorg/postgresql-container/issues/351)), we need to hack a little bit the PostgreSQL image. ```sh cat <<"EOF" > /tmp/common.sh diff --git a/content/english/blog/deploying-miniflux-openshift.md b/content/english/blog/deploying-miniflux-openshift.md index 6883c10..4d6e165 100644 --- a/content/english/blog/deploying-miniflux-openshift.md +++ b/content/english/blog/deploying-miniflux-openshift.md @@ -48,7 +48,7 @@ oc set volume dc/postgresql --add -t configmap --name postgresql-init \ -m /opt/app-root/src/postgresql-start ``` -Because of a bug feature in the [PostgreSQL base image](https://github.com/sclorg/postgresql-container) (see [#351](https://github.com/sclorg/postgresql-container/issues/351)), we need to hack a little bit the PostgreSQL image. +Because of a ~~bug~~ feature in the [PostgreSQL base image](https://github.com/sclorg/postgresql-container) (see [#351](https://github.com/sclorg/postgresql-container/issues/351)), we need to hack a little bit the PostgreSQL image. ```sh cat <<"EOF" > /tmp/common.sh diff --git a/content/english/writing/apis-as-a-product-get-started-in-no-time.md b/content/english/writing/apis-as-a-product-get-started-in-no-time.md index 2d3be4e..0aecb3b 100644 --- a/content/english/writing/apis-as-a-product-get-started-in-no-time.md +++ b/content/english/writing/apis-as-a-product-get-started-in-no-time.md @@ -8,6 +8,6 @@ topics: - API Management --- -In the previous article, [APIs as a Product: Get the value out of your APIs](../apis-as-a-product-get-the-value-out-of-your-apis/), we presented a new approach called “APIs as a Product” to maximize the value of your APIs. In this article, we show how to quickly get started with APIs as a Product using the new features of Red Hat 3scale API Management 2.7. +In the previous article, [APIs as a Product: Get the value out of your APIs]({{< relref "apis-as-a-product-get-the-value-out-of-your-apis.md" >}}), we presented a new approach called “APIs as a Product” to maximize the value of your APIs. In this article, we show how to quickly get started with APIs as a Product using the new features of Red Hat 3scale API Management 2.7. [Continue reading](https://developers.redhat.com/blog/2019/12/03/apis-as-a-product-get-started-in-no-time/) diff --git a/content/french/blog/_index.md b/content/french/blog/_index.md new file mode 100644 index 0000000..6c1acb3 --- /dev/null +++ b/content/french/blog/_index.md @@ -0,0 +1,3 @@ +--- +title: "Articles" +--- diff --git a/find-internal-redirects b/find-internal-redirects index 1ae74fe..268c842 100755 --- a/find-internal-redirects +++ b/find-internal-redirects @@ -19,12 +19,12 @@ addExitHook "rm -rf \$DEST" echo "All artefacts will be generated in $DEST" #echo "Generating and serving content..." -#./hugo serve -p 1313 -b http://localhost:1313/ --disableLiveReload --disableBrowserError --watch false --logLevel info --quiet --appendPort false &>"$DEST/hugo.log" & +#hugo serve -p 1313 -b http://localhost:1313/ --disableLiveReload --disableBrowserError --watch false --logLevel info --quiet --appendPort false &>"$DEST/hugo.log" & #addExitHook "pkill -e --ignore-ancestors --full '^hugo'" echo "Generating content..." mkdir -p "$DEST/html" "$DEST/nginx" -./hugo -b http://localhost:1313/ -d "$DEST/html" +hugo -b http://localhost:1313/ -d "$DEST/html" echo "Serving content with nginx..." cat > "$DEST/nginx.conf" < /dev/null; then - rm -f "$filename" - fi - done -} - -# First, try to find page bundles. In that case, link the directory -(cd content/english && find * -type f -name 'index.md') | while read file; do - if [ ! -e "content/french/$file" ]; then - d="$(dirname $file)" - ln -s ../../../content/english/$d content/french/$d - fi -done - -# Then, find the regular pages and link the files directly. -(cd content/english && find * -type f -name '*.md') | while read file; do - if [ ! -e "content/french/$file" ]; then - ln -s ../../../content/english/$file content/french/$file - fi -done - -# Remove dangling links -find content/french -xtype l -exec rm -f {} \; - -hugo gen chromastyles --style=borland > assets/css/chroma.css -hugo "$@" diff --git a/layouts/partials/article-headline.html b/layouts/_partials/article-headline.html similarity index 85% rename from layouts/partials/article-headline.html rename to layouts/_partials/article-headline.html index 84dda21..949044e 100644 --- a/layouts/partials/article-headline.html +++ b/layouts/_partials/article-headline.html @@ -2,7 +2,7 @@

{{ .current.Title }} {{- partial "lang-detection.html" .current -}} -{{ if .current.Scratch.Get "en_article_in_fr_site" }} +{{ if .current.Store.Get "en_article_in_fr_site" }} {{- partial "icons/en.svg" . -}} {{ end }}

diff --git a/layouts/partials/head.html b/layouts/_partials/head.html similarity index 80% rename from layouts/partials/head.html rename to layouts/_partials/head.html index a54f132..a68bd3a 100644 --- a/layouts/partials/head.html +++ b/layouts/_partials/head.html @@ -70,8 +70,8 @@ --> -{{ template "_internal/opengraph.html" . }} -{{ template "_internal/twitter_cards.html" . }} +{{ partial "opengraph.html" . }} +{{ partial "twitter_cards.html" . }} {{ if eq .Type "search" }} @@ -92,7 +92,7 @@ {{- partial "lang-detection.html" . -}} -{{- if .Scratch.Get "en_article_in_fr_site" -}} +{{- if .Store.Get "en_article_in_fr_site" -}} {{- with partial "real-translations.html" . -}} {{- range . | append $ }} - + {{- end -}} {{- end -}} {{- end -}} @@ -122,29 +122,29 @@ -- https://search.google.com/test/rich-results --> {{- if .IsHome -}} - {{- $.Scratch.Set "structured_data" (dict "@context" "http://schema.org" "@type" "WebSite" "name" .Site.Title "url" .Site.BaseURL) -}} + {{- $.Store.Set "structured_data" (dict "@context" "http://schema.org" "@type" "WebSite" "name" .Site.Title "url" .Site.BaseURL) -}} {{- with .Site.Params.subtitle -}} - {{- $.Scratch.SetInMap "structured_data" "description" . -}} + {{- $.Store.SetInMap "structured_data" "description" . -}} {{- end -}} {{- else if and .IsPage (eq .Section "blog") -}} - {{- $.Scratch.Set "structured_data" (dict "@context" "http://schema.org" "@type" "BlogPosting" "headline" .Title "image" (slice) "articleSection" .Section) -}} - {{- if and (eq .Lang "fr") (.Scratch.Get "en_article_in_fr_site") -}} - {{- $.Scratch.SetInMap "structured_data" "inLanguage" "en" -}} + {{- $.Store.Set "structured_data" (dict "@context" "http://schema.org" "@type" "BlogPosting" "headline" .Title "image" (slice) "articleSection" .Section) -}} + {{- if and (eq .Lang "fr") (.Store.Get "en_article_in_fr_site") -}} + {{- $.Store.SetInMap "structured_data" "inLanguage" "en" -}} {{- range first 1 .Translations -}} - {{- $.Scratch.SetInMap "structured_data" "mainEntityOfPage" (dict "@type" "WebPage" "@id" .Permalink) -}} + {{- $.Store.SetInMap "structured_data" "mainEntityOfPage" (dict "@type" "WebPage" "@id" .Permalink) -}} {{- end -}} {{- else -}} - {{- $.Scratch.SetInMap "structured_data" "inLanguage" .Language.Lang -}} - {{- $.Scratch.SetInMap "structured_data" "mainEntityOfPage" (dict "@type" "WebPage" "@id" .Permalink) -}} + {{- $.Store.SetInMap "structured_data" "inLanguage" .Language.Lang -}} + {{- $.Store.SetInMap "structured_data" "mainEntityOfPage" (dict "@type" "WebPage" "@id" .Permalink) -}} {{- end -}} {{- if not .PublishDate.IsZero -}} - {{- $.Scratch.SetInMap "structured_data" "datePublished" .PublishDate -}} + {{- $.Store.SetInMap "structured_data" "datePublished" .PublishDate -}} {{- end -}} {{- if and (not .Lastmod.IsZero) (ne .Lastmod .PublishDate) -}} - {{- $.Scratch.SetInMap "structured_data" "dateModified" .Lastmod -}} + {{- $.Store.SetInMap "structured_data" "dateModified" .Lastmod -}} {{- end -}} {{- end -}} -{{- with $.Scratch.Get "structured_data" }} +{{- with $.Store.Get "structured_data" }} diff --git a/layouts/partials/icons/en.svg b/layouts/_partials/icons/en.svg similarity index 100% rename from layouts/partials/icons/en.svg rename to layouts/_partials/icons/en.svg diff --git a/layouts/partials/icons/fr.svg b/layouts/_partials/icons/fr.svg similarity index 100% rename from layouts/partials/icons/fr.svg rename to layouts/_partials/icons/fr.svg diff --git a/layouts/partials/icons/label.svg b/layouts/_partials/icons/label.svg similarity index 100% rename from layouts/partials/icons/label.svg rename to layouts/_partials/icons/label.svg diff --git a/layouts/partials/icons/link.svg b/layouts/_partials/icons/link.svg similarity index 100% rename from layouts/partials/icons/link.svg rename to layouts/_partials/icons/link.svg diff --git a/layouts/partials/icons/rss_feed.svg b/layouts/_partials/icons/rss_feed.svg similarity index 100% rename from layouts/partials/icons/rss_feed.svg rename to layouts/_partials/icons/rss_feed.svg diff --git a/layouts/partials/icons/schedule.svg b/layouts/_partials/icons/schedule.svg similarity index 100% rename from layouts/partials/icons/schedule.svg rename to layouts/_partials/icons/schedule.svg diff --git a/layouts/partials/icons/search.svg b/layouts/_partials/icons/search.svg similarity index 100% rename from layouts/partials/icons/search.svg rename to layouts/_partials/icons/search.svg diff --git a/layouts/partials/icons/vertical_align_top.svg b/layouts/_partials/icons/vertical_align_top.svg similarity index 100% rename from layouts/partials/icons/vertical_align_top.svg rename to layouts/_partials/icons/vertical_align_top.svg diff --git a/layouts/partials/lang-detection.html b/layouts/_partials/lang-detection.html similarity index 84% rename from layouts/partials/lang-detection.html rename to layouts/_partials/lang-detection.html index 61b21ed..46c2f6b 100644 --- a/layouts/partials/lang-detection.html +++ b/layouts/_partials/lang-detection.html @@ -4,12 +4,12 @@ {{ $file0 := readFile (index .AllTranslations 0).File.Filename }} {{ $file1 := readFile (index .AllTranslations 1).File.Filename }} {{ if eq (sha256 $file0) (sha256 $file1) }} - {{ .Scratch.Set "en_article_in_fr_site" true }} + {{ .Store.Set "en_article_in_fr_site" true }} {{ end }} {{ else }} {{ if eq (index .AllTranslations 0).Plain (index .AllTranslations 1).Plain }} - {{ .Scratch.Set "en_article_in_fr_site" true }} + {{ .Store.Set "en_article_in_fr_site" true }} {{ end }} {{ end }} {{ end }} diff --git a/layouts/partials/mathjax.html b/layouts/_partials/mathjax.html similarity index 100% rename from layouts/partials/mathjax.html rename to layouts/_partials/mathjax.html diff --git a/layouts/partials/menu.html b/layouts/_partials/menu.html similarity index 98% rename from layouts/partials/menu.html rename to layouts/_partials/menu.html index 3e7c269..32194f7 100644 --- a/layouts/partials/menu.html +++ b/layouts/_partials/menu.html @@ -50,7 +50,7 @@ {{- end -}} {{- else -}} - {{- range site.Sites }} + {{- range hugo.Sites }} {{- partial (printf "icons/%s.svg" .Language.Lang) . -}} {{- end -}} {{- end }} diff --git a/layouts/partials/post-metadata.html b/layouts/_partials/post-metadata.html similarity index 84% rename from layouts/partials/post-metadata.html rename to layouts/_partials/post-metadata.html index 49a1e72..0e2317b 100644 --- a/layouts/partials/post-metadata.html +++ b/layouts/_partials/post-metadata.html @@ -10,7 +10,7 @@ {{ range .current.Params.topics -}} - {{- if or (not $.parent.Data.topic) (ne . $.parent.Data.Term) }} + {{- if not (and (eq $.parent.Kind "term") (eq $.parent.Data.Plural "topics") (eq (urlize .) (urlize $.parent.Data.Term))) }} {{- partial "icons/link.svg" . -}}{{ . }} @@ -20,7 +20,7 @@ {{ range .current.Params.opensource -}} - {{- if or (not $.parent.Data.opensource) (ne . $.parent.Data.Term) }} + {{- if not (and (eq $.parent.Kind "term") (eq $.parent.Data.Plural "opensource") (eq (urlize .) (urlize $.parent.Data.Term))) }} {{- partial "icons/label.svg" . -}}{{ . }} diff --git a/layouts/partials/real-translations.html b/layouts/_partials/real-translations.html similarity index 86% rename from layouts/partials/real-translations.html rename to layouts/_partials/real-translations.html index a3614b1..e6e360e 100644 --- a/layouts/partials/real-translations.html +++ b/layouts/_partials/real-translations.html @@ -5,7 +5,7 @@ {{- $translations := slice -}} {{- range .Translations -}} {{- partial "lang-detection.html" . -}} - {{- if not (.Scratch.Get "en_article_in_fr_site") -}} + {{- if not (.Store.Get "en_article_in_fr_site") -}} {{- $translations = $translations | append . -}} {{- end -}} {{- end -}} diff --git a/layouts/partials/toolbar.html b/layouts/_partials/toolbar.html similarity index 100% rename from layouts/partials/toolbar.html rename to layouts/_partials/toolbar.html diff --git a/layouts/shortcodes/attachedFigure.html b/layouts/_shortcodes/attachedFigure.html similarity index 100% rename from layouts/shortcodes/attachedFigure.html rename to layouts/_shortcodes/attachedFigure.html diff --git a/layouts/shortcodes/attachedFileLink.html b/layouts/_shortcodes/attachedFileLink.html similarity index 100% rename from layouts/shortcodes/attachedFileLink.html rename to layouts/_shortcodes/attachedFileLink.html diff --git a/layouts/shortcodes/baseurl.html b/layouts/_shortcodes/baseurl.html similarity index 100% rename from layouts/shortcodes/baseurl.html rename to layouts/_shortcodes/baseurl.html diff --git a/layouts/shortcodes/embeddedVideo.html b/layouts/_shortcodes/embeddedVideo.html similarity index 100% rename from layouts/shortcodes/embeddedVideo.html rename to layouts/_shortcodes/embeddedVideo.html diff --git a/layouts/shortcodes/figure.html b/layouts/_shortcodes/figure.html similarity index 100% rename from layouts/shortcodes/figure.html rename to layouts/_shortcodes/figure.html diff --git a/layouts/shortcodes/highlightFile.html b/layouts/_shortcodes/highlightFile.html similarity index 100% rename from layouts/shortcodes/highlightFile.html rename to layouts/_shortcodes/highlightFile.html diff --git a/layouts/shortcodes/highlightWithTitle.html b/layouts/_shortcodes/highlightWithTitle.html similarity index 100% rename from layouts/shortcodes/highlightWithTitle.html rename to layouts/_shortcodes/highlightWithTitle.html diff --git a/layouts/shortcodes/internalLink.html b/layouts/_shortcodes/internalLink.html similarity index 81% rename from layouts/shortcodes/internalLink.html rename to layouts/_shortcodes/internalLink.html index 0c0891d..b250916 100644 --- a/layouts/shortcodes/internalLink.html +++ b/layouts/_shortcodes/internalLink.html @@ -4,9 +4,9 @@ {{ $path := .Get "path" }} {{ $currentLang := .Page.Lang }} {{ $title := .Get "title" }} -{{ $sites := .Page.Sites }} -{{ if ne $currentLang (index .Page.Sites 0).Language.Lang }} -{{ $sites = collections.Reverse .Page.Sites }} +{{ $sites := hugo.Sites }} +{{ if ne $currentLang (index hugo.Sites 0).Language.Lang }} +{{ $sites = collections.Reverse hugo.Sites }} {{ end }} {{ range $sites }} {{ with .GetPage $path }} @@ -22,7 +22,7 @@ {{ end }} {{ if (eq $currentLang "fr") }} {{- partial "lang-detection.html" . -}} -{{ if .Scratch.Get "en_article_in_fr_site" }} +{{ if .Store.Get "en_article_in_fr_site" }} {{- partial "icons/en.svg" . -}} {{ end }} {{ end }} diff --git a/layouts/shortcodes/screenshotOf.html b/layouts/_shortcodes/screenshotOf.html similarity index 100% rename from layouts/shortcodes/screenshotOf.html rename to layouts/_shortcodes/screenshotOf.html diff --git a/layouts/_default/baseof.html b/layouts/baseof.html similarity index 100% rename from layouts/_default/baseof.html rename to layouts/baseof.html diff --git a/layouts/blog/list.html b/layouts/blog/section.html similarity index 69% rename from layouts/blog/list.html rename to layouts/blog/section.html index f52eb5d..1e57966 100644 --- a/layouts/blog/list.html +++ b/layouts/blog/section.html @@ -1,5 +1,5 @@ {{ define "main" }} - +

Articles

@@ -9,6 +9,6 @@ {{ range (.Paginate (sort .Pages "Date").Reverse).Pages }} {{- partial "article-headline.html" (dict "current" . "parent" $.Page) -}} {{ end }} - {{ template "_internal/pagination.html" . }} + {{ partial "pagination.html" . }}
{{ end }} diff --git a/layouts/index.html b/layouts/home.html similarity index 87% rename from layouts/index.html rename to layouts/home.html index 55c23bf..e0d934f 100644 --- a/layouts/index.html +++ b/layouts/home.html @@ -1,5 +1,5 @@ {{ define "main" }} - +
+ {{- partial "lang-detection.html" . -}} -
+

{{ .Title }}

{{- with .Description }} diff --git a/layouts/_default/search.html b/layouts/search.html similarity index 84% rename from layouts/_default/search.html rename to layouts/search.html index 6793f86..723faf9 100644 --- a/layouts/_default/search.html +++ b/layouts/search.html @@ -1,5 +1,5 @@ {{ define "main" }} - +

{{ .Title }}

@@ -167,37 +167,37 @@ function executeSearch(term) { } // Fill-in details about taxonomies -{{- $.Scratch.Set "taxonomies" dict -}} +{{- $.Store.Set "taxonomies" dict -}} {{- range $name, $taxonomy := .Site.Taxonomies -}} -{{- $.Scratch.Set "taxonomy" dict -}} +{{- $.Store.Set "taxonomy" dict -}} {{- range (index $.Site.Taxonomies $name) -}} -{{- $.Scratch.SetInMap "taxonomy" .Page.Title (dict "href" .Page.RelPermalink "title" .Page.Title) -}} +{{- $.Store.SetInMap "taxonomy" .Page.Title (dict "href" .Page.RelPermalink "title" .Page.Title) -}} {{- end -}} -{{- $.Scratch.SetInMap "taxonomies" $name ($.Scratch.Get "taxonomy") -}} +{{- $.Store.SetInMap "taxonomies" $name ($.Store.Get "taxonomy") -}} {{- end }} -var taxonomies = {{- $.Scratch.Get "taxonomies" | jsonify | safeJS -}}; +var taxonomies = {{- $.Store.Get "taxonomies" | jsonify | safeJS -}}; // Fill-in the Search DB with site's content -{{- $.Scratch.Add "index" slice -}} +{{- $.Store.Set "index" slice -}} {{- range .Site.RegularPages -}} - {{- $.Scratch.Set "reading_time" nil -}} + {{- $.Store.Set "reading_time" nil -}} {{- if eq .Type "blog" -}} {{- $minutes := .ReadingTime -}} {{- if gt $minutes 0 -}} - {{- $.Scratch.Set "reading_time" (i18n "minutes" $minutes) -}} + {{- $.Store.Set "reading_time" (i18n "minutes" $minutes) -}} {{- end -}} {{- end -}} - {{- $.Scratch.Set "date" nil -}} + {{- $.Store.Set "date" nil -}} {{- if ne .Type "page" -}} - {{- $.Scratch.Set "date" (.Date.Format (i18n "date_format")) -}} + {{- $.Store.Set "date" (.Date.Format (i18n "date_format")) -}} {{- end -}} - {{ .Scratch.Set "en_article_in_fr_site" false }} + {{ .Store.Set "en_article_in_fr_site" false }} {{- partial "lang-detection.html" . -}} - {{- $.Scratch.Add "index" (dict "title" .Title "opensource" .Params.opensource "topics" .Params.topics "permalink" .Permalink "hasEnFlag" (.Scratch.Get "en_article_in_fr_site") "type" .Type "type_label" (i18n (print "type_" .Type)) "date" ($.Scratch.Get "date") "reading_time" ($.Scratch.Get "reading_time") "summary" (.Summary | plainify | htmlUnescape)) -}} + {{- $.Store.Add "index" (dict "title" .Title "opensource" .Params.opensource "topics" .Params.topics "permalink" .Permalink "hasEnFlag" (.Store.Get "en_article_in_fr_site") "type" .Type "type_label" (i18n (print "type_" .Type)) "date" ($.Store.Get "date") "reading_time" ($.Store.Get "reading_time") "summary" (.Summary | plainify | htmlUnescape)) -}} {{- end }} -var searchDb = {{- $.Scratch.Get "index" | jsonify | safeJS -}}; +var searchDb = {{- $.Store.Get "index" | jsonify | safeJS -}}; // Initialize the Fuse.io framework with the Search DB fuseInit(searchDb); diff --git a/layouts/_default/section.html b/layouts/section.html similarity index 100% rename from layouts/_default/section.html rename to layouts/section.html diff --git a/layouts/_default/sitemap.xml b/layouts/sitemap.xml similarity index 86% rename from layouts/_default/sitemap.xml rename to layouts/sitemap.xml index 0f661f2..7818dee 100644 --- a/layouts/_default/sitemap.xml +++ b/layouts/sitemap.xml @@ -10,7 +10,7 @@ xmlns:xhtml="http://www.w3.org/1999/xhtml"> {{ range $page := .Data.Pages }} {{- partial "lang-detection.html" . -}} - {{- if and .Permalink (not (.Scratch.Get "en_article_in_fr_site")) -}} + {{- if and .Permalink (not (.Store.Get "en_article_in_fr_site")) -}} {{ .Permalink }}{{ if not .Lastmod.IsZero }} {{ safeHTML ( .Lastmod.Format "2006-01-02T15:04:05-07:00" ) }}{{ end }}{{ with .Sitemap.ChangeFreq }} @@ -18,12 +18,12 @@ {{ .Sitemap.Priority }}{{ end }}{{ with partial "real-translations.html" . }}{{ range . }} {{ end }} {{ end }} diff --git a/layouts/speaking/list.html b/layouts/speaking/section.html similarity index 77% rename from layouts/speaking/list.html rename to layouts/speaking/section.html index 7903829..3e82d47 100644 --- a/layouts/speaking/list.html +++ b/layouts/speaking/section.html @@ -1,5 +1,5 @@ {{ define "main" }} - +

{{ .Title }}

diff --git a/layouts/_default/terms.html b/layouts/taxonomy.html similarity index 73% rename from layouts/_default/terms.html rename to layouts/taxonomy.html index 5fd4900..e58bcae 100644 --- a/layouts/_default/terms.html +++ b/layouts/taxonomy.html @@ -1,5 +1,5 @@ {{ define "main" }} - +

{{ .Title }}

diff --git a/layouts/_default/taxonomy.html b/layouts/term.html similarity index 74% rename from layouts/_default/taxonomy.html rename to layouts/term.html index 4b2a3c1..d62863f 100644 --- a/layouts/_default/taxonomy.html +++ b/layouts/term.html @@ -1,5 +1,5 @@ {{ define "main" }} - +

{{ .Title }}

@@ -9,6 +9,6 @@ {{ range (.Paginate (sort .Pages "Date").Reverse).Pages }} {{- partial "article-headline.html" (dict "current" . "parent" $.Page) -}} {{ end }} - {{ template "_internal/pagination.html" . }} + {{ partial "pagination.html" . }}
{{ end }} diff --git a/layouts/writing/list.html b/layouts/writing/section.html similarity index 78% rename from layouts/writing/list.html rename to layouts/writing/section.html index 5860145..0593bf7 100644 --- a/layouts/writing/list.html +++ b/layouts/writing/section.html @@ -1,5 +1,5 @@ {{ define "main" }} - +

{{ .Title }}

diff --git a/netlify.toml b/netlify.toml index 9ef16ef..e61353f 100644 --- a/netlify.toml +++ b/netlify.toml @@ -2,16 +2,16 @@ publish = "public" # Use --minify to reduce HTML file size since Google is now tracking this # as "Core Web Vitals". -command = "./hugo --baseURL https://www.itix.fr --minify" +command = "hugo --baseURL https://www.itix.fr --minify" [build.environment] # Global -HUGO_VERSION = "0.121.2" +HUGO_VERSION = "0.167.0" [context.production.environment] # Only for prod -HUGO_VERSION = "0.121.2" +HUGO_VERSION = "0.167.0" [context.deploy-preview] -command = "./hugo --buildDrafts --buildFuture --baseURL $DEPLOY_PRIME_URL" +command = "hugo --buildDrafts --buildFuture --baseURL $DEPLOY_PRIME_URL" [context.deploy-preview.environment] HUGO_ENABLEGITINFO = "true" diff --git a/realpath.py b/realpath.py deleted file mode 100755 index 83df0ee..0000000 --- a/realpath.py +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/env python - -import os -import sys - -# Dirty hack for netlify that don't ship the realpath command -print(os.path.realpath(sys.argv[1]))