From c04e4ae6c5f2584702be205d79ab48172fb14dcb Mon Sep 17 00:00:00 2001 From: Vri Date: Tue, 18 Feb 2025 19:52:22 +0100 Subject: [PATCH 1/2] 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 2/2] 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