From 3473296022afb3d703e48912401d5c497e0885b5 Mon Sep 17 00:00:00 2001 From: Lova Andriarimalala <43842786+Xpirix@users.noreply.github.com> Date: Tue, 3 Dec 2024 14:52:59 +0300 Subject: [PATCH] Fix roadmap schedule map --- Makefile | 6 +++--- README.md | 6 +++--- {csv => assets/csv}/schedule.csv | 0 scripts/update-schedule.py | 2 +- .../layouts/shortcodes/csv-table.html | 15 ++++++++++----- 5 files changed, 17 insertions(+), 12 deletions(-) rename {csv => assets/csv}/schedule.csv (100%) diff --git a/Makefile b/Makefile index 55de3487d..bbab9d9dc 100644 --- a/Makefile +++ b/Makefile @@ -64,13 +64,13 @@ hugo-run-dev: ## Run the server at localhost:1313 with hugo # U T I L S C O M M A N D S # ---------------------------------------------------------------------------- -csv/schedule.csv scripts/schedule.ics data/conf.json: +assets/csv/schedule.csv scripts/schedule.ics data/conf.json: python scripts/update-schedule.py clearschedule: - $(RM) csv/schedule.csv data/conf.json + $(RM) assets/csv/schedule.csv data/conf.json -schedule: clearschedule csv/schedule.csv scripts/schedule.ics data/conf.json ## Update schedule after release +schedule: clearschedule assets/csv/schedule.csv scripts/schedule.ics data/conf.json ## Update schedule after release git pull --autostash --rebase git commit -a -m "Update for $(shell jq -r '.release' data/conf.json)/$(shell jq -r '.ltrrelease' data/conf.json) point releases" diff --git a/README.md b/README.md index 4076686db..e7b595891 100644 --- a/README.md +++ b/README.md @@ -64,9 +64,9 @@ Download the latest version and then do Example, assuming that you use a dedicated directory for your local binaries : ```sh -mkdir -p ~/apps/hugo_128/ -wget https://github.com/gohugoio/hugo/releases/download/v0.128.0/hugo_extended_0.128.0_linux-amd64.deb --output-document ~/apps/hugo_128/hugo_extended_0.128.0_linux-amd64.deb -dpkg -x hugo_extended_0.128.0_linux-amd64.deb +mkdir -p ~/apps/hugo_139/ +wget https://github.com/gohugoio/hugo/releases/download/v0.139.3/hugo_extended_0.139.3_linux-amd64.deb --output-document ~/apps/hugo_128/hugo_extended_0.139.3_linux-amd64.deb +dpkg -x hugo_extended_0.139.3_linux-amd64.deb ~/apps/hugo_128/usr/local/bin/hugo server ``` diff --git a/csv/schedule.csv b/assets/csv/schedule.csv similarity index 100% rename from csv/schedule.csv rename to assets/csv/schedule.csv diff --git a/scripts/update-schedule.py b/scripts/update-schedule.py index bc0f3c8dd..181ada26c 100755 --- a/scripts/update-schedule.py +++ b/scripts/update-schedule.py @@ -152,7 +152,7 @@ def adduid(ev, uid): rows.append([event, lr, ltr, dev, date, weekno, weeks]) -o = open("csv/schedule.csv", "w") +o = open("assets/csv/schedule.csv", "w") o.write('"Event","Latest","Long-Term Repo","Freeze","Date","Week #","Weeks"\n') diff --git a/themes/hugo-bulma-blocks-theme/layouts/shortcodes/csv-table.html b/themes/hugo-bulma-blocks-theme/layouts/shortcodes/csv-table.html index 77b3ed2d5..a28a005ec 100644 --- a/themes/hugo-bulma-blocks-theme/layouts/shortcodes/csv-table.html +++ b/themes/hugo-bulma-blocks-theme/layouts/shortcodes/csv-table.html @@ -1,14 +1,19 @@ {{ $data := 0 }} -{{ with .Get "file" }} - {{ $resource := resources.Get . }} - {{ if $resource }} - {{ $data = $resource.Content | transform.Unmarshal }} +{{ $path := .Get "file" }} +{{ with resources.Get $path }} + {{ if . }} + {{ with . | transform.Unmarshal }} + {{ $data = . }} + {{ else }} + {{ printf "Error unmarshalling data from: %s" $path }} + {{ end }} {{ else }} -

Error: Could not load resource {{ . }}

+ {{ printf "Error: Resource not found at %s" $path }} {{ end }} {{ else }} {{ $data = .Inner | unmarshal }} {{ end }} + {{ if $data }}