Compare commits

...

4 Commits

Author SHA1 Message Date
664e5c3928
Migrate deprecated author as a site custom parameter
Some checks are pending
Build demo / build (push) Waiting to run
2024-11-19 11:33:08 +08:00
91eb61eb18
Update flake lockfile as of 2024-11-19
Flake lock file updates:

• Updated input 'flake-utils':
    'github:numtide/flake-utils/c1dfcf08411b08f6b8615f7d8971a2bfa81d5e8a?narHash=sha256-X6rJYSESBVr3hBoH0WbKE5KvhPU5bloyZ2L4K60/fPQ%3D' (2024-09-17)
  → 'github:numtide/flake-utils/11707dc2f618dd54ca8739b309ec4fc024de578b?narHash=sha256-l0KFg5HjrsfsO/JpG%2Br7fRrqm12kzFHyUHqHCVpMMbI%3D' (2024-11-13)
• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/86e78d3d2084ff87688da662cf78c2af085d8e73?narHash=sha256-eWPRZAlhf446bKSmzw6x7RWEE4IuZgAp8NW3eXZwRAY%3D' (2024-10-26)
  → 'github:NixOS/nixpkgs/5083ec887760adfe12af64830a66807423a859a7?narHash=sha256-D1FNZ70NmQEwNxpSSdTXCSklBH1z2isPR84J6DQrJGs%3D' (2024-11-18)
2024-11-19 11:16:52 +08:00
6d144bd701
Allow lockfile updates in CI 2024-11-19 11:15:18 +08:00
814a6c003a
Update deprecated functions in Hugo templates
Thus, the minimum version will also be moved.
2024-11-19 10:56:29 +08:00
9 changed files with 63 additions and 24 deletions

30
.github/workflows/update-deps.yml vendored Normal file
View File

@ -0,0 +1,30 @@
name: Update Nix dependencies
on:
workflow_dispatch:
schedule:
# This is done on a biweekly basis.
- cron: '0 0 1,15 * *'
jobs:
update-nix-deps:
permissions:
contents: write
pull-requests: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: DeterminateSystems/nix-installer-action@v16
- run: nix develop --command make update
- id: datetime
run: |
echo "DATETIME=$(date '+%F')" >> "$GITHUB_OUTPUT"
- name: Create pull request
uses: peter-evans/create-pull-request@v7
with:
title: "ci: update lockfile as of ${{ steps.datetime.outputs.DATETIME }}"
delete-branch: true
branch: update-flake-lockfile
body: ""
commit-message: |
Update flake lockfile as of ${{ steps.datetime.outputs.DATETIME }}
labels: flake-update

View File

@ -19,6 +19,12 @@ and this project adheres to https://semver.org/spec/v2.0.0.html[Semantic Version
== Unreleased == Unreleased
=== Updated
* Change all of the deprecated functions and parameters to their recommended replacements.
** `$.Site.Author` has been deprecated and instead uses the `$.Site.Params.author` instead.

View File

@ -9,3 +9,7 @@ update:
.PHONY : build-demo .PHONY : build-demo
build-demo: build-demo:
hugo -s ./exampleSite hugo -s ./exampleSite
.PHONY : dev-update
dev-update:
nix flake update

View File

@ -168,11 +168,11 @@ paginate = 20
path = "github.com/foo-dogsquared/hugo-web-feeds" path = "github.com/foo-dogsquared/hugo-web-feeds"
[author.john_doe] [params.author.john_doe]
name = "John Doe" name = "John Doe"
email = "johndoe@example.com" email = "johndoe@example.com"
[author.jane_doe] [params.author.jane_doe]
name = "Jane Doe" name = "Jane Doe"
email = "jane_doe_1995@example.com" email = "jane_doe_1995@example.com"
@ -250,19 +250,19 @@ Here are some of the assumptions made with certain keys from the site configurat
=== Authors === Authors
Despite this theme is aimed for personal blogs, it has support for multiple authors. Despite this theme is aimed for personal blogs, it has support for multiple authors.
As hinted from the example configuration, the author site parameter (i.e., `$.Site.Author`) is a map of objects. As hinted from the example configuration, the author site parameter (i.e., `$.Site.Params.author`) is a map of objects.
The author object only requires a value for `name` key. The author object only requires a value for `name` key.
You can also add more keys for more metadata. You can also add more keys for more metadata.
.An example of indicating authors in the site configuration .An example of indicating authors in the site configuration
[source, toml] [source, toml]
---- ----
[author.john_doe] [params.author.john_doe]
name = "John Doe" name = "John Doe"
email = "john_doe@example.com" email = "john_doe@example.com"
birthdate = "1996-01-12" birthdate = "1996-01-12"
[author.jane_doe] [params.author.jane_doe]
name = "Jane Doe" name = "Jane Doe"
---- ----

View File

