From bc3fb3a717a207e8635af1d4892e0fbd7d2b5734 Mon Sep 17 00:00:00 2001 From: Cell <1024@lruihao.cn> Date: Fri, 29 May 2026 16:41:21 +0800 Subject: [PATCH] chore: add Dockerfile and devcontainer configuration for Hugo theme development --- .devcontainer/Dockerfile | 21 +++++++++++++++++++++ .devcontainer/devcontainer.json | 24 ++++++++++++++++++++++++ .editorconfig | 9 +++++++++ go.mod | 2 +- package.json | 1 + 5 files changed, 56 insertions(+), 1 deletion(-) create mode 100644 .devcontainer/Dockerfile create mode 100644 .devcontainer/devcontainer.json create mode 100644 .editorconfig diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile new file mode 100644 index 00000000..40fc0931 --- /dev/null +++ b/.devcontainer/Dockerfile @@ -0,0 +1,21 @@ +FROM mcr.microsoft.com/devcontainers/javascript-node:24 + +# Install Hugo Extended +ARG HUGO_VERSION +RUN curl -sLJO "https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.tar.gz" \ + && tar -C /usr/local/bin -xf "hugo_extended_${HUGO_VERSION}_linux-amd64.tar.gz" hugo \ + && rm "hugo_extended_${HUGO_VERSION}_linux-amd64.tar.gz" + +# Install Dart Sass +ARG DART_SASS_VERSION +RUN curl -sLJO "https://github.com/sass/dart-sass/releases/download/${DART_SASS_VERSION}/dart-sass-${DART_SASS_VERSION}-linux-x64.tar.gz" \ + && tar -C /usr/local -xf "dart-sass-${DART_SASS_VERSION}-linux-x64.tar.gz" \ + && ln -s /usr/local/dart-sass/sass /usr/local/bin/sass \ + && rm "dart-sass-${DART_SASS_VERSION}-linux-x64.tar.gz" + +# Install Go +ARG GO_VERSION +RUN curl -sLJO "https://go.dev/dl/go${GO_VERSION}.linux-amd64.tar.gz" \ + && tar -C /usr/local -xf "go${GO_VERSION}.linux-amd64.tar.gz" \ + && rm "go${GO_VERSION}.linux-amd64.tar.gz" +ENV PATH="/usr/local/go/bin:${PATH}" diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 00000000..10a65ec4 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,24 @@ +{ + "name": "FixIt Theme", + "build": { + "dockerfile": "Dockerfile", + "args": { + "HUGO_VERSION": "0.158.0", + "DART_SASS_VERSION": "1.99.0", + "GO_VERSION": "1.24.4" + } + }, + "postCreateCommand": "pnpm install", + "customizations": { + "vscode": { + "extensions": [ + "budparr.language-hugo-vscode", + "kaellarkin.hugo-shortcode-syntax", + "lruihao.hugo-partials-refs", + "tamasfe.even-better-toml", + "casualjim.gotemplate", + "SomewhatStationery.some-sass" + ] + } + } +} diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 00000000..86a63dc0 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,9 @@ +root = true + +[*] +charset = utf-8 +end_of_line = lf +indent_style = space +indent_size = 2 +insert_final_newline = true +trim_trailing_whitespace = true diff --git a/go.mod b/go.mod index ad287e36..e03be7e2 100644 --- a/go.mod +++ b/go.mod @@ -1,3 +1,3 @@ module github.com/hugo-fixit/FixIt -go 1.19 +go 1.20 diff --git a/package.json b/package.json index 93ae4398..ce603818 100644 --- a/package.json +++ b/package.json @@ -35,6 +35,7 @@ "build:demo": "pnpm -F demo build", "build:test": "pnpm -F test build", "build": "concurrently 'pnpm build:demo' 'pnpm build:test' && pnpm -F integration start", + "clean": "rm -rf public resources/_gen apps/*/public apps/*/resources/_gen", "preview": "serve public", "lint": "eslint --cache .", "typecheck": "tsc --noEmit",