From 77bc7eef2df78841d63605eb974d57f034d0c374 Mon Sep 17 00:00:00 2001 From: somrat sorkar Date: Sat, 2 Sep 2023 09:40:53 +0600 Subject: [PATCH] remove cusom hugo_stats decoder, fixed theme.json update auto reload --- .github/workflows/main.yml | 2 +- .gitignore | 1 - .gitlab-ci.yml | 2 +- amplify.yml | 8 ++++---- exampleSite/go.mod | 1 - exampleSite/hugo.toml | 3 +++ exampleSite/tailwind.config.js | 21 +-------------------- netlify.toml | 2 +- package.json | 8 ++++---- readme.md | 4 ++-- theme.toml | 2 +- vercel-build.sh | 2 +- 12 files changed, 19 insertions(+), 37 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 155bf0d..c10c7fe 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -15,7 +15,7 @@ permissions: # Environment variables available to all jobs and steps in this workflow env: HUGO_ENV: production - HUGO_VERSION: "0.115.4" + HUGO_VERSION: "0.118.2" GO_VERSION: "1.20.5" NODE_VERSION: "18.15.0" TINA_CLIENT_ID: ${{ vars.TINA_CLIENT_ID }} diff --git a/.gitignore b/.gitignore index 3d9a473..0c14a96 100755 --- a/.gitignore +++ b/.gitignore @@ -13,6 +13,5 @@ resources .hugo_build.lock jsconfig.json hugo_stats.json -hugo_stats_decoded.json go.sum yarn.lock \ No newline at end of file diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index dfb1456..047204d 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -3,7 +3,7 @@ stages: variables: HUGO_ENV: production - HUGO_VERSION: "0.115.4" + HUGO_VERSION: "0.118.2" GO_VERSION: "1.20.5" NODE_VERSION: "18.16.1" diff --git a/amplify.yml b/amplify.yml index d6498c9..67b79ec 100644 --- a/amplify.yml +++ b/amplify.yml @@ -4,11 +4,11 @@ frontend: preBuild: commands: - yum install -y curl - - curl -LO "https://github.com/gohugoio/hugo/releases/download/v0.115.4/hugo_extended_0.115.4_Linux-64bit.tar.gz" - - tar -xvf hugo_extended_0.115.4_Linux-64bit.tar.gz + - curl -LO "https://github.com/gohugoio/hugo/releases/download/v0.118.2/hugo_extended_0.118.2_Linux-64bit.tar.gz" + - tar -xvf hugo_extended_0.118.2_Linux-64bit.tar.gz - mv hugo /usr/local/bin/ - - rm hugo_extended_0.115.4_Linux-64bit.tar.gz - - echo "HUGO 0.115.4 INSTALLED" + - rm hugo_extended_0.118.2_Linux-64bit.tar.gz + - echo "HUGO 0.118.2 INSTALLED" - curl -LO "https://dl.google.com/go/go1.20.5.linux-amd64.tar.gz" - tar -C /usr/local -xzf go1.20.5.linux-amd64.tar.gz - export PATH=$PATH:/usr/local/go/bin diff --git a/exampleSite/go.mod b/exampleSite/go.mod index 9f7ff4d..ec05b97 100644 --- a/exampleSite/go.mod +++ b/exampleSite/go.mod @@ -25,5 +25,4 @@ require ( github.com/gethugothemes/hugo-modules/tab v0.0.0-20230823074046-d7ebb75df8b9 // indirect github.com/gethugothemes/hugo-modules/table-of-contents v0.0.0-20230823074046-d7ebb75df8b9 // indirect github.com/gethugothemes/hugo-modules/videos v0.0.0-20230823074046-d7ebb75df8b9 // indirect - github.com/zeon-studio/hugoplate v0.0.0-20230820074946-34cb72d4ce47 // indirect ) diff --git a/exampleSite/hugo.toml b/exampleSite/hugo.toml index fca378e..973f054 100755 --- a/exampleSite/hugo.toml +++ b/exampleSite/hugo.toml @@ -55,6 +55,9 @@ target = 'js' source = 'assets/.*\.(css|scss|sass)' target = 'css' [[build.cachebusters]] +source = 'data/.*\.(.*)$' +target = 'css' +[[build.cachebusters]] source = 'assets/.*\.(.*)$' target = '$1' diff --git a/exampleSite/tailwind.config.js b/exampleSite/tailwind.config.js index 9c9f279..1990541 100755 --- a/exampleSite/tailwind.config.js +++ b/exampleSite/tailwind.config.js @@ -3,25 +3,6 @@ const path = require("path"); const themePath = path.join(__dirname, "data/theme.json"); const themeRead = fs.readFileSync(themePath, "utf8"); const theme = JSON.parse(themeRead); -const hugoStatsPath = path.join(__dirname, "hugo_stats.json"); -const hugoStatsRead = fs.readFileSync(hugoStatsPath, "utf8"); - -// Function to decode Unicode escape sequences -function decodeUnicode(json) { - return JSON.parse(json, (key, value) => { - if (typeof value === "string") { - return value.replace(/\\u[\dA-Fa-f]{4}/g, (match) => { - return String.fromCharCode(parseInt(match.slice(2), 16)); - }); - } - return value; - }); -} - -fs.writeFileSync( - "hugo_stats_decoded.json", - JSON.stringify(decodeUnicode(hugoStatsRead), null, 2), -); let font_base = Number(theme.fonts.font_size.base.replace("px", "")); let font_scale = Number(theme.fonts.font_size.scale); @@ -47,7 +28,7 @@ if (theme.fonts.font_family.secondary) { /** @type {import('tailwindcss').Config} */ module.exports = { - content: ["./hugo_stats_decoded.json"], + content: ["./hugo_stats.json"], safelist: [{ pattern: /^swiper-/ }], darkMode: "class", theme: { diff --git a/netlify.toml b/netlify.toml index 94087fb..d659856 100755 --- a/netlify.toml +++ b/netlify.toml @@ -3,5 +3,5 @@ publish = "public" command = "yarn project-setup; yarn build" [build.environment] -HUGO_VERSION = "0.115.4" +HUGO_VERSION = "0.118.2" GO_VERSION = "1.20.5" diff --git a/package.json b/package.json index f7d797b..faa027d 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "hugoplate", "description": "hugo tailwindcss boilerplate", - "version": "1.7.5", + "version": "1.7.6", "license": "MIT", "author": "zeon.studio", "scripts": { @@ -22,11 +22,11 @@ "@tailwindcss/forms": "^0.5.6", "@tailwindcss/typography": "^0.5.9", "autoprefixer": "^10.4.15", - "postcss": "^8.4.28", + "postcss": "^8.4.29", "postcss-cli": "^10.1.0", - "prettier": "^3.0.2", + "prettier": "^3.0.3", "prettier-plugin-go-template": "0.0.15", - "prettier-plugin-tailwindcss": "^0.5.3", + "prettier-plugin-tailwindcss": "^0.5.4", "tailwind-bootstrap-grid": "^5.0.1", "tailwindcss": "^3.3.3" } diff --git a/readme.md b/readme.md index 4114cfb..c191dd3 100755 --- a/readme.md +++ b/readme.md @@ -9,8 +9,8 @@

- - + + diff --git a/theme.toml b/theme.toml index b0a70ba..6e9398c 100644 --- a/theme.toml +++ b/theme.toml @@ -4,7 +4,7 @@ licenselink = "https://github.com/zeon-studio/hugoplate/blob/main/LICENSE" description = "Hugoplate is a free starter template built with Hugo, and TailwindCSS, providing everything you need to jumpstart your Hugo project and save valuable time." homepage = "https://github.com/zeon-studio/hugoplate" demosite = "https://hugoplate.netlify.app/" -min_version = "0.115.4" +min_version = "0.118.2" tags = [ "blog", diff --git a/vercel-build.sh b/vercel-build.sh index e53ba96..17138f0 100755 --- a/vercel-build.sh +++ b/vercel-build.sh @@ -3,7 +3,7 @@ # default versions NODE_VERSION='18.16.1'; GO_VERSION='1.20.5'; -HUGO_VERSION='0.115.4'; +HUGO_VERSION='0.118.2'; # install Node.js # echo "Installing Node.js $NODE_VERSION..."