Skip to content

Commit 34c85c1

Browse files
committed
Merge branch 'v3'
2 parents 8ae46ba + f0ae373 commit 34c85c1

15 files changed

Lines changed: 1057 additions & 1732 deletions

‎.gitignore‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
node_modules/
22
public/
33
resources/
4-
hugo_stats.json
4+
hugo_stats.json
5+
.hugo_build.lock

‎.hugo_build.lock‎

Whitespace-only changes.

‎.vscode/settings.json‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"autoHide.autoHidePanel": false
3+
}

‎README.md‎

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# hugo-starter-tailwind-basic
1+
# Hugo Basic Starter for TailwindCSS v3.x
22

33
[![Netlify Status](https://api.netlify.com/api/v1/badges/5a510ba1-96b4-4834-9a07-913dce4b5061/deploy-status)](https://app.netlify.com/sites/lucid-nightingale-60a4e2/deploys)
44

@@ -18,18 +18,41 @@ hugo server
1818

1919
## As a Theme
2020

21-
Import `github.com/bep/hugo-starter-tailwind-basic/v2` (use `github.com/bep/hugo-starter-tailwind-basic` if you want/need Tailwind 1.x.) into your project, and then run:
21+
Import `github.com/bep/hugo-starter-tailwind-basic/v3` (use `github.com/bep/hugo-starter-tailwind-basic/v2` if you want/need Tailwind 2.x.) into your project, and then run:
2222

2323
```bash
2424
hugo mod npm pack
2525
npm install
2626
```
2727

28-
You need to add this to your `config.toml` (the stats are used by the CSS purging):
28+
You need to add (something like) this to your `hugo.toml`:
2929

3030
```toml
31+
[module]
32+
[module.hugoVersion]
33+
extended = false
34+
min = "0.112.0"
35+
[[module.mounts]]
36+
source = "assets"
37+
target = "assets"
38+
[[module.mounts]]
39+
source = "hugo_stats.json"
40+
target = "assets/watching/hugo_stats.json"
41+
3142
[build]
32-
writeStats = true
43+
writeStats = true
44+
[[build.cachebusters]]
45+
source = "assets/watching/hugo_stats\\.json"
46+
target = "styles\\.css"
47+
[[build.cachebusters]]
48+
source = "(postcss|tailwind)\\.config\\.js"
49+
target = "css"
50+
[[build.cachebusters]]
51+
source = "assets/.*\\.(js|ts|jsx|tsx)"
52+
target = "js"
53+
[[build.cachebusters]]
54+
source = "assets/.*\\.(.*)$"
55+
target = "$1"
3356
```
3457

3558
Then run your project as usual.

‎assets/css/styles.css‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55
@import "components/all.css";
66

77
html {
8-
font-size: 14px;
8+
font-size: 14px;
99
}
1010

1111
@screen md {
12-
html {
13-
font-size: 16px;
14-
}
12+
html {
13+
font-size: 16px;
14+
}
1515
}

‎config.toml‎

Lines changed: 0 additions & 12 deletions
This file was deleted.

‎go.mod‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
module github.com/bep/hugo-starter-tailwind-basic/v2
1+
module github.com/bep/hugo-starter-tailwind-basic/v3
22

3-
go 1.15
3+
go 1.19

‎hugo.toml‎

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
baseURL = "https://example.org"
2+
3+
disableKinds = ["page", "section", "taxonomy", "term"]
4+
5+
[module]
6+
[module.hugoVersion]
7+
extended = false
8+
min = "0.112.0"
9+
[[module.mounts]]
10+
source = "assets"
11+
target = "assets"
12+
[[module.mounts]]
13+
source = "hugo_stats.json"
14+
target = "assets/watching/hugo_stats.json"
15+
16+
[build]
17+
writeStats = true
18+
[[build.cachebusters]]
19+
source = "assets/watching/hugo_stats\\.json"
20+
target = "styles\\.css"
21+
[[build.cachebusters]]
22+
source = "(postcss|tailwind)\\.config\\.js"
23+
target = "css"
24+
[[build.cachebusters]]
25+
source = "assets/.*\\.(js|ts|jsx|tsx)"
26+
target = "js"
27+
[[build.cachebusters]]
28+
source = "assets/.*\\.(.*)$"
29+
target = "$1"

‎layouts/_default/baseof.html‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
<!doctype html>
1+
<!DOCTYPE html>
22
<html lang="en">
33
<head>
4-
<meta charset="utf-8">
4+
<meta charset="utf-8" />
55
<title>
66
{{ .Title }}
77
</title>
8-
<meta name="description" content="{{ .Description }}">
8+
<meta name="description" content="{{ .Description }}" />
99
{{/* styles */}}
1010
{{ $options := dict "inlineImports" true }}
1111
{{ $styles := resources.Get "css/styles.css" }}
1212
{{ $styles = $styles | resources.PostCSS $options }}
13-
{{ if hugo.IsProduction }}
13+
{{ if hugo.IsProduction }}
1414
{{ $styles = $styles | minify | fingerprint | resources.PostProcess }}
1515
{{ end }}
1616
<link href="{{ $styles.RelPermalink }}" rel="stylesheet" />

‎layouts/index.html‎

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11
{{ define "main" }}
22
<article class="prose lg:prose-xl">
3-
<h1 class="text-4xl">
4-
{{ .Title }}
5-
</h1>
6-
{{ .Content }}
3+
<h1>Tailwind 3 Hugo Starter</h1>
4+
5+
<h2 class="text-4xl">Testing Tailwind 3 Features</h2>
6+
<div>
7+
<button class="bg-[green] p-4">Share on Twitter</button>
8+
</div>
9+
10+
<h2 class="text-4xl">Markdowns: {{ .Title }}</h2>
11+
{{ .Content }}..
712
</article>
8-
{{ end }}
13+
{{ end }}

0 commit comments

Comments
 (0)