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
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 }}

View File

@ -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:

View File

@ -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:

View File

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

View File

@ -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
)

View File

@ -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"

View File

@ -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",

View File

@ -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);
}
};

View File

@ -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)) {

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."
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",

View File

@ -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..."