diff --git a/.ci/build.sh b/.ci/build.sh new file mode 100644 index 0000000..abf6cc8 --- /dev/null +++ b/.ci/build.sh @@ -0,0 +1,68 @@ +#!/usr/bin/env bash + +#------------------------------------------------------------------------------ +# @file +# Builds a Hugo site hosted on a Cloudflare Worker. +# +# The Cloudflare Worker automatically installs Node.js dependencies. +#------------------------------------------------------------------------------ + +main() { + DART_SASS_VERSION=1.97.1 + GO_VERSION=1.25.5 + HUGO_VERSION=0.154.5 + NODE_VERSION=24.12.0 + + export TZ=Europe/Oslo + + # Install Dart Sass + echo "Installing Dart Sass ${DART_SASS_VERSION}..." + curl -sLJO "https://github.com/sass/dart-sass/releases/download/${DART_SASS_VERSION}/dart-sass-${DART_SASS_VERSION}-linux-x64.tar.gz" + tar -C "${HOME}/.local" -xf "dart-sass-${DART_SASS_VERSION}-linux-x64.tar.gz" + rm "dart-sass-${DART_SASS_VERSION}-linux-x64.tar.gz" + export PATH="${HOME}/.local/dart-sass:${PATH}" + + # Install Go + echo "Installing Go ${GO_VERSION}..." + curl -sLJO "https://go.dev/dl/go${GO_VERSION}.linux-amd64.tar.gz" + tar -C "${HOME}/.local" -xf "go${GO_VERSION}.linux-amd64.tar.gz" + rm "go${GO_VERSION}.linux-amd64.tar.gz" + export PATH="${HOME}/.local/go/bin:${PATH}" + + # Install Hugo + echo "Installing Hugo ${HUGO_VERSION}..." + curl -sLJO "https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.tar.gz" + mkdir "${HOME}/.local/hugo" + tar -C "${HOME}/.local/hugo" -xf "hugo_extended_${HUGO_VERSION}_linux-amd64.tar.gz" + rm "hugo_extended_${HUGO_VERSION}_linux-amd64.tar.gz" + export PATH="${HOME}/.local/hugo:${PATH}" + + # Install Node.js + echo "Installing Node.js ${NODE_VERSION}..." + curl -sLJO "https://nodejs.org/dist/v${NODE_VERSION}/node-v${NODE_VERSION}-linux-x64.tar.xz" + tar -C "${HOME}/.local" -xf "node-v${NODE_VERSION}-linux-x64.tar.xz" + rm "node-v${NODE_VERSION}-linux-x64.tar.xz" + export PATH="${HOME}/.local/node-v${NODE_VERSION}-linux-x64/bin:${PATH}" + + # Verify installations + echo "Verifying installations..." + echo Dart Sass: "$(sass --version)" + echo Go: "$(go version)" + echo Hugo: "$(hugo version)" + echo Node.js: "$(node --version)" + + # Configure Git + echo "Configuring Git..." + git config core.quotepath false + if [ "$(git rev-parse --is-shallow-repository)" = "true" ]; then + git fetch --unshallow + fi + + # Build the site + echo "Building the site..." + cd demo + hugo --gc --minify --themesDir=/opt/buildhome --theme=repo +} + +set -euo pipefail +main "$@" \ No newline at end of file diff --git a/debug.sh b/debug.sh deleted file mode 100755 index 4d1312e..0000000 --- a/debug.sh +++ /dev/null @@ -1 +0,0 @@ -cd exampleSite && hugo server --gc --themesDir=../.. \ No newline at end of file diff --git a/exampleSite/.gitignore b/demo/.gitignore similarity index 100% rename from exampleSite/.gitignore rename to demo/.gitignore diff --git a/exampleSite/LICENSE b/demo/LICENSE similarity index 100% rename from exampleSite/LICENSE rename to demo/LICENSE diff --git a/exampleSite/README.md b/demo/README.md similarity index 100% rename from exampleSite/README.md rename to demo/README.md diff --git a/exampleSite/content/_index.ja.md b/demo/content/_index.ja.md similarity index 100% rename from exampleSite/content/_index.ja.md rename to demo/content/_index.ja.md diff --git a/exampleSite/content/_index.md b/demo/content/_index.md similarity index 100% rename from exampleSite/content/_index.md rename to demo/content/_index.md diff --git a/exampleSite/content/_index.zh-cn.md b/demo/content/_index.zh-cn.md similarity index 100% rename from exampleSite/content/_index.zh-cn.md rename to demo/content/_index.zh-cn.md diff --git a/exampleSite/content/_index.zh-tw.md b/demo/content/_index.zh-tw.md similarity index 100% rename from exampleSite/content/_index.zh-tw.md rename to demo/content/_index.zh-tw.md diff --git a/exampleSite/content/categories/Test/_index.md b/demo/content/categories/Test/_index.md similarity index 100% rename from exampleSite/content/categories/Test/_index.md rename to demo/content/categories/Test/_index.md diff --git a/exampleSite/content/categories/Test/hutomo-abrianto-l2jk-uxb1BY-unsplash.jpg b/demo/content/categories/Test/hutomo-abrianto-l2jk-uxb1BY-unsplash.jpg similarity index 100% rename from exampleSite/content/categories/Test/hutomo-abrianto-l2jk-uxb1BY-unsplash.jpg rename to demo/content/categories/Test/hutomo-abrianto-l2jk-uxb1BY-unsplash.jpg diff --git a/exampleSite/content/page/about/index.md b/demo/content/page/about/index.md similarity index 100% rename from exampleSite/content/page/about/index.md rename to demo/content/page/about/index.md diff --git a/exampleSite/content/page/about/index.zh-cn.md b/demo/content/page/about/index.zh-cn.md similarity index 100% rename from exampleSite/content/page/about/index.zh-cn.md rename to demo/content/page/about/index.zh-cn.md diff --git a/exampleSite/content/page/archives/index.md b/demo/content/page/archives/index.md similarity index 100% rename from exampleSite/content/page/archives/index.md rename to demo/content/page/archives/index.md diff --git a/exampleSite/content/page/links/index.md b/demo/content/page/links/index.md similarity index 100% rename from exampleSite/content/page/links/index.md rename to demo/content/page/links/index.md diff --git a/exampleSite/content/page/links/ts-logo-128.jpg b/demo/content/page/links/ts-logo-128.jpg similarity index 100% rename from exampleSite/content/page/links/ts-logo-128.jpg rename to demo/content/page/links/ts-logo-128.jpg diff --git a/exampleSite/content/page/search/index.md b/demo/content/page/search/index.md similarity index 100% rename from exampleSite/content/page/search/index.md rename to demo/content/page/search/index.md diff --git a/exampleSite/content/post/chinese-test/florian-klauer-nptLmg6jqDo-unsplash.jpg b/demo/content/post/chinese-test/florian-klauer-nptLmg6jqDo-unsplash.jpg similarity index 100% rename from exampleSite/content/post/chinese-test/florian-klauer-nptLmg6jqDo-unsplash.jpg rename to demo/content/post/chinese-test/florian-klauer-nptLmg6jqDo-unsplash.jpg diff --git a/exampleSite/content/post/chinese-test/helena-hertz-wWZzXlDpMog-unsplash.jpg b/demo/content/post/chinese-test/helena-hertz-wWZzXlDpMog-unsplash.jpg similarity index 100% rename from exampleSite/content/post/chinese-test/helena-hertz-wWZzXlDpMog-unsplash.jpg rename to demo/content/post/chinese-test/helena-hertz-wWZzXlDpMog-unsplash.jpg diff --git a/exampleSite/content/post/chinese-test/hudai-gayiran-3Od_VKcDEAA-unsplash.jpg b/demo/content/post/chinese-test/hudai-gayiran-3Od_VKcDEAA-unsplash.jpg similarity index 100% rename from exampleSite/content/post/chinese-test/hudai-gayiran-3Od_VKcDEAA-unsplash.jpg rename to demo/content/post/chinese-test/hudai-gayiran-3Od_VKcDEAA-unsplash.jpg diff --git a/exampleSite/content/post/chinese-test/index.ja.md b/demo/content/post/chinese-test/index.ja.md similarity index 100% rename from exampleSite/content/post/chinese-test/index.ja.md rename to demo/content/post/chinese-test/index.ja.md diff --git a/exampleSite/content/post/chinese-test/index.zh-cn.md b/demo/content/post/chinese-test/index.zh-cn.md similarity index 100% rename from exampleSite/content/post/chinese-test/index.zh-cn.md rename to demo/content/post/chinese-test/index.zh-cn.md diff --git a/exampleSite/content/post/chinese-test/index.zh-tw.md b/demo/content/post/chinese-test/index.zh-tw.md similarity index 100% rename from exampleSite/content/post/chinese-test/index.zh-tw.md rename to demo/content/post/chinese-test/index.zh-tw.md diff --git a/exampleSite/content/post/chinese-test/luca-bravo-alS7ewQ41M8-unsplash.jpg b/demo/content/post/chinese-test/luca-bravo-alS7ewQ41M8-unsplash.jpg similarity index 100% rename from exampleSite/content/post/chinese-test/luca-bravo-alS7ewQ41M8-unsplash.jpg rename to demo/content/post/chinese-test/luca-bravo-alS7ewQ41M8-unsplash.jpg diff --git a/exampleSite/content/post/emoji-support/index.md b/demo/content/post/emoji-support/index.md similarity index 100% rename from exampleSite/content/post/emoji-support/index.md rename to demo/content/post/emoji-support/index.md diff --git a/exampleSite/content/post/emoji-support/the-creative-exchange-d2zvqp3fpro-unsplash.jpg b/demo/content/post/emoji-support/the-creative-exchange-d2zvqp3fpro-unsplash.jpg similarity index 100% rename from exampleSite/content/post/emoji-support/the-creative-exchange-d2zvqp3fpro-unsplash.jpg rename to demo/content/post/emoji-support/the-creative-exchange-d2zvqp3fpro-unsplash.jpg diff --git a/exampleSite/content/post/markdown-syntax/index.md b/demo/content/post/markdown-syntax/index.md similarity index 100% rename from exampleSite/content/post/markdown-syntax/index.md rename to demo/content/post/markdown-syntax/index.md diff --git a/exampleSite/content/post/markdown-syntax/pawel-czerwinski-8uZPynIu-rQ-unsplash.jpg b/demo/content/post/markdown-syntax/pawel-czerwinski-8uZPynIu-rQ-unsplash.jpg similarity index 100% rename from exampleSite/content/post/markdown-syntax/pawel-czerwinski-8uZPynIu-rQ-unsplash.jpg rename to demo/content/post/markdown-syntax/pawel-czerwinski-8uZPynIu-rQ-unsplash.jpg diff --git a/exampleSite/content/post/math-typesetting/index.md b/demo/content/post/math-typesetting/index.md similarity index 100% rename from exampleSite/content/post/math-typesetting/index.md rename to demo/content/post/math-typesetting/index.md diff --git a/exampleSite/content/post/placeholder-text/index.ar.md b/demo/content/post/placeholder-text/index.ar.md similarity index 100% rename from exampleSite/content/post/placeholder-text/index.ar.md rename to demo/content/post/placeholder-text/index.ar.md diff --git a/exampleSite/content/post/placeholder-text/index.md b/demo/content/post/placeholder-text/index.md similarity index 100% rename from exampleSite/content/post/placeholder-text/index.md rename to demo/content/post/placeholder-text/index.md diff --git a/exampleSite/content/post/placeholder-text/matt-le-SJSpo9hQf7s-unsplash.jpg b/demo/content/post/placeholder-text/matt-le-SJSpo9hQf7s-unsplash.jpg similarity index 100% rename from exampleSite/content/post/placeholder-text/matt-le-SJSpo9hQf7s-unsplash.jpg rename to demo/content/post/placeholder-text/matt-le-SJSpo9hQf7s-unsplash.jpg diff --git a/exampleSite/content/post/rich-content/index.md b/demo/content/post/rich-content/index.md similarity index 100% rename from exampleSite/content/post/rich-content/index.md rename to demo/content/post/rich-content/index.md diff --git a/exampleSite/hugo.yaml b/demo/hugo.yaml similarity index 100% rename from exampleSite/hugo.yaml rename to demo/hugo.yaml diff --git a/demo/run.sh b/demo/run.sh new file mode 100644 index 0000000..98f6d99 --- /dev/null +++ b/demo/run.sh @@ -0,0 +1 @@ +hugo server --gc --themesDir=../.. \ No newline at end of file diff --git a/netlify.toml b/netlify.toml deleted file mode 100644 index c674fbb..0000000 --- a/netlify.toml +++ /dev/null @@ -1,26 +0,0 @@ -[build] - publish = "exampleSite/public" - -[build.environment] - HUGO_VERSION = "0.152.2" - HUGO_THEME = "repo" - -[context.production] - command = "cd exampleSite && hugo --gc --themesDir ../.. -b ${URL}" - [context.production.environment] - HUGO_ENV = "production" - -[context.branch-deploy] - command = "cd exampleSite && hugo --gc --themesDir ../.. -b ${DEPLOY_PRIME_URL}" - -[context.deploy-preview] - command = "cd exampleSite && hugo --gc --themesDir ../.. -b ${DEPLOY_PRIME_URL}" - -[[plugins]] - package = "netlify-plugin-hugo-cache-resources" - - [plugins.inputs] - # If it should show more verbose logs (optional, default = true) - debug = true - # Relative path to source directory in case you use Hugo's "--s" option - srcdir = "exampleSite" diff --git a/wrangler.toml b/wrangler.toml new file mode 100644 index 0000000..7380a04 --- /dev/null +++ b/wrangler.toml @@ -0,0 +1,9 @@ +name = "hugo-theme-stack" +compatibility_date = "2026-01-25" + +[build] +command = "chmod a+x ./.ci/build.sh && ./.ci/build.sh" + +[assets] +directory = "demo/public" +not_found_handling = "404-page" \ No newline at end of file