From 5ebc7b7ef2d37cb608087124764ab41a678f3def Mon Sep 17 00:00:00 2001 From: somrat sorkar Date: Mon, 26 Jun 2023 13:20:12 +0600 Subject: [PATCH 1/5] test workflow --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index e884a21..3f8ee33 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ "dev": "cd exampleSite; hugo server || hugo server --themesDir ../..", "test": "cd exampleSite; hugo server --disableFastRender --navigateToChanged --templateMetrics --templateMetricsHints --buildDrafts --buildExpired --buildFuture --watch --forceSyncStatic -e production --minify || hugo server --themesDir ../.. --disableFastRender --navigateToChanged --templateMetrics --templateMetricsHints --buildDrafts --buildExpired --buildFuture --watch --forceSyncStatic -e production --minify", "build": "cd exampleSite; hugo --gc --minify --templateMetrics --templateMetricsHints --buildDrafts --buildExpired --buildFuture --forceSyncStatic || hugo --themesDir ../.. --gc --minify --templateMetrics --templateMetricsHints --buildDrafts --buildExpired --buildFuture --forceSyncStatic", - "update-modules": "hugo mod clean && hugo mod get -u ./... && hugo mod tidy", + "update-modules": "hugo mod clean --all && hugo mod get -u ./... && hugo mod tidy", "format": "prettier -w .", "remove-darkmode": "node ./scripts/removeDarkmode.js && yarn format" }, From 00531e9ad90439307cba42dbcb542d3973cce5ac Mon Sep 17 00:00:00 2001 From: somrat sorkar Date: Mon, 26 Jun 2023 13:33:34 +0600 Subject: [PATCH 2/5] test workflow --- .github/workflows/hugo.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/hugo.yml b/.github/workflows/hugo.yml index 9bfa1e2..dbfb760 100644 --- a/.github/workflows/hugo.yml +++ b/.github/workflows/hugo.yml @@ -58,7 +58,7 @@ jobs: - name: Upload artifact uses: actions/upload-pages-artifact@v1 with: - path: ./public + path: ./exampleSite/public # Deployment job deploy: From da2f2c17164a17fe1d231a34086f40230d7455d5 Mon Sep 17 00:00:00 2001 From: somrat sorkar Date: Mon, 26 Jun 2023 13:50:44 +0600 Subject: [PATCH 3/5] test workflow --- .github/workflows/hugo.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/hugo.yml b/.github/workflows/hugo.yml index dbfb760..e5e0a6a 100644 --- a/.github/workflows/hugo.yml +++ b/.github/workflows/hugo.yml @@ -53,7 +53,12 @@ jobs: run: npm install - name: Publish to GitHub Pages - run: npm run build + run: | + hugo \ + --gc \ + --minify \ + --baseURL "${{ steps.pages.outputs.base_url }}/" + echo "SITE BUILT SUCCESSFULLY! LIVE AT: ${{ steps.pages.outputs.base_url }}" - name: Upload artifact uses: actions/upload-pages-artifact@v1 From aa471f8846d3bb4928a1ffe12f713900f9ac129c Mon Sep 17 00:00:00 2001 From: somrat sorkar Date: Mon, 26 Jun 2023 13:56:24 +0600 Subject: [PATCH 4/5] test workflow --- .github/workflows/hugo.yml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/workflows/hugo.yml b/.github/workflows/hugo.yml index e5e0a6a..25916ae 100644 --- a/.github/workflows/hugo.yml +++ b/.github/workflows/hugo.yml @@ -19,8 +19,8 @@ env: HUGO_VERSION: "0.114.0" GO_VERSION: "1.16.3" NODE_VERSION: "18.15.0" - TINA_CLIENT_ID: ${{ secrets.TINA_CLIENT_ID }} - TINA_TOKEN: ${{ secrets.TINA_TOKEN }} + TINA_CLIENT_ID: ${{ vars.TINA_CLIENT_ID }} + TINA_TOKEN: ${{ vars.TINA_TOKEN }} jobs: # Build job @@ -54,10 +54,9 @@ jobs: - name: Publish to GitHub Pages run: | - hugo \ - --gc \ - --minify \ - --baseURL "${{ steps.pages.outputs.base_url }}/" + cd exampleSite; \ + hugo --gc --minify --baseURL "${{ steps.pages.outputs.base_url }}/" || \ + hugo --themesDir ../.. --gc --minify --baseURL "${{ steps.pages.outputs.base_url }}/" echo "SITE BUILT SUCCESSFULLY! LIVE AT: ${{ steps.pages.outputs.base_url }}" - name: Upload artifact From 56959fd77a276140cffb4a68e02264d67b450b3b Mon Sep 17 00:00:00 2001 From: somrat sorkar Date: Mon, 26 Jun 2023 14:12:20 +0600 Subject: [PATCH 5/5] added cleanMode script and fixed github workflow --- .github/workflows/hugo.yml | 6 +---- exampleSite/go.mod | 46 +++++++++++++++++++------------------- exampleSite/package.json | 2 +- package.json | 4 ++-- scripts/cleanMod.js | 14 ++++++++++++ 5 files changed, 41 insertions(+), 31 deletions(-) create mode 100644 scripts/cleanMod.js diff --git a/.github/workflows/hugo.yml b/.github/workflows/hugo.yml index 25916ae..e8b7696 100644 --- a/.github/workflows/hugo.yml +++ b/.github/workflows/hugo.yml @@ -53,11 +53,7 @@ jobs: run: npm install - name: Publish to GitHub Pages - run: | - cd exampleSite; \ - hugo --gc --minify --baseURL "${{ steps.pages.outputs.base_url }}/" || \ - hugo --themesDir ../.. --gc --minify --baseURL "${{ steps.pages.outputs.base_url }}/" - echo "SITE BUILT SUCCESSFULLY! LIVE AT: ${{ steps.pages.outputs.base_url }}" + run: npm run build - name: Upload artifact uses: actions/upload-pages-artifact@v1 diff --git a/exampleSite/go.mod b/exampleSite/go.mod index 60d1a4e..daa6583 100644 --- a/exampleSite/go.mod +++ b/exampleSite/go.mod @@ -3,27 +3,27 @@ module hugoplate.netlify.app go 1.20 require ( - github.com/gethugothemes/hugo-modules/accordion v0.0.0-20230606070512-0887967dba40 // indirect - github.com/gethugothemes/hugo-modules/adsense v0.0.0-20230606070512-0887967dba40 // indirect - github.com/gethugothemes/hugo-modules/components/cookie-consent v0.0.0-20230606070512-0887967dba40 // indirect - github.com/gethugothemes/hugo-modules/components/custom-script v0.0.0-20230606070512-0887967dba40 // indirect - github.com/gethugothemes/hugo-modules/components/preloader v0.0.0-20230606070512-0887967dba40 // indirect - github.com/gethugothemes/hugo-modules/components/render-link v0.0.0-20230606070512-0887967dba40 // indirect - github.com/gethugothemes/hugo-modules/components/social-share v0.0.0-20230606070512-0887967dba40 // indirect - github.com/gethugothemes/hugo-modules/gallery-slider v0.0.0-20230606070512-0887967dba40 // indirect - github.com/gethugothemes/hugo-modules/gzip-caching v0.0.0-20230606070512-0887967dba40 // indirect - github.com/gethugothemes/hugo-modules/icons/font-awesome v0.0.0-20230606070512-0887967dba40 // indirect - github.com/gethugothemes/hugo-modules/images v0.0.0-20230606070512-0887967dba40 // indirect - github.com/gethugothemes/hugo-modules/modal v0.0.0-20230606070512-0887967dba40 // indirect - github.com/gethugothemes/hugo-modules/pwa v0.0.0-20230606070512-0887967dba40 // indirect - github.com/gethugothemes/hugo-modules/search v0.0.0-20230606070512-0887967dba40 // indirect - github.com/gethugothemes/hugo-modules/seo-tools/basic-seo v0.0.0-20230606070512-0887967dba40 // indirect - github.com/gethugothemes/hugo-modules/seo-tools/google-tag-manager v0.0.0-20230606070512-0887967dba40 // indirect - github.com/gethugothemes/hugo-modules/seo-tools/site-verifications v0.0.0-20230606070512-0887967dba40 // indirect - github.com/gethugothemes/hugo-modules/shortcodes/button v0.0.0-20230606070512-0887967dba40 // indirect - github.com/gethugothemes/hugo-modules/shortcodes/codepen v0.0.0-20230606070512-0887967dba40 // indirect - github.com/gethugothemes/hugo-modules/shortcodes/notice v0.0.0-20230606070512-0887967dba40 // indirect - github.com/gethugothemes/hugo-modules/tab v0.0.0-20230606070512-0887967dba40 // indirect - github.com/gethugothemes/hugo-modules/table-of-contents v0.0.0-20230606070512-0887967dba40 // indirect - github.com/gethugothemes/hugo-modules/videos v0.0.0-20230606070512-0887967dba40 // indirect + github.com/gethugothemes/hugo-modules/accordion v0.0.0-20230618103508-54805e19264d // indirect + github.com/gethugothemes/hugo-modules/adsense v0.0.0-20230618103508-54805e19264d // indirect + github.com/gethugothemes/hugo-modules/components/cookie-consent v0.0.0-20230618103508-54805e19264d // indirect + github.com/gethugothemes/hugo-modules/components/custom-script v0.0.0-20230618103508-54805e19264d // indirect + github.com/gethugothemes/hugo-modules/components/preloader v0.0.0-20230618103508-54805e19264d // indirect + github.com/gethugothemes/hugo-modules/components/render-link v0.0.0-20230618103508-54805e19264d // indirect + github.com/gethugothemes/hugo-modules/components/social-share v0.0.0-20230618103508-54805e19264d // indirect + github.com/gethugothemes/hugo-modules/gallery-slider v0.0.0-20230618103508-54805e19264d // indirect + github.com/gethugothemes/hugo-modules/gzip-caching v0.0.0-20230618103508-54805e19264d // indirect + github.com/gethugothemes/hugo-modules/icons/font-awesome v0.0.0-20230618103508-54805e19264d // indirect + github.com/gethugothemes/hugo-modules/images v0.0.0-20230618103508-54805e19264d // indirect + github.com/gethugothemes/hugo-modules/modal v0.0.0-20230618103508-54805e19264d // indirect + github.com/gethugothemes/hugo-modules/pwa v0.0.0-20230618103508-54805e19264d // indirect + github.com/gethugothemes/hugo-modules/search v0.0.0-20230618103508-54805e19264d // indirect + github.com/gethugothemes/hugo-modules/seo-tools/basic-seo v0.0.0-20230618103508-54805e19264d // indirect + github.com/gethugothemes/hugo-modules/seo-tools/google-tag-manager v0.0.0-20230618103508-54805e19264d // indirect + github.com/gethugothemes/hugo-modules/seo-tools/site-verifications v0.0.0-20230618103508-54805e19264d // indirect + github.com/gethugothemes/hugo-modules/shortcodes/button v0.0.0-20230618103508-54805e19264d // indirect + github.com/gethugothemes/hugo-modules/shortcodes/codepen v0.0.0-20230618103508-54805e19264d // indirect + github.com/gethugothemes/hugo-modules/shortcodes/notice v0.0.0-20230618103508-54805e19264d // indirect + github.com/gethugothemes/hugo-modules/tab v0.0.0-20230618103508-54805e19264d // indirect + github.com/gethugothemes/hugo-modules/table-of-contents v0.0.0-20230618103508-54805e19264d // indirect + github.com/gethugothemes/hugo-modules/videos v0.0.0-20230618103508-54805e19264d // indirect ) diff --git a/exampleSite/package.json b/exampleSite/package.json index e884a21..9a0ffbc 100644 --- a/exampleSite/package.json +++ b/exampleSite/package.json @@ -8,7 +8,7 @@ "dev": "cd exampleSite; hugo server || hugo server --themesDir ../..", "test": "cd exampleSite; hugo server --disableFastRender --navigateToChanged --templateMetrics --templateMetricsHints --buildDrafts --buildExpired --buildFuture --watch --forceSyncStatic -e production --minify || hugo server --themesDir ../.. --disableFastRender --navigateToChanged --templateMetrics --templateMetricsHints --buildDrafts --buildExpired --buildFuture --watch --forceSyncStatic -e production --minify", "build": "cd exampleSite; hugo --gc --minify --templateMetrics --templateMetricsHints --buildDrafts --buildExpired --buildFuture --forceSyncStatic || hugo --themesDir ../.. --gc --minify --templateMetrics --templateMetricsHints --buildDrafts --buildExpired --buildFuture --forceSyncStatic", - "update-modules": "hugo mod clean && hugo mod get -u ./... && hugo mod tidy", + "update-modules": "node ./scripts/cleanMod.js && hugo mod clean --all && hugo mod get -u ./... && hugo mod tidy", "format": "prettier -w .", "remove-darkmode": "node ./scripts/removeDarkmode.js && yarn format" }, diff --git a/package.json b/package.json index 3f8ee33..1b677f2 100644 --- a/package.json +++ b/package.json @@ -1,14 +1,14 @@ { "name": "hugoplate", "description": "hugo tailwindcss boilerplate", - "version": "1.1.1", + "version": "1.1.2", "license": "MIT", "author": "zeon.studio", "scripts": { "dev": "cd exampleSite; hugo server || hugo server --themesDir ../..", "test": "cd exampleSite; hugo server --disableFastRender --navigateToChanged --templateMetrics --templateMetricsHints --buildDrafts --buildExpired --buildFuture --watch --forceSyncStatic -e production --minify || hugo server --themesDir ../.. --disableFastRender --navigateToChanged --templateMetrics --templateMetricsHints --buildDrafts --buildExpired --buildFuture --watch --forceSyncStatic -e production --minify", "build": "cd exampleSite; hugo --gc --minify --templateMetrics --templateMetricsHints --buildDrafts --buildExpired --buildFuture --forceSyncStatic || hugo --themesDir ../.. --gc --minify --templateMetrics --templateMetricsHints --buildDrafts --buildExpired --buildFuture --forceSyncStatic", - "update-modules": "hugo mod clean --all && hugo mod get -u ./... && hugo mod tidy", + "update-modules": "node ./scripts/cleanMod.js && hugo mod clean --all && hugo mod get -u ./... && hugo mod tidy", "format": "prettier -w .", "remove-darkmode": "node ./scripts/removeDarkmode.js && yarn format" }, diff --git a/scripts/cleanMod.js b/scripts/cleanMod.js new file mode 100644 index 0000000..205ed9c --- /dev/null +++ b/scripts/cleanMod.js @@ -0,0 +1,14 @@ +const fs = require("fs"); + +const clearMode = (filePath) => { + if (fs.existsSync(filePath)) { + let fileContent = fs.readFileSync(filePath, "utf8"); + fileContent = fileContent.replace(/require\s*\([\s\S]*?\)/, ""); + fs.writeFileSync(filePath, fileContent, "utf8"); + } else { + console.log("File does not exist."); + } +}; + +clearMode("go.mod"); +clearMode("exampleSite/go.mod");