From 8fde71d68e477a837add6a62a25dd9ff5c3d29f9 Mon Sep 17 00:00:00 2001 From: Somrat <58769763+tfsomrat@users.noreply.github.com> Date: Wed, 27 Nov 2024 09:36:34 +0600 Subject: [PATCH] update hugo modules and packages, and minimum hugo version required --- .github/workflows/main.yml | 4 +-- .gitlab-ci.yml | 4 +-- amplify.yml | 16 ++++----- exampleSite/config/_default/module.toml | 2 +- exampleSite/go.mod | 47 ++++++++++++------------- netlify.toml | 4 +-- package.json | 4 +-- scripts/projectSetup.js | 36 +++++++++---------- scripts/themeSetup.js | 16 ++++----- theme.toml | 2 +- vercel-build.sh | 4 +-- 11 files changed, 69 insertions(+), 70 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index ad1a3e9..be1c0be 100755 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -15,8 +15,8 @@ permissions: # Environment variables available to all jobs and steps in this workflow env: HUGO_ENV: production - HUGO_VERSION: "0.134.3" - GO_VERSION: "1.22.2" + HUGO_VERSION: "0.139.2" + GO_VERSION: "1.23.3" NODE_VERSION: "20.0.0" TINA_CLIENT_ID: ${{ vars.TINA_CLIENT_ID }} TINA_TOKEN: ${{ vars.TINA_TOKEN }} diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 52ed5dd..54391f7 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -3,8 +3,8 @@ stages: variables: HUGO_ENV: production - HUGO_VERSION: "0.134.3" - GO_VERSION: "1.22.2" + HUGO_VERSION: "0.139.2" + GO_VERSION: "1.23.3" NODE_VERSION: "18.16.1" cache: diff --git a/amplify.yml b/amplify.yml index ce755f7..7e6ba7a 100644 --- a/amplify.yml +++ b/amplify.yml @@ -4,16 +4,16 @@ frontend: preBuild: commands: - yum install -y curl - - curl -LO "https://github.com/gohugoio/hugo/releases/download/v0.134.3/hugo_extended_0.134.3_Linux-64bit.tar.gz" - - tar -xvf hugo_extended_0.134.3_Linux-64bit.tar.gz + - curl -LO "https://github.com/gohugoio/hugo/releases/download/v0.139.2/hugo_extended_0.139.2_Linux-64bit.tar.gz" + - tar -xvf hugo_extended_0.139.2_Linux-64bit.tar.gz - mv hugo /usr/local/bin/ - - rm hugo_extended_0.134.3_Linux-64bit.tar.gz - - echo "HUGO 0.134.3 INSTALLED" - - curl -LO "https://dl.google.com/go/go1.22.2.linux-amd64.tar.gz" - - tar -C /usr/local -xzf go1.22.2.linux-amd64.tar.gz + - rm hugo_extended_0.139.2_Linux-64bit.tar.gz + - echo "HUGO 0.139.2 INSTALLED" + - curl -LO "https://dl.google.com/go/go1.23.3.linux-amd64.tar.gz" + - tar -C /usr/local -xzf go1.23.3.linux-amd64.tar.gz - export PATH=$PATH:/usr/local/go/bin - - rm go1.22.2.linux-amd64.tar.gz - - echo "GO 1.22.2 INSTALLED" + - rm go1.23.3.linux-amd64.tar.gz + - echo "GO 1.23.3 INSTALLED" - npm install build: commands: diff --git a/exampleSite/config/_default/module.toml b/exampleSite/config/_default/module.toml index 6d31a75..3956055 100644 --- a/exampleSite/config/_default/module.toml +++ b/exampleSite/config/_default/module.toml @@ -1,6 +1,6 @@ [hugoVersion] extended = true -min = "0.134.3" +min = "0.139.2" [[imports]] path = "github.com/zeon-studio/hugoplate" diff --git a/exampleSite/go.mod b/exampleSite/go.mod index 85e38cf..6df46db 100644 --- a/exampleSite/go.mod +++ b/exampleSite/go.mod @@ -3,29 +3,28 @@ module hugoplate.netlify.app go 1.21 require ( - github.com/gethugothemes/hugo-modules/accordion v0.0.0-20240925042433-d2b5d05977e8 // indirect - github.com/gethugothemes/hugo-modules/adsense v0.0.0-20240925042433-d2b5d05977e8 // indirect - github.com/gethugothemes/hugo-modules/components/announcement v0.0.0-20240925042433-d2b5d05977e8 // indirect - github.com/gethugothemes/hugo-modules/components/cookie-consent v0.0.0-20240925042433-d2b5d05977e8 // indirect - github.com/gethugothemes/hugo-modules/components/custom-script v0.0.0-20240925042433-d2b5d05977e8 // indirect - github.com/gethugothemes/hugo-modules/components/preloader v0.0.0-20240925042433-d2b5d05977e8 // indirect - github.com/gethugothemes/hugo-modules/components/render-link v0.0.0-20240925042433-d2b5d05977e8 // indirect - github.com/gethugothemes/hugo-modules/components/social-share v0.0.0-20240925042433-d2b5d05977e8 // indirect - github.com/gethugothemes/hugo-modules/gallery-slider v0.0.0-20240925042433-d2b5d05977e8 // indirect - github.com/gethugothemes/hugo-modules/gzip-caching v0.0.0-20240925042433-d2b5d05977e8 // indirect - github.com/gethugothemes/hugo-modules/icons/font-awesome v0.0.0-20240925042433-d2b5d05977e8 // indirect - github.com/gethugothemes/hugo-modules/images v0.0.0-20240925042433-d2b5d05977e8 // indirect - github.com/gethugothemes/hugo-modules/modal v0.0.0-20240925042433-d2b5d05977e8 // indirect - github.com/gethugothemes/hugo-modules/pwa v0.0.0-20240925042433-d2b5d05977e8 // indirect - github.com/gethugothemes/hugo-modules/search v0.0.0-20240925042433-d2b5d05977e8 // indirect - github.com/gethugothemes/hugo-modules/seo-tools/basic-seo v0.0.0-20240925042433-d2b5d05977e8 // indirect - github.com/gethugothemes/hugo-modules/seo-tools/google-tag-manager v0.0.0-20240925042433-d2b5d05977e8 // indirect - github.com/gethugothemes/hugo-modules/seo-tools/site-verifications v0.0.0-20240925042433-d2b5d05977e8 // indirect - github.com/gethugothemes/hugo-modules/shortcodes/button v0.0.0-20240925042433-d2b5d05977e8 // indirect - github.com/gethugothemes/hugo-modules/shortcodes/notice v0.0.0-20240925042433-d2b5d05977e8 // indirect - github.com/gethugothemes/hugo-modules/tab v0.0.0-20240925042433-d2b5d05977e8 // indirect - github.com/gethugothemes/hugo-modules/table-of-contents v0.0.0-20240925042433-d2b5d05977e8 // indirect - github.com/gethugothemes/hugo-modules/videos v0.0.0-20240925042433-d2b5d05977e8 // indirect + github.com/gethugothemes/hugo-modules/accordion v0.0.0-20241123034247-ea3817d07c63 // indirect + github.com/gethugothemes/hugo-modules/adsense v0.0.0-20241123034247-ea3817d07c63 // indirect + github.com/gethugothemes/hugo-modules/components/announcement v0.0.0-20241123034247-ea3817d07c63 // indirect + github.com/gethugothemes/hugo-modules/components/cookie-consent v0.0.0-20241123034247-ea3817d07c63 // indirect + github.com/gethugothemes/hugo-modules/components/custom-script v0.0.0-20241123034247-ea3817d07c63 // indirect + github.com/gethugothemes/hugo-modules/components/preloader v0.0.0-20241123034247-ea3817d07c63 // indirect + github.com/gethugothemes/hugo-modules/components/render-link v0.0.0-20241123034247-ea3817d07c63 // indirect + github.com/gethugothemes/hugo-modules/components/social-share v0.0.0-20241123034247-ea3817d07c63 // indirect + github.com/gethugothemes/hugo-modules/gallery-slider v0.0.0-20241123034247-ea3817d07c63 // indirect + github.com/gethugothemes/hugo-modules/gzip-caching v0.0.0-20241123034247-ea3817d07c63 // indirect + github.com/gethugothemes/hugo-modules/icons/font-awesome v0.0.0-20241123034247-ea3817d07c63 // indirect + github.com/gethugothemes/hugo-modules/images v0.0.0-20241123034247-ea3817d07c63 // indirect + github.com/gethugothemes/hugo-modules/modal v0.0.0-20241123034247-ea3817d07c63 // indirect + github.com/gethugothemes/hugo-modules/pwa v0.0.0-20241123034247-ea3817d07c63 // indirect + github.com/gethugothemes/hugo-modules/search v0.0.0-20241123034247-ea3817d07c63 // indirect + github.com/gethugothemes/hugo-modules/seo-tools/basic-seo v0.0.0-20241123034247-ea3817d07c63 // indirect + github.com/gethugothemes/hugo-modules/seo-tools/google-tag-manager v0.0.0-20241123034247-ea3817d07c63 // indirect + github.com/gethugothemes/hugo-modules/seo-tools/site-verifications v0.0.0-20241123034247-ea3817d07c63 // indirect + github.com/gethugothemes/hugo-modules/shortcodes/button v0.0.0-20241123034247-ea3817d07c63 // indirect + github.com/gethugothemes/hugo-modules/shortcodes/notice v0.0.0-20241123034247-ea3817d07c63 // indirect + github.com/gethugothemes/hugo-modules/tab v0.0.0-20241123034247-ea3817d07c63 // indirect + github.com/gethugothemes/hugo-modules/table-of-contents v0.0.0-20241123034247-ea3817d07c63 // indirect + github.com/gethugothemes/hugo-modules/videos v0.0.0-20241123034247-ea3817d07c63 // indirect github.com/hugomods/mermaid v0.1.4 // indirect - github.com/zeon-studio/hugoplate v0.0.0-20240925044951-fe74d0e62893 // indirect ) diff --git a/netlify.toml b/netlify.toml index 946c510..c660aea 100755 --- a/netlify.toml +++ b/netlify.toml @@ -3,5 +3,5 @@ publish = "public" command = "yarn project-setup; yarn build" [build.environment] -HUGO_VERSION = "0.134.3" -GO_VERSION = "1.22.2" +HUGO_VERSION = "0.139.2" +GO_VERSION = "1.23.3" diff --git a/package.json b/package.json index 9310276..6579d58 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "hugoplate", "description": "hugo tailwindcss boilerplate", - "version": "1.17.1", + "version": "1.17.2", "license": "MIT", "author": "zeon.studio", "scripts": { @@ -24,7 +24,7 @@ "autoprefixer": "^10.4.20", "postcss": "^8.4.49", "postcss-cli": "^11.0.0", - "prettier": "^3.3.3", + "prettier": "^3.4.1", "prettier-plugin-go-template": "0.0.15", "prettier-plugin-tailwindcss": "^0.6.9", "tailwind-bootstrap-grid": "^5.1.0", diff --git a/scripts/projectSetup.js b/scripts/projectSetup.js index 3ab7306..5b92703 100644 --- a/scripts/projectSetup.js +++ b/scripts/projectSetup.js @@ -15,8 +15,8 @@ const toggleComment = ({ filepath, regex }) => { ); fs.writeFileSync(filepath, updatedContent, "utf8"); } else { - const hasBreakline = matchedContent.includes("\n"); - if (hasBreakline) { + const hasLineBreak = matchedContent.includes("\n"); + if (hasLineBreak) { const content = matchedContent .split("\n") .map((line) => "# " + line) @@ -28,8 +28,8 @@ const toggleComment = ({ filepath, regex }) => { } }; -const getFolderName = (rootfolder) => { - const configPath = path.join(rootfolder, "exampleSite/hugo.toml"); +const getFolderName = (rootFolder) => { + const configPath = path.join(rootFolder, "exampleSite/hugo.toml"); const getConfig = fs.readFileSync(configPath, "utf8"); const match = getConfig.match(/theme\s*=\s*\[?"([^"\]]+)"\]?/); let selectedTheme = null; @@ -45,8 +45,8 @@ const deleteFolder = (folderPath) => { } }; -const createNewfolder = (rootfolder, folderName) => { - const newFolder = path.join(rootfolder, folderName); +const createNewFolder = (rootFolder, folderName) => { + const newFolder = path.join(rootFolder, folderName); fs.mkdirSync(newFolder, { recursive: true }); return newFolder; }; @@ -56,7 +56,7 @@ const iterateFilesAndFolders = (rootFolder, { destinationRoot }) => { const items = fs.readdirSync(directory, { withFileTypes: true }); items.forEach((item) => { if (item.isDirectory()) { - createNewfolder(destinationRoot, item.name); + createNewFolder(destinationRoot, item.name); iterateFilesAndFolders(path.join(directory, item.name), { currentFolder: item.name, destinationRoot: path.join(destinationRoot, item.name), @@ -70,17 +70,17 @@ const iterateFilesAndFolders = (rootFolder, { destinationRoot }) => { }; const setupProject = () => { - const rootfolder = path.join(__dirname, "../"); - if (!fs.existsSync(path.join(rootfolder, "themes"))) { + const rootFolder = path.join(__dirname, "../"); + if (!fs.existsSync(path.join(rootFolder, "themes"))) { // remove this part if you don't using theme demo as a module [ { - filepath: path.join(rootfolder, "exampleSite/hugo.toml"), + filepath: path.join(rootFolder, "exampleSite/hugo.toml"), regex: /^.*theme\s*=\s*("[^"\]]+"|\S+)/m, }, { filepath: path.join( - rootfolder, + rootFolder, "exampleSite/config/_default/module.toml", ), regex: /\[\[imports\]\]\s*\r?\npath = "([^"]+)"/, @@ -88,15 +88,15 @@ const setupProject = () => { ].forEach(toggleComment); const folderList = ["layouts", "assets", "static"]; - const folderName = getFolderName(rootfolder); - const newfolderName = createNewfolder( - path.join(rootfolder, "themes"), + const folderName = getFolderName(rootFolder); + const newFolderName = createNewFolder( + path.join(rootFolder, "themes"), folderName, ); folderList.forEach((folder) => { - const source = path.join(rootfolder, folder); - const destination = path.join(newfolderName, folder); + const source = path.join(rootFolder, folder); + const destination = path.join(newFolderName, folder); if (fs.existsSync(source)) { fs.mkdirSync(destination, { recursive: true }); iterateFilesAndFolders(source, { @@ -107,8 +107,8 @@ const setupProject = () => { } }); - const exampleSite = path.join(rootfolder, "exampleSite"); - iterateFilesAndFolders(exampleSite, { destinationRoot: rootfolder }); + const exampleSite = path.join(rootFolder, "exampleSite"); + iterateFilesAndFolders(exampleSite, { destinationRoot: rootFolder }); deleteFolder(exampleSite); } }; diff --git a/scripts/themeSetup.js b/scripts/themeSetup.js index 0d21aad..28a697a 100644 --- a/scripts/themeSetup.js +++ b/scripts/themeSetup.js @@ -9,8 +9,8 @@ const toggleComment = ({ filepath, regex }) => { const matchedContent = match[0]; const hasComment = matchedContent.startsWith("# "); if (hasComment) { - const hasBreakline = matchedContent.includes("\n"); - if (hasBreakline) { + const hasLineBreak = matchedContent.includes("\n"); + if (hasLineBreak) { updatedContent = updatedContent.replace( regex, matchedContent.replace(/# /gm, ""), @@ -24,8 +24,8 @@ const toggleComment = ({ filepath, regex }) => { } }; -const createNewfolder = (rootfolder, folderName) => { - const newFolder = path.join(rootfolder, folderName); +const createNewFolder = (rootFolder, folderName) => { + const newFolder = path.join(rootFolder, folderName); fs.mkdirSync(newFolder, { recursive: true }); return newFolder; }; @@ -36,8 +36,8 @@ const deleteFolder = (folderPath) => { } }; -const getFolderName = (rootfolder) => { - const configPath = path.join(rootfolder, "exampleSite/hugo.toml"); +const getFolderName = (rootFolder) => { + const configPath = path.join(rootFolder, "exampleSite/hugo.toml"); const getConfig = fs.readFileSync(configPath, "utf8"); const match = getConfig.match(/theme\s*=\s*\[?"([^"\]]+)"\]?/); let selectedTheme = null; @@ -52,7 +52,7 @@ const iterateFilesAndFolders = (rootFolder, { destinationRoot }) => { const items = fs.readdirSync(directory, { withFileTypes: true }); items.forEach((item) => { if (item.isDirectory()) { - createNewfolder(destinationRoot, item.name); + createNewFolder(destinationRoot, item.name); iterateFilesAndFolders(path.join(directory, item.name), { currentFolder: item.name, destinationRoot: path.join(destinationRoot, item.name), @@ -94,7 +94,7 @@ const setupTheme = () => { "static", ]; - const folder = createNewfolder(rootFolder, "exampleSite"); + const folder = createNewFolder(rootFolder, "exampleSite"); fs.readdirSync(rootFolder, { withFileTypes: true }).forEach((file) => { if (includesFiles.includes(file.name)) { diff --git a/theme.toml b/theme.toml index c68b573..332383c 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://zeon.studio/preview?project=hugoplate" -min_version = "0.134.3" +min_version = "0.139.2" tags = [ "blog", diff --git a/vercel-build.sh b/vercel-build.sh index 0b9461f..03a070d 100755 --- a/vercel-build.sh +++ b/vercel-build.sh @@ -2,8 +2,8 @@ # default versions NODE_VERSION='18.16.1'; -GO_VERSION='1.22.2'; -HUGO_VERSION='0.134.3'; +GO_VERSION='1.23.3'; +HUGO_VERSION='0.139.2'; # install Node.js # echo "Installing Node.js $NODE_VERSION..."