Merge pull request #3 from tfsomrat/main

rename config.toml to hugo.toml
This commit is contained in:
Somrat 2023-07-05 16:32:51 +06:00 committed by GitHub
commit 313c9f8c38
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 29 additions and 21 deletions

View File

@ -12,7 +12,7 @@ main {
// container // container
.container { .container {
@apply mx-auto 2xl:max-w-[1320px] px-4; @apply mx-auto px-4 2xl:max-w-[1320px];
} }
// form style // form style

View File

@ -1,15 +1,15 @@
######################## default configuration #################### ######################## default configuration ####################
baseURL = "https://hugoplate.netlify.app/" baseURL = "https://hugoplate.netlify.app/"
title = "Hugoplate" title = "Hugoplate"
theme = ["hugoplate"] theme = "hugoplate"
# Default time zone for time stamps; use any valid tz database name: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones#List # Default time zone for time stamps; use any valid tz database name: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones#List
timeZone = "UTC" timeZone = "America/New_York"
# post pagination # post pagination
paginate = "2" # see https://gohugo.io/extras/pagination/ paginate = 2 # see https://gohugo.io/extras/pagination/
# post excerpt # post excerpt
summaryLength = "10" # see https://gohugo.io/content-management/excerpts/ summaryLength = 10 # see https://gohugo.io/content-management/excerpts/
# google analytics # google analytics
googleAnalytics = "" # example: UA-123-45, for more info, read the article https://support.google.com/analytics/answer/1008080?hl=en googleAnalytics = "UA-123456-78" # example: UA-123456-78, for more info, read the article https://support.google.com/analytics/answer/1008080?hl=en
# disqus short name # disqus short name
disqusShortname = "themefisher-template" # we use disqus to show comments in blog posts . To install disqus please follow this tutorial https://portfolio.peter-baumgartner.net/2017/09/10/how-to-install-disqus-on-hugo/ disqusShortname = "themefisher-template" # we use disqus to show comments in blog posts . To install disqus please follow this tutorial https://portfolio.peter-baumgartner.net/2017/09/10/how-to-install-disqus-on-hugo/
# disable language # disable language
@ -36,11 +36,22 @@ target = "assets/watching/hugo_stats.json"
############################# Build ############################## ############################# Build ##############################
[build] [build]
writeStats = true noJSConfigInAssets = false
useResourceCacheWhen = 'fallback'
[build.buildStats]
enable = true
[[build.cachebusters]] [[build.cachebusters]]
source = "assets/watching/hugo_stats\\.json" source = 'assets/.*\.(js|ts|jsx|tsx)'
target = "style\\.css" target = '(js|scripts|javascript)'
[[build.cachebusters]]
source = 'assets/.*\.(css|sass|scss)$'
target = '(css|styles|scss|sass)'
[[build.cachebusters]]
source = '(postcss|tailwind)\.config\.js'
target = '(css|styles|scss|sass)'
[[build.cachebusters]]
source = 'assets/.*\.(.*)$'
target = '$1'
############################# Outputs ############################ ############################# Outputs ############################
@ -84,10 +95,6 @@ ordered = true
[mediaTypes."application/manifest+json"] [mediaTypes."application/manifest+json"]
suffixes = ["webmanifest"] suffixes = ["webmanifest"]
[mediaTypes."text/netlify"]
delimiter = ""
suffixes = [""]
########################### Output Format ########################## ########################### Output Format ##########################
[outputFormats] [outputFormats]

View File

@ -1,7 +1,7 @@
const toml = require("toml"); const toml = require("toml");
const fs = require("fs"); const fs = require("fs");
const path = require("path"); const path = require("path");
const configPath = path.join(__dirname, "config.toml"); const configPath = path.join(__dirname, "hugo.toml");
const getConfig = fs.readFileSync(configPath, "utf8"); const getConfig = fs.readFileSync(configPath, "utf8");
const theme = JSON.parse(JSON.stringify(toml.parse(getConfig))); const theme = JSON.parse(JSON.stringify(toml.parse(getConfig)));
@ -29,7 +29,7 @@ if (theme.params.fonts.font_family.secondary) {
/** @type {import('tailwindcss').Config} */ /** @type {import('tailwindcss').Config} */
module.exports = { module.exports = {
content: ['./hugo_stats.json'], content: ["./hugo_stats.json"],
safelist: [{ pattern: /^swiper-/ }], safelist: [{ pattern: /^swiper-/ }],
darkMode: "class", darkMode: "class",
theme: { theme: {

View File

@ -1,7 +1,7 @@
{ {
"name": "hugoplate", "name": "hugoplate",
"description": "hugo tailwindcss boilerplate", "description": "hugo tailwindcss boilerplate",
"version": "1.2.0", "version": "1.3.0",
"license": "MIT", "license": "MIT",
"author": "zeon.studio", "author": "zeon.studio",
"scripts": { "scripts": {

View File

@ -4,7 +4,7 @@ const path = require("path");
const getFolderName = (rootfolder) => { const getFolderName = (rootfolder) => {
const configPath = path.join( const configPath = path.join(
rootfolder, rootfolder,
"exampleSite/config/_default/config.toml" "exampleSite/config/_default/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*\[?"([^"\]]+)"\]?/);

View File

@ -8,7 +8,7 @@ const configFiles = [
patterns: ["darkmode:\\s*{[^}]*},", 'darkMode:\\s*"class",'], patterns: ["darkmode:\\s*{[^}]*},", 'darkMode:\\s*"class",'],
}, },
{ {
filePath: "exampleSite/config.toml", filePath: "exampleSite/hugo.toml",
patterns: ["\\S*\\.darkmode[^\\]]*\\]\\n*([\\s\\S]*?)(?=\\[|$)"], patterns: ["\\S*\\.darkmode[^\\]]*\\]\\n*([\\s\\S]*?)(?=\\[|$)"],
}, },
]; ];

View File

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