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");