rename config.toml to hugo.toml

This commit is contained in:
somrat sorkar
2023-07-05 16:25:58 +06:00
parent 39d31f2ade
commit caee77c940
8 changed files with 37 additions and 21 deletions

View File

@@ -4,7 +4,7 @@ const path = require("path");
const getFolderName = (rootfolder) => {
const configPath = path.join(
rootfolder,
"exampleSite/config/_default/config.toml"
"exampleSite/config/_default/hugo.toml"
);
const getConfig = fs.readFileSync(configPath, "utf8");
const match = getConfig.match(/theme\s*=\s*\[?"([^"\]]+)"\]?/);

View File

@@ -3,12 +3,20 @@ const path = require("path");
const rootDirs = ["assets/scss", "layouts"];
const configFiles = [
{
filePath: "tailwind.config.js",
patterns: ["darkmode:\\s*{[^}]*},", 'darkMode:\\s*"class",'],
},
{
filePath: "exampleSite/tailwind.config.js",
patterns: ["darkmode:\\s*{[^}]*},", 'darkMode:\\s*"class",'],
},
{
filePath: "exampleSite/config.toml",
filePath: "hugo.toml",
patterns: ["\\S*\\.darkmode[^\\]]*\\]\\n*([\\s\\S]*?)(?=\\[|$)"],
},
{
filePath: "exampleSite/hugo.toml",
patterns: ["\\S*\\.darkmode[^\\]]*\\]\\n*([\\s\\S]*?)(?=\\[|$)"],
},
];

View File

@@ -16,7 +16,7 @@ const deleteFolder = (folderPath) => {
const getFolderName = (rootfolder) => {
const configPath = path.join(
rootfolder,
"exampleSite/config/_default/config.toml"
"exampleSite/config/_default/hugo.toml"
);
const getConfig = fs.readFileSync(configPath, "utf8");
const match = getConfig.match(/theme\s*=\s*\[?"([^"\]]+)"\]?/);
@@ -53,9 +53,10 @@ const setupTheme = () => {
"tailwind.config.js",
"postcss.config.js",
"go.mod",
"config.toml",
"hugo.toml",
"assets",
"config",
"data",
"content",
"i18n",
"static",