update hugo modules and packages, and minimum hugo version required

This commit is contained in:
Somrat 2024-11-27 09:36:34 +06:00
parent b5c6d3aa76
commit 8fde71d68e
11 changed files with 69 additions and 70 deletions

View File

@ -15,8 +15,8 @@ permissions:
# Environment variables available to all jobs and steps in this workflow # Environment variables available to all jobs and steps in this workflow
env: env:
HUGO_ENV: production HUGO_ENV: production
HUGO_VERSION: "0.134.3" HUGO_VERSION: "0.139.2"
GO_VERSION: "1.22.2" GO_VERSION: "1.23.3"
NODE_VERSION: "20.0.0" NODE_VERSION: "20.0.0"
TINA_CLIENT_ID: ${{ vars.TINA_CLIENT_ID }} TINA_CLIENT_ID: ${{ vars.TINA_CLIENT_ID }}
TINA_TOKEN: ${{ vars.TINA_TOKEN }} TINA_TOKEN: ${{ vars.TINA_TOKEN }}

View File

@ -3,8 +3,8 @@ stages:
variables: variables:
HUGO_ENV: production HUGO_ENV: production
HUGO_VERSION: "0.134.3" HUGO_VERSION: "0.139.2"
GO_VERSION: "1.22.2" GO_VERSION: "1.23.3"
NODE_VERSION: "18.16.1" NODE_VERSION: "18.16.1"
cache: cache:

View File

@ -4,16 +4,16 @@ frontend:
preBuild: preBuild:
commands: commands:
- yum install -y curl - 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" - 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.134.3_Linux-64bit.tar.gz - tar -xvf hugo_extended_0.139.2_Linux-64bit.tar.gz
- mv hugo /usr/local/bin/ - mv hugo /usr/local/bin/
- rm hugo_extended_0.134.3_Linux-64bit.tar.gz - rm hugo_extended_0.139.2_Linux-64bit.tar.gz
- echo "HUGO 0.134.3 INSTALLED" - echo "HUGO 0.139.2 INSTALLED"
- curl -LO "https://dl.google.com/go/go1.22.2.linux-amd64.tar.gz" - curl -LO "https://dl.google.com/go/go1.23.3.linux-amd64.tar.gz"
- tar -C /usr/local -xzf go1.22.2.linux-amd64.tar.gz - tar -C /usr/local -xzf go1.23.3.linux-amd64.tar.gz
- export PATH=$PATH:/usr/local/go/bin - export PATH=$PATH:/usr/local/go/bin
- rm go1.22.2.linux-amd64.tar.gz - rm go1.23.3.linux-amd64.tar.gz
- echo "GO 1.22.2 INSTALLED" - echo "GO 1.23.3 INSTALLED"
- npm install - npm install
build: build:
commands: commands:

View File

@ -1,6 +1,6 @@
[hugoVersion] [hugoVersion]
extended = true extended = true
min = "0.134.3" min = "0.139.2"
[[imports]] [[imports]]
path = "github.com/zeon-studio/hugoplate" path = "github.com/zeon-studio/hugoplate"

View File

