From 4c41e477e13d37e187c8de4225c7e8056bd9ed28 Mon Sep 17 00:00:00 2001 From: Martin Kagamino Lehoux Date: Mon, 29 Sep 2025 19:17:13 +0200 Subject: Internalise theme --- config/_default/hugo.toml | 5 +++-- config/_default/params.toml | 5 +++-- config/postcss.config.js | 21 +++++++++++++++++++++ config/tailwind.config.js | 27 +++++++++++++++++++++++++++ 4 files changed, 54 insertions(+), 4 deletions(-) create mode 100644 config/postcss.config.js create mode 100644 config/tailwind.config.js (limited to 'config') diff --git a/config/_default/hugo.toml b/config/_default/hugo.toml index 4f444de..51c1e5e 100644 --- a/config/_default/hugo.toml +++ b/config/_default/hugo.toml @@ -1,13 +1,14 @@ baseURL = 'https://blog.kagamino.dev/' copyright = "{year}" # To make 2007 - 2022. Just add before {year} example: 2007 - {year} languageCode = 'en-us' -theme = 'lowkey' title = "Kagamino's Blog" enableRobotsTXT = true # List Config summaryLength = 15 -paginate = 5 + +[pagination] +pagerSize = 5 [markup.highlight] codeFences = true diff --git a/config/_default/params.toml b/config/_default/params.toml index 995e343..24f47ea 100644 --- a/config/_default/params.toml +++ b/config/_default/params.toml @@ -3,6 +3,7 @@ isSinglePage = true # Meta Config description = "Hello" +favicon = "img/profile-picture.jpg" # Header Configuration avatar = "img/profile-picture.jpg" @@ -14,7 +15,7 @@ disqusShortname = "" enableEmoji = true # giscus is a comment system based on GitHub Discussions. see https://giscus.app -[giscus] +[giscus] enable = false repo = "" repoId = "" @@ -27,4 +28,4 @@ enableEmoji = true # inputPosition = "top" # theme = "light" # lang = "zh-CN" - # lazyLoading = true \ No newline at end of file + # lazyLoading = true diff --git a/config/postcss.config.js b/config/postcss.config.js new file mode 100644 index 0000000..ee0749c --- /dev/null +++ b/config/postcss.config.js @@ -0,0 +1,21 @@ +const themeDir = __dirname + "/../"; + +const cssnanoPlugin = require("cssnano")({ + path: [themeDir], + preset: [ + "default", + { + discardComments: { + removeAll: true, + }, + }, + ], +}); + +module.exports = { + plugins: [ + require("tailwindcss")(themeDir + "./config/tailwind.config.js"), + require("autoprefixer")({ path: [themeDir] }), + ...(process.env.HUGO_ENVIRONMENT === "production" ? [cssnanoPlugin] : []), + ], +}; diff --git a/config/tailwind.config.js b/config/tailwind.config.js new file mode 100644 index 0000000..791ce8c --- /dev/null +++ b/config/tailwind.config.js @@ -0,0 +1,27 @@ +const path = require('path'); + +// When deploying to production, set the base directory to your Hugo project's root directory. +const baseDir = path.join(__dirname, '..'); + +/** @type {import('tailwindcss').Config} */ +module.exports = { + darkMode: 'class', + content: [ + `${baseDir}/themes/**/layouts/**/*.html`, + `${baseDir}/content/**/layouts/**/*.html`, + `${baseDir}/layouts/**/*.html`, + `${baseDir}/content/**/*.html`, + `${baseDir}/content/**/*.md`, + `${baseDir}/public/**/*.html`, + ], + theme: { + extend: { + fontFamily: { + 'sans': ['"Inter"', '-apple-system', 'BlinkMacSystemFont', 'avenir next', 'avenir', 'segoe ui', 'helvetica neue', 'helvetica', 'Cantarell', 'Ubuntu', 'roboto', 'noto', 'arial', 'sans-serif'], + }, + }, + }, + plugins: [], + variants: ['group-hover'], +} + -- cgit v1.3