Skip to content

Commit

Permalink
refactor: upgrade to Tailwind CSS v3
Browse files Browse the repository at this point in the history
  • Loading branch information
wangchucheng committed Jan 28, 2022
1 parent 15493ce commit 72c35be
Show file tree
Hide file tree
Showing 12 changed files with 1,853 additions and 1,046 deletions.
3 changes: 3 additions & 0 deletions assets/css/postcss.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,8 @@ module.exports = {
require('autoprefixer')({
path: [themeDir]
}),
require('cssnano')({
preset: 'default',
}),
]
}
16 changes: 6 additions & 10 deletions assets/css/tailwind.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'],
Expand Down Expand Up @@ -52,7 +49,6 @@ module.exports = {
}
}
},
variants: {},
plugins: [
require('tailwindcss-rtl')
]
Expand Down
2 changes: 1 addition & 1 deletion data/eureka.yaml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
version: 0.8.4
version: 0.9.0
12 changes: 6 additions & 6 deletions exampleSite/config/_default/config.yaml
Original file line number Diff line number Diff line change
@@ -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: >
&copy; 2021 <a href="https://www.wangchucheng.com/">C. Wang</a> and <a
href="https://www.ruiqima.com/">R. Ma</a>
&copy; 2021 <a href="https://www.wangchucheng.com/">WANG Chucheng</a> and <a
href="https://www.ruiqima.com/">MA Ruiqi</a>
enableEmoji: true
enableGitInfo: false
summaryLength: 75
Expand Down
2 changes: 1 addition & 1 deletion layouts/_default/baseof.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
{{- partial "header" . -}}
</div>
</header>
<main class="flex-grow pt-16">
<main class="grow pt-16">
{{- if or .IsHome (and (eq .Type "authors") (eq .Kind "term")) }}
{{- block "main" . }}{{- end }}
{{- else }}
Expand Down
2 changes: 1 addition & 1 deletion layouts/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@
<div class="flex-none {{ with $scaleClass -}}{{ partial "utils/standardize-classes" . }}{{- end }} {{ if eq $sidebar.position "left" -}} lg:me-4 {{- else -}} lg:ms-4 {{- end }}">
<h2 class="font-bold text-3xl my-4">{{ .Params.Title }}</h2>
</div>
<div class="flex-grow {{ if eq $sidebar.position "right" -}} lg:me-4 {{- else -}} lg:ms-4 {{- end }}">
<div class="grow {{ if eq $sidebar.position "right" -}} lg:me-4 {{- else -}} lg:ms-4 {{- end }}">
{{/* 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 }}
Expand Down
4 changes: 2 additions & 2 deletions layouts/partials/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
</button>

<div id="target"
class="hidden block md:flex md:flex-grow md:justify-between md:items-center w-full md:w-auto text-primary-text z-20">
<div class="md:flex md:h-16 text-sm md:flex-grow pb-4 md:pb-0 border-b md:border-b-0">
class="hidden block md:flex md:grow md:justify-between md:items-center w-full md:w-auto text-primary-text z-20">
<div class="md:flex md:h-16 text-sm md:grow pb-4 md:pb-0 border-b md:border-b-0">
{{- $relPermalink := .RelPermalink }}
{{- range .Site.Menus.main }}
{{- $url := .URL | relLangURL }}
Expand Down
2 changes: 1 addition & 1 deletion layouts/partials/widgets/about.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<img src="{{ . }}" class="rounded-full" alt="Avatar">
</div>
{{ end }}
<div class="flex-grow mt-4 md:mt-0">
<div class="grow mt-4 md:mt-0">
<div class="text-3xl py-4">{{ .Title }}</div>
<div class="w-3/12 xl:w-2/12 border-b"></div>

Expand Down
2 changes: 1 addition & 1 deletion layouts/partials/widgets/experience.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

<span>{{ .location | markdownify }} </span>
</div>
<div class="flex-shrink-0"> {{ .dates | markdownify }}</div>
<div class="shrink-0"> {{ .dates | markdownify }}</div>
</div>
</div>

Expand Down
Loading

0 comments on commit 72c35be

Please sign in to comment.