@ -3,29 +3,28 @@ module hugoplate.netlify.app
go 1.21 go 1.21
require ( require (
github.com/gethugothemes/hugo-modules/accordion 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-20240925042433-d2b5d05977e8 // indirect github.com/gethugothemes/hugo-modules/adsense v0.0.0-20241123034247-ea3817d07c63 // indirect
github.com/gethugothemes/hugo-modules/components/announcement v0.0.0-20240925042433-d2b5d05977e8 // 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-20240925042433-d2b5d05977e8 // 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-20240925042433-d2b5d05977e8 // 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-20240925042433-d2b5d05977e8 // 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-20240925042433-d2b5d05977e8 // 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-20240925042433-d2b5d05977e8 // 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-20240925042433-d2b5d05977e8 // indirect github.com/gethugothemes/hugo-modules/gallery-slider v0.0.0-20241123034247-ea3817d07c63 // indirect
github.com/gethugothemes/hugo-modules/gzip-caching v0.0.0-20240925042433-d2b5d05977e8 // 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-20240925042433-d2b5d05977e8 // indirect github.com/gethugothemes/hugo-modules/icons/font-awesome v0.0.0-20241123034247-ea3817d07c63 // indirect
github.com/gethugothemes/hugo-modules/images v0.0.0-20240925042433-d2b5d05977e8 // indirect github.com/gethugothemes/hugo-modules/images v0.0.0-20241123034247-ea3817d07c63 // indirect
github.com/gethugothemes/hugo-modules/modal v0.0.0-20240925042433-d2b5d05977e8 // indirect github.com/gethugothemes/hugo-modules/modal v0.0.0-20241123034247-ea3817d07c63 // indirect
github.com/gethugothemes/hugo-modules/pwa v0.0.0-20240925042433-d2b5d05977e8 // indirect github.com/gethugothemes/hugo-modules/pwa v0.0.0-20241123034247-ea3817d07c63 // indirect
github.com/gethugothemes/hugo-modules/search v0.0.0-20240925042433-d2b5d05977e8 // 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-20240925042433-d2b5d05977e8 // 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-20240925042433-d2b5d05977e8 // 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-20240925042433-d2b5d05977e8 // 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-20240925042433-d2b5d05977e8 // indirect github.com/gethugothemes/hugo-modules/shortcodes/button v0.0.0-20241123034247-ea3817d07c63 // indirect
github.com/gethugothemes/hugo-modules/shortcodes/notice v0.0.0-20240925042433-d2b5d05977e8 // indirect github.com/gethugothemes/hugo-modules/shortcodes/notice v0.0.0-20241123034247-ea3817d07c63 // indirect
github.com/gethugothemes/hugo-modules/tab v0.0.0-20240925042433-d2b5d05977e8 // indirect github.com/gethugothemes/hugo-modules/tab v0.0.0-20241123034247-ea3817d07c63 // indirect
github.com/gethugothemes/hugo-modules/table-of-contents v0.0.0-20240925042433-d2b5d05977e8 // indirect github.com/gethugothemes/hugo-modules/table-of-contents v0.0.0-20241123034247-ea3817d07c63 // indirect
github.com/gethugothemes/hugo-modules/videos v0.0.0-20240925042433-d2b5d05977e8 // indirect github.com/gethugothemes/hugo-modules/videos v0.0.0-20241123034247-ea3817d07c63 // indirect
github.com/hugomods/mermaid v0.1.4 // indirect github.com/hugomods/mermaid v0.1.4 // indirect
github.com/zeon-studio/hugoplate v0.0.0-20240925044951-fe74d0e62893 // indirect
) )

View File

@ -3,5 +3,5 @@ publish = "public"
command = "yarn project-setup; yarn build" command = "yarn project-setup; yarn build"
[build.environment] [build.environment]
HUGO_VERSION = "0.134.3" HUGO_VERSION = "0.139.2"
GO_VERSION = "1.22.2" GO_VERSION = "1.23.3"

View File

