From 72c35bec01c80baf75bcaf61b363ffe337ee7f2d Mon Sep 17 00:00:00 2001 From: WANG Chucheng Date: Fri, 28 Jan 2022 00:24:07 -0500 Subject: refactor: upgrade to Tailwind CSS v3 --- assets/css/postcss.config.js | 3 + assets/css/tailwind.config.js | 16 +- data/eureka.yaml | 2 +- exampleSite/config/_default/config.yaml | 12 +- layouts/_default/baseof.html | 2 +- layouts/index.html | 2 +- layouts/partials/header.html | 4 +- layouts/partials/widgets/about.html | 2 +- layouts/partials/widgets/experience.html | 2 +- package-lock.json | 2835 +++++++++++++------- package.json | 17 +- ...ka.css_fc3f76d7bee2760c3a903059afc3d9b2.content | 2 +- 12 files changed, 1853 insertions(+), 1046 deletions(-) diff --git a/assets/css/postcss.config.js b/assets/css/postcss.config.js index 121ed3f..9bbd93a 100644 --- a/assets/css/postcss.config.js +++ b/assets/css/postcss.config.js @@ -9,5 +9,8 @@ module.exports = { require('autoprefixer')({ path: [themeDir] }), + require('cssnano')({ + preset: 'default', + }), ] } diff --git a/assets/css/tailwind.config.js b/assets/css/tailwind.config.js index 405b7b0..43fad44 100644 --- a/assets/css/tailwind.config.js +++ b/assets/css/tailwind.config.js @@ -2,15 +2,12 @@ const themeDir = __dirname + '/../../'; module.exports = { important: true, - purge: { - enabled: process.env.HUGO_ENVIRONMENT === 'production', - content: [ - themeDir + 'layouts/**/*.html', - themeDir + 'exampleSite/content/**/*.html', - 'layouts/**/*.html', - 'content/**/*.html', - ], - }, + content: [ + themeDir + 'layouts/**/*.html', + themeDir + 'exampleSite/content/**/*.html', + 'layouts/**/*.html', + 'content/**/*.html', + ], theme: { fontFamily: { 'serif': ['Lora', 'Noto Serif SC', 'serif'], @@ -52,7 +49,6 @@ module.exports = { } } }, - variants: {}, plugins: [ require('tailwindcss-rtl') ] diff --git a/data/eureka.yaml b/data/eureka.yaml index c64f083..3715e83 100644 --- a/data/eureka.yaml +++ b/data/eureka.yaml @@ -1 +1 @@ -version: 0.8.4 \ No newline at end of file +version: 0.9.0 \ No newline at end of file diff --git a/exampleSite/config/_default/config.yaml b/exampleSite/config/_default/config.yaml index b17c4b2..c982dab 100644 --- a/exampleSite/config/_default/config.yaml +++ b/exampleSite/config/_default/config.yaml @@ -1,16 +1,16 @@ baseURL: / title: Eureka Demo -# Comment when installing using Hugo Modules -theme: eureka -# Uncomment when installing using Hugo Modules -# theme: wangchucheng.com/hugo-eureka +# Uncomment when not installing with Hugo Modules +# theme: eureka +# Comment when not installing with Hugo Modules +theme: wangchucheng.com/hugo-eureka # If you cannot access the Github mirror, you can also use the Gitee mirror: gitee.com/wangchucheng/hugo-eureka paginate: 3 copyright: > - © 2021 C. Wang and R. Ma + © 2021 WANG Chucheng and MA Ruiqi enableEmoji: true enableGitInfo: false summaryLength: 75 diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index 71691f1..e697430 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -8,7 +8,7 @@ {{- partial "header" . -}} -
+
{{- if or .IsHome (and (eq .Type "authors") (eq .Kind "term")) }} {{- block "main" . }}{{- end }} {{- else }} diff --git a/layouts/index.html b/layouts/index.html index f66761d..06f9516 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -171,7 +171,7 @@

{{ .Params.Title }}

-
+
{{/* Deprecation warning(v1.0.0) starts */}} {{- if eq .Params.widget.handler "experiences" }} {{- warnf "Value `experiences` for `widget.handler` in %s is deprecated and will be removed in Eureka v1.0.0. Please use `experience` instead." .File.Path }} diff --git a/layouts/partials/header.html b/layouts/partials/header.html index 044d899..e3f4b66 100644 --- a/layouts/partials/header.html +++ b/layouts/partials/header.html @@ -21,8 +21,8 @@