@ -29,13 +29,6 @@ rssLimit = 2
experimental = true experimental = true
[author]
[author.john_doe]
name = "John Doe"
email = "johndoe@example.com"
[languages] [languages]
[languages.en] [languages.en]
# This key is used for more readable links. # This key is used for more readable links.
@ -133,3 +126,9 @@ rssLimit = 2
[params] [params]
toc = true toc = true
[params.author]
[params.author.john_doe]
name = "John Doe"
email = "johndoe@example.com"

12
flake.lock generated
View File

@ -5,11 +5,11 @@
"systems": "systems" "systems": "systems"
}, },
"locked": { "locked": {
"lastModified": 1726560853, "lastModified": 1731533236,
"narHash": "sha256-X6rJYSESBVr3hBoH0WbKE5KvhPU5bloyZ2L4K60/fPQ=", "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
"owner": "numtide", "owner": "numtide",
"repo": "flake-utils", "repo": "flake-utils",
"rev": "c1dfcf08411b08f6b8615f7d8971a2bfa81d5e8a", "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -20,11 +20,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1729980323, "lastModified": 1731890469,
"narHash": "sha256-eWPRZAlhf446bKSmzw6x7RWEE4IuZgAp8NW3eXZwRAY=", "narHash": "sha256-D1FNZ70NmQEwNxpSSdTXCSklBH1z2isPR84J6DQrJGs=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "86e78d3d2084ff87688da662cf78c2af085d8e73", "rev": "5083ec887760adfe12af64830a66807423a859a7",
"type": "github" "type": "github"
}, },
"original": { "original": {

View File

@ -1,7 +1,7 @@
[module] [module]
[module.hugoVersion] [module.hugoVersion]
extended = true extended = true
min = "0.120.0" min = "0.128.0"
[[module.imports]] [[module.imports]]
path = "github.com/foo-dogsquared/hugo-mod-simple-icons" path = "github.com/foo-dogsquared/hugo-mod-simple-icons"

View File

@ -3,7 +3,7 @@
<a href="#top">{{ i18n "back_to_top" | default "Back to top" }}</a> <a href="#top">{{ i18n "back_to_top" | default "Back to top" }}</a>
<!-- Linking to other languages' homepage. --> <!-- Linking to other languages' homepage. -->
{{ if $.Site.IsMultiLingual }} {{ if hugo.IsMultilingual }}
<p>{{ i18n "multilingual" }}: <p>{{ i18n "multilingual" }}:
<span class="site__list site__languages"> <span class="site__list site__languages">
{{ range $.Site.Languages }} {{ range $.Site.Languages }}
@ -36,6 +36,6 @@
{{ $markdownOpt := dict "markup" "markdown" }} {{ $markdownOpt := dict "markup" "markdown" }}
<!-- Copyright info. --> <!-- Copyright info. -->
<p>{{ with $.Site.Copyright }}{{ . | $.Site.RenderPage $markdownOpt }}{{ else }}© {{ now.Year }} {{ with $.Site.Author.name }}{{ . }}{{ else }}{{ $.Site.Title }}{{ end }}{{ end }}</p> <p>{{ with $.Site.Copyright }}{{ . | $.Site.RenderPage $markdownOpt }}{{ else }}© {{ now.Year }} {{ with $.Site.Params.author.name }}{{ . }}{{ else }}{{ $.Site.Title }}{{ end }}{{ end }}</p>
</footer> </footer>

View File

@ -3,10 +3,10 @@
{{- $stylesheets := slice }} {{- $stylesheets := slice }}
<!-- The main stylesheet being compiled. --> <!-- The main stylesheet being compiled. -->
{{- $main := resources.Get "scss/main.scss" | resources.ToCSS }} {{- $main := resources.Get "scss/main.scss" | toCSS }}
{{- /* Combine all of the custom schems in under one stylesheet */ -}} {{- /* Combine all of the custom schems in under one stylesheet */ -}}
{{- $themes := resources.Get "templates/theme.scss" | resources.ExecuteAsTemplate "css/themes.css" . | resources.ToCSS {{- $themes := resources.Get "templates/theme.scss" | resources.ExecuteAsTemplate "css/themes.css" . | toCSS
}} }}
{{- /* Append the main stylesheet to be the last so the resulting stylesheet will make the custom colorschemes at the {{- /* Append the main stylesheet to be the last so the resulting stylesheet will make the custom colorschemes at the
@ -34,7 +34,7 @@ It's a very small script so there's little effect on perceived performance. */ -
{{ hugo.Generator }} {{ hugo.Generator }}
<meta charset="utf-8"> <meta charset="utf-8">
{{- with .Site.Author }} {{- with .Site.Params.author }}
{{- $names := slice }} {{- $names := slice }}
{{- range . }}{{ $names = $names | append .name }}{{ end }} {{- range . }}{{ $names = $names | append .name }}{{ end }}
<meta name="author" content="{{ delimit $names " , " (printf " %s " (i18n " and")) }}" /> <meta name="author" content="{{ delimit $names " , " (printf " %s " (i18n " and")) }}" />