@ -1,7 +1,7 @@
{ {
"name": "hugoplate", "name": "hugoplate",
"description": "hugo tailwindcss boilerplate", "description": "hugo tailwindcss boilerplate",
"version": "1.17.1", "version": "1.17.2",
"license": "MIT", "license": "MIT",
"author": "zeon.studio", "author": "zeon.studio",
"scripts": { "scripts": {
@ -24,7 +24,7 @@
"autoprefixer": "^10.4.20", "autoprefixer": "^10.4.20",
"postcss": "^8.4.49", "postcss": "^8.4.49",
"postcss-cli": "^11.0.0", "postcss-cli": "^11.0.0",
"prettier": "^3.3.3", "prettier": "^3.4.1",
"prettier-plugin-go-template": "0.0.15", "prettier-plugin-go-template": "0.0.15",
"prettier-plugin-tailwindcss": "^0.6.9", "prettier-plugin-tailwindcss": "^0.6.9",
"tailwind-bootstrap-grid": "^5.1.0", "tailwind-bootstrap-grid": "^5.1.0",

View File

@ -15,8 +15,8 @@ const toggleComment = ({ filepath, regex }) => {
); );
fs.writeFileSync(filepath, updatedContent, "utf8"); fs.writeFileSync(filepath, updatedContent, "utf8");
} else { } else {
const hasBreakline = matchedContent.includes("\n"); const hasLineBreak = matchedContent.includes("\n");
if (hasBreakline) { if (hasLineBreak) {
const content = matchedContent const content = matchedContent
.split("\n") .split("\n")
.map((line) => "# " + line) .map((line) => "# " + line)
@ -28,8 +28,8 @@ const toggleComment = ({ filepath, regex }) => {
} }
}; };
const getFolderName = (rootfolder) => { const getFolderName = (rootFolder) => {
const configPath = path.join(rootfolder, "exampleSite/hugo.toml"); const configPath = path.join(rootFolder, "exampleSite/hugo.toml");
const getConfig = fs.readFileSync(configPath, "utf8"); const getConfig = fs.readFileSync(configPath, "utf8");
const match = getConfig.match(/theme\s*=\s*\[?"([^"\]]+)"\]?/); const match = getConfig.match(/theme\s*=\s*\[?"([^"\]]+)"\]?/);
let selectedTheme = null; let selectedTheme = null;
@ -45,8 +45,8 @@ const deleteFolder = (folderPath) => {
} }
}; };
const createNewfolder = (rootfolder, folderName) => { const createNewFolder = (rootFolder, folderName) => {
const newFolder = path.join(rootfolder, folderName); const newFolder = path.join(rootFolder, folderName);
fs.mkdirSync(newFolder, { recursive: true }); fs.mkdirSync(newFolder, { recursive: true });
return newFolder; return newFolder;
}; };
@ -56,7 +56,7 @@ const iterateFilesAndFolders = (rootFolder, { destinationRoot }) => {
const items = fs.readdirSync(directory, { withFileTypes: true }); const items = fs.readdirSync(directory, { withFileTypes: true });
items.forEach((item) => { items.forEach((item) => {
if (item.isDirectory()) { if (item.isDirectory()) {
createNewfolder(destinationRoot, item.name); createNewFolder(destinationRoot, item.name);
iterateFilesAndFolders(path.join(directory, item.name), { iterateFilesAndFolders(path.join(directory, item.name), {
currentFolder: item.name, currentFolder: item.name,
destinationRoot: path.join(destinationRoot, item.name), destinationRoot: path.join(destinationRoot, item.name),
@ -70,17 +70,17 @@ const iterateFilesAndFolders = (rootFolder, { destinationRoot }) => {
}; };
const setupProject = () => { const setupProject = () => {
const rootfolder = path.join(__dirname, "../"); const rootFolder = path.join(__dirname, "../");
if (!fs.existsSync(path.join(rootfolder, "themes"))) { if (!fs.existsSync(path.join(rootFolder, "themes"))) {
// remove this part if you don't using theme demo as a module // 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, regex: /^.*theme\s*=\s*("[^"\]]+"|\S+)/m,
}, },
{ {
filepath: path.join( filepath: path.join(
rootfolder, rootFolder,
"exampleSite/config/_default/module.toml", "exampleSite/config/_default/module.toml",
), ),
regex: /\[\[imports\]\]\s*\r?\npath = "([^"]+)"/, regex: /\[\[imports\]\]\s*\r?\npath = "([^"]+)"/,
@ -88,15 +88,15 @@ const setupProject = () => {
].forEach(toggleComment); ].forEach(toggleComment);
const folderList = ["layouts", "assets", "static"]; const folderList = ["layouts", "assets", "static"];
const folderName = getFolderName(rootfolder); const folderName = getFolderName(rootFolder);
const newfolderName = createNewfolder( const newFolderName = createNewFolder(
path.join(rootfolder, "themes"), path.join(rootFolder, "themes"),
folderName, folderName,
); );
folderList.forEach((folder) => { folderList.forEach((folder) => {
const source = path.join(rootfolder, folder); const source = path.join(rootFolder, folder);
const destination = path.join(newfolderName, folder); const destination = path.join(newFolderName, folder);
if (fs.existsSync(source)) { if (fs.existsSync(source)) {
fs.mkdirSync(destination, { recursive: true }); fs.mkdirSync(destination, { recursive: true });
iterateFilesAndFolders(source, { iterateFilesAndFolders(source, {
@ -107,8 +107,8 @@ const setupProject = () => {
} }
}); });
const exampleSite = path.join(rootfolder, "exampleSite"); const exampleSite = path.join(rootFolder, "exampleSite");
iterateFilesAndFolders(exampleSite, { destinationRoot: rootfolder }); iterateFilesAndFolders(exampleSite, { destinationRoot: rootFolder });
deleteFolder(exampleSite); deleteFolder(exampleSite);
} }
}; };

View File

@ -9,8 +9,8 @@ const toggleComment = ({ filepath, regex }) => {
const matchedContent = match[0]; const matchedContent = match[0];
const hasComment = matchedContent.startsWith("# "); const hasComment = matchedContent.startsWith("# ");
if (hasComment) { if (hasComment) {
const hasBreakline = matchedContent.includes("\n"); const hasLineBreak = matchedContent.includes("\n");
if (hasBreakline) { if (hasLineBreak) {
updatedContent = updatedContent.replace( updatedContent = updatedContent.replace(
regex, regex,
matchedContent.replace(/# /gm, ""), matchedContent.replace(/# /gm, ""),
@ -24,8 +24,8 @@ const toggleComment = ({ filepath, regex }) => {
} }
}; };
const createNewfolder = (rootfolder, folderName) => { const createNewFolder = (rootFolder, folderName) => {
const newFolder = path.join(rootfolder, folderName); const newFolder = path.join(rootFolder, folderName);
fs.mkdirSync(newFolder, { recursive: true }); fs.mkdirSync(newFolder, { recursive: true });
return newFolder; return newFolder;
}; };
@ -36,8 +36,8 @@ const deleteFolder = (folderPath) => {
} }
}; };
const getFolderName = (rootfolder) => { const getFolderName = (rootFolder) => {
const configPath = path.join(rootfolder, "exampleSite/hugo.toml"); const configPath = path.join(rootFolder, "exampleSite/hugo.toml");
const getConfig = fs.readFileSync(configPath, "utf8"); const getConfig = fs.readFileSync(configPath, "utf8");
const match = getConfig.match(/theme\s*=\s*\[?"([^"\]]+)"\]?/); const match = getConfig.match(/theme\s*=\s*\[?"([^"\]]+)"\]?/);
let selectedTheme = null; let selectedTheme = null;
@ -52,7 +52,7 @@ const iterateFilesAndFolders = (rootFolder, { destinationRoot }) => {
const items = fs.readdirSync(directory, { withFileTypes: true }); const items = fs.readdirSync(directory, { withFileTypes: true });
items.forEach((item) => { items.forEach((item) => {
if (item.isDirectory()) { if (item.isDirectory()) {
createNewfolder(destinationRoot, item.name); createNewFolder(destinationRoot, item.name);
iterateFilesAndFolders(path.join(directory, item.name), { iterateFilesAndFolders(path.join(directory, item.name), {
currentFolder: item.name, currentFolder: item.name,
destinationRoot: path.join(destinationRoot, item.name), destinationRoot: path.join(destinationRoot, item.name),
@ -94,7 +94,7 @@ const setupTheme = () => {
"static", "static",
]; ];
const folder = createNewfolder(rootFolder, "exampleSite"); const folder = createNewFolder(rootFolder, "exampleSite");
fs.readdirSync(rootFolder, { withFileTypes: true }).forEach((file) => { fs.readdirSync(rootFolder, { withFileTypes: true }).forEach((file) => {
if (includesFiles.includes(file.name)) { if (includesFiles.includes(file.name)) {

View File

@ -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." 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" homepage = "https://github.com/zeon-studio/hugoplate"
demosite = "https://zeon.studio/preview?project=hugoplate" demosite = "https://zeon.studio/preview?project=hugoplate"
min_version = "0.134.3" min_version = "0.139.2"
tags = [ tags = [
"blog", "blog",

View File

@ -2,8 +2,8 @@
# default versions # default versions
NODE_VERSION='18.16.1'; NODE_VERSION='18.16.1';
GO_VERSION='1.22.2'; GO_VERSION='1.23.3';
HUGO_VERSION='0.134.3'; HUGO_VERSION='0.139.2';
# install Node.js # install Node.js
# echo "Installing Node.js $NODE_VERSION..." # echo "Installing Node.js $NODE_VERSION..."