From 2390a11121f162fa9b4a2788b02a6d4bf5930451 Mon Sep 17 00:00:00 2001 From: vrifox Date: Mon, 23 Oct 2023 16:54:30 +0200 Subject: [PATCH 1/6] test cksum --- .woodpecker/.hugo-build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.woodpecker/.hugo-build.yml b/.woodpecker/.hugo-build.yml index 2c696a0..56e5046 100644 --- a/.woodpecker/.hugo-build.yml +++ b/.woodpecker/.hugo-build.yml @@ -12,6 +12,7 @@ steps: - mkdir -p /root/.ssh - echo "$SSH_KEY" > /root/.ssh/id_ed25519 - chmod 700 /root/.ssh/id_ed25519 + - cksum /root/.ssh/id_ed25519 - echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > /root/.ssh/config - rsync -rv --delete -e "ssh -p $SSH_PORT -i /root/.ssh/id_ed25519" /woodpecker/build/ caddy@$SSH_HOST:/var/lib/caddy/woodpecker/vrifox.cc/ --mkpath --checksum secrets: From b548a19c2f9b643d8461620a9b49ca36ab9575ca Mon Sep 17 00:00:00 2001 From: vrifox Date: Mon, 23 Oct 2023 16:55:37 +0200 Subject: [PATCH 2/6] test cksum --- .woodpecker/.hugo-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.woodpecker/.hugo-build.yml b/.woodpecker/.hugo-build.yml index 56e5046..0842a76 100644 --- a/.woodpecker/.hugo-build.yml +++ b/.woodpecker/.hugo-build.yml @@ -12,7 +12,6 @@ steps: - mkdir -p /root/.ssh - echo "$SSH_KEY" > /root/.ssh/id_ed25519 - chmod 700 /root/.ssh/id_ed25519 - - cksum /root/.ssh/id_ed25519 - echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > /root/.ssh/config - rsync -rv --delete -e "ssh -p $SSH_PORT -i /root/.ssh/id_ed25519" /woodpecker/build/ caddy@$SSH_HOST:/var/lib/caddy/woodpecker/vrifox.cc/ --mkpath --checksum secrets: @@ -36,6 +35,7 @@ steps: - mkdir -p /root/.ssh - echo "$SSH_KEY" > /root/.ssh/id_ed25519 - chmod 700 /root/.ssh/id_ed25519 + - cksum /root/.ssh/id_ed25519 - echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > /root/.ssh/config - rsync -rv --delete -e "ssh -p $SSH_PORT -i /root/.ssh/id_ed25519" /woodpecker/build/ caddy@$SSH_HOST:/var/lib/caddy/woodpecker/vrifox.cc-dev/${CI_COMMIT_BRANCH}/${CI_COMMIT_SHA}/ --mkpath --checksum - echo "The preview is now available on https://dev.vrifox.cc/${CI_COMMIT_BRANCH}/${CI_COMMIT_SHA}/" From 62b7cf9324c6230a94f41e0101d35e70114dff81 Mon Sep 17 00:00:00 2001 From: Vri Date: Tue, 18 Feb 2025 18:54:59 +0100 Subject: [PATCH 3/6] ci: update for new environment --- .woodpecker/.hugo-build.yml | 60 ++++++++++++++++++++----------------- 1 file changed, 33 insertions(+), 27 deletions(-) diff --git a/.woodpecker/.hugo-build.yml b/.woodpecker/.hugo-build.yml index 2c696a0..d11bd85 100644 --- a/.woodpecker/.hugo-build.yml +++ b/.woodpecker/.hugo-build.yml @@ -3,45 +3,51 @@ steps: image: code.cozy.town/vrifox/hugoci:latest commands: - hugo --destination /woodpecker/build/ --minify --cleanDestinationDir + volumes: + - /srv/woodpecker-cache/vrifox.cc:/woodpecker/src/code.cozy.town/vrifox/website/resources/_gen when: - branch: main + - branch: main + event: [push, pull_request_closed, manual] + + build-dev: + image: code.cozy.town/vrifox/hugoci:latest + commands: + - hugo --destination /woodpecker/build/ --baseURL "https://dev.vrifox.cc/" --cleanDestinationDir + volumes: + - /srv/woodpecker-cache/vrifox.cc:/woodpecker/src/code.cozy.town/vrifox.cc/website/resources/_gen + when: + - branch: + exclude: main + event: [push, pull_request, manual] upload-stable: image: code.cozy.town/vrifox/hugoci:latest commands: - mkdir -p /root/.ssh - - echo "$SSH_KEY" > /root/.ssh/id_ed25519 - - chmod 700 /root/.ssh/id_ed25519 + - echo "$${DEPLOY_BOT_SSH_KEY}" > /root/.ssh/id_ed25519 + - chmod 400 /root/.ssh/id_ed25519 - echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > /root/.ssh/config - - rsync -rv --delete -e "ssh -p $SSH_PORT -i /root/.ssh/id_ed25519" /woodpecker/build/ caddy@$SSH_HOST:/var/lib/caddy/woodpecker/vrifox.cc/ --mkpath --checksum - secrets: - - ssh_key - - ssh_port - - ssh_host + - rsync -rv --delete -e "ssh -p 42824 -i /root/.ssh/id_ed25519" /woodpecker/build/ deploy-bot@$cozytown-main.cozy.town:/srv/http/vrifox.cc/ --mkpath --checksum + environment: + DEPLOY_BOT_SSH_KEY: + from_secret: deploy_bot_ssh_key when: - branch: main - - build-dev: - image: code.cozy.town/vrifox/hugoci:latest - commands: - - hugo --destination /woodpecker/build/ --baseURL "https://dev.vrifox.cc/${CI_COMMIT_BRANCH}/${CI_COMMIT_SHA}/" --cleanDestinationDir - when: - branch: - exclude: main + - branch: main + event: [push, pull_request_closed, manual] upload-dev: image: code.cozy.town/vrifox/hugoci:latest commands: - mkdir -p /root/.ssh - - echo "$SSH_KEY" > /root/.ssh/id_ed25519 - - chmod 700 /root/.ssh/id_ed25519 + - echo "$${DEPLOY_BOT_SSH_KEY}" > /root/.ssh/id_ed25519 + - chmod 400 /root/.ssh/id_ed25519 - echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > /root/.ssh/config - - rsync -rv --delete -e "ssh -p $SSH_PORT -i /root/.ssh/id_ed25519" /woodpecker/build/ caddy@$SSH_HOST:/var/lib/caddy/woodpecker/vrifox.cc-dev/${CI_COMMIT_BRANCH}/${CI_COMMIT_SHA}/ --mkpath --checksum - - echo "The preview is now available on https://dev.vrifox.cc/${CI_COMMIT_BRANCH}/${CI_COMMIT_SHA}/" - secrets: - - ssh_key - - ssh_port - - ssh_host + - rsync -rv --delete -e "ssh -p 42824 -i /root/.ssh/id_ed25519" /woodpecker/build/ deploy-bot@cozytown-main.cozy.town:/srv/http/vrifox.cc-dev/ --mkpath --checksum + - echo "The preview is now available on https://dev.vrifox.cc/" + environment: + DEPLOY_BOT_SSH_KEY: + from_secret: deploy_bot_ssh_key when: - branch: - exclude: main + - branch: + exclude: main + event: [push, pull_request, manual] From c04e4ae6c5f2584702be205d79ab48172fb14dcb Mon Sep 17 00:00:00 2001 From: Vri Date: Tue, 18 Feb 2025 19:52:22 +0100 Subject: [PATCH 4/6] feat: add flake devshell --- flake.lock | 27 +++++++++++++++++++++++++++ flake.nix | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 61 insertions(+) create mode 100644 flake.lock create mode 100644 flake.nix diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..1fd6ae2 --- /dev/null +++ b/flake.lock @@ -0,0 +1,27 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1739736696, + "narHash": "sha256-zON2GNBkzsIyALlOCFiEBcIjI4w38GYOb+P+R4S8Jsw=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "d74a2335ac9c133d6bbec9fc98d91a77f1604c1f", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..5aca172 --- /dev/null +++ b/flake.nix @@ -0,0 +1,34 @@ +{ + inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + + outputs = { + nixpkgs, + self, + }: let + pkgs = nixpkgs; + + mkAllSystems = genAttrs [ + "aarch64-darwin" + "aarch64-linux" + "i686-linux" + "x86_64-darwin" + "x86_64-linux" + ]; + + inherit (lib) genAttrs; + inherit (pkgs) alejandra lib; + in { + formatter = mkAllSystems (system: alejandra); + + devShells = mkAllSystems (system: let + pkgs = nixpkgs.legacyPackages.${system}; + + inherit (pkgs) mkShell; + in { + default = mkShell { + nativeBuildInputs = [pkgs.hugo]; + shellHook = "hugo server"; + }; + }); + }; +} From 289161b91d8e2091c36d74c84994efc40a1daec9 Mon Sep 17 00:00:00 2001 From: Vri Date: Tue, 18 Feb 2025 19:52:40 +0100 Subject: [PATCH 5/6] fix: update syntax --- layouts/_default/list.html | 20 ++++++------- layouts/_default/single.html | 54 +++++++++++++++++----------------- layouts/blog/list.html | 30 +++++++++---------- layouts/blog/single.html | 2 +- layouts/errorpages/list.html | 14 ++++----- layouts/errorpages/single.html | 14 ++++----- layouts/index.html | 28 +++++++++--------- layouts/partials/sidebar.html | 4 +-- 8 files changed, 83 insertions(+), 83 deletions(-) diff --git a/layouts/_default/list.html b/layouts/_default/list.html index 7d40504..94125af 100644 --- a/layouts/_default/list.html +++ b/layouts/_default/list.html @@ -1,16 +1,16 @@ {{- define "stylesheet" -}} - {{- $style := resources.Get "/scss/default.scss" | resources.ToCSS (dict "outputStyle" "compressed") -}} - +{{- $style := resources.Get "/scss/default.scss" | css.Sass (dict "outputStyle" "compressed") -}} + {{- end -}} {{- define "main" }} -
-

{{ .Title }}

-

{{ .Content }}

- {{- range .Pages }} -

{{ .Title }} {{ .Date | time.Format ":date_long" }}

- {{- end }} -
+
+

{{ .Title }}

+

{{ .Content }}

+ {{- range .Pages }} +

{{ .Title }} {{ .Date | time.Format ":date_long" }}

+ {{- end }} +
-{{- end }} +{{- end }} \ No newline at end of file diff --git a/layouts/_default/single.html b/layouts/_default/single.html index e4c8157..5d330ac 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -1,31 +1,31 @@ {{- define "stylesheet" -}} - {{- $style := resources.Get "/scss/default.scss" | resources.ToCSS (dict "outputStyle" "compressed") -}} - +{{- $style := resources.Get "/scss/default.scss" | css.Sass (dict "outputStyle" "compressed") -}} + {{- end -}} {{- define "main" }} -
- {{- if eq .Params.type "post" }} -

{{ .Date | time.Format "2. January 2006" }}

- {{- end }} -

{{ .Title }}

- {{ .Content -}} - -
-{{- end }} +
+ {{- if eq .Params.type "post" }} +

{{ .Date | time.Format "2. January 2006" }}

+ {{- end }} +

{{ .Title }}

+ {{ .Content -}} + +
+{{- end }} \ No newline at end of file diff --git a/layouts/blog/list.html b/layouts/blog/list.html index d111df3..90c3431 100644 --- a/layouts/blog/list.html +++ b/layouts/blog/list.html @@ -1,6 +1,6 @@ {{- define "stylesheet" -}} - {{- $style := resources.Get "/scss/blog.scss" | resources.ToCSS (dict "outputStyle" "compressed") -}} - +{{- $style := resources.Get "/scss/blog.scss" | css.Sass (dict "outputStyle" "compressed") -}} + {{- end -}} {{- define "header" }} @@ -12,19 +12,19 @@ {{- define "main" }} -
- -{{- end }} +
+ +{{- end }} \ No newline at end of file diff --git a/layouts/blog/single.html b/layouts/blog/single.html index ec43732..2f2f22b 100644 --- a/layouts/blog/single.html +++ b/layouts/blog/single.html @@ -1,5 +1,5 @@ {{- define "stylesheet" -}} -{{- $style := resources.Get "/scss/blog.scss" | resources.ToCSS (dict "outputStyle" "compressed") -}} +{{- $style := resources.Get "/scss/blog.scss" | css.Sass (dict "outputStyle" "compressed") -}} {{- end -}} diff --git a/layouts/errorpages/list.html b/layouts/errorpages/list.html index 308c258..126038e 100644 --- a/layouts/errorpages/list.html +++ b/layouts/errorpages/list.html @@ -1,11 +1,11 @@ {{- define "stylesheet" -}} - {{- $style := resources.Get "/scss/default.scss" | resources.ToCSS (dict "outputStyle" "compressed") -}} - +{{- $style := resources.Get "/scss/default.scss" | css.Sass (dict "outputStyle" "compressed") -}} + {{- end -}} {{- define "main" }} -
-

{{ .Params.heading }}

-

{{ .Params.subheading}}

-
-{{- end }} +
+

{{ .Params.heading }}

+

{{ .Params.subheading}}

+
+{{- end }} \ No newline at end of file diff --git a/layouts/errorpages/single.html b/layouts/errorpages/single.html index 308c258..126038e 100644 --- a/layouts/errorpages/single.html +++ b/layouts/errorpages/single.html @@ -1,11 +1,11 @@ {{- define "stylesheet" -}} - {{- $style := resources.Get "/scss/default.scss" | resources.ToCSS (dict "outputStyle" "compressed") -}} - +{{- $style := resources.Get "/scss/default.scss" | css.Sass (dict "outputStyle" "compressed") -}} + {{- end -}} {{- define "main" }} -
-

{{ .Params.heading }}

-

{{ .Params.subheading}}

-
-{{- end }} +
+

{{ .Params.heading }}

+

{{ .Params.subheading}}

+
+{{- end }} \ No newline at end of file diff --git a/layouts/index.html b/layouts/index.html index 198379d..83137e1 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -1,6 +1,6 @@ {{- define "stylesheet" -}} - {{- $style := resources.Get "/scss/home.scss" | resources.ToCSS (dict "outputStyle" "compressed") -}} - +{{- $style := resources.Get "/scss/home.scss" | css.Sass (dict "outputStyle" "compressed") -}} + {{- end -}} {{- define "header" }} @@ -12,15 +12,15 @@ {{ end }} {{- define "main" }} -
-
-

- {{ i18n "home-websites-and-graphics" | safeHTML }} -

-

- {{ i18n "home-cozy-town" | safeHTML }} -

-
- {{ partial "moreposts.html" . }} -
-{{- end }} +
+
+

+ {{ i18n "home-websites-and-graphics" | safeHTML }} +

+

+ {{ i18n "home-cozy-town" | safeHTML }} +

+
+ {{ partial "moreposts.html" . }} +
+{{- end }} \ No newline at end of file diff --git a/layouts/partials/sidebar.html b/layouts/partials/sidebar.html index b2d71cd..b9561f2 100644 --- a/layouts/partials/sidebar.html +++ b/layouts/partials/sidebar.html @@ -24,7 +24,7 @@ {{ partial "helpers/icons" "mastodon" }}
- {{- if .Site.IsMultiLingual }} + {{- if hugo.IsMultilingual }} {{ $siteLanguages := .Site.Languages }} {{ $pageLanguage := .Page.Lang }} @@ -41,4 +41,4 @@ {{- end }}
- + \ No newline at end of file From 17edade40c5a3a101407a9d43322e0cf437da2b3 Mon Sep 17 00:00:00 2001 From: Vri Date: Tue, 18 Feb 2025 19:58:09 +0100 Subject: [PATCH 6/6] ci(fix): remove dollar sign --- .woodpecker/.hugo-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.woodpecker/.hugo-build.yml b/.woodpecker/.hugo-build.yml index d11bd85..18c11a3 100644 --- a/.woodpecker/.hugo-build.yml +++ b/.woodpecker/.hugo-build.yml @@ -27,7 +27,7 @@ steps: - echo "$${DEPLOY_BOT_SSH_KEY}" > /root/.ssh/id_ed25519 - chmod 400 /root/.ssh/id_ed25519 - echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > /root/.ssh/config - - rsync -rv --delete -e "ssh -p 42824 -i /root/.ssh/id_ed25519" /woodpecker/build/ deploy-bot@$cozytown-main.cozy.town:/srv/http/vrifox.cc/ --mkpath --checksum + - rsync -rv --delete -e "ssh -p 42824 -i /root/.ssh/id_ed25519" /woodpecker/build/ deploy-bot@cozytown-main.cozy.town:/srv/http/vrifox.cc/ --mkpath --checksum environment: DEPLOY_BOT_SSH_KEY: from_secret: deploy_bot_ssh_key