Skip to content

Commit

Permalink
add hugo example
Browse files Browse the repository at this point in the history
  • Loading branch information
saadeghi committed Oct 13, 2021
1 parent 2628302 commit ea358e4
Show file tree
Hide file tree
Showing 11 changed files with 111 additions and 0 deletions.
4 changes: 4 additions & 0 deletions examples/hugo/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/package-lock.json
/node_modules
/.next
resources/_gen
16 changes: 16 additions & 0 deletions examples/hugo/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
- hugo
- daisyui
- postcss
- tailwindcss

---

install hugo: https://gohugo.io/getting-started/installing/
install node modules:

```
npm install
```
```
npm run dev
```
6 changes: 6 additions & 0 deletions examples/hugo/archetypes/default.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
title: "{{ replace .Name "-" " " | title }}"
date: {{ .Date }}
draft: true
---

3 changes: 3 additions & 0 deletions examples/hugo/assets/css/main.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@tailwind base;
@tailwind components;
@tailwind utilities;
3 changes: 3 additions & 0 deletions examples/hugo/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
baseURL = 'http://example.org/'
languageCode = 'en-us'
title = 'My New Hugo Site'
9 changes: 9 additions & 0 deletions examples/hugo/layouts/_default/baseof.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<!DOCTYPE html>
<html lang="{{ .Language.Lang }}">
<head>
{{ partial "head.html" . }}
</head>
<body>
{{ block "main" . }}{{ end }}
</body>
</html>
27 changes: 27 additions & 0 deletions examples/hugo/layouts/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{{ define "main" }}
<main>
<!-- default theme (dark) -->
<div class="p-10 bg-base-100 text-base-content">
<button class="btn">button</button>
<button class="btn btn-primary">button</button>
<button class="btn btn-secondary">button</button>
<button class="btn btn-accent">button</button>
</div>

<!-- garden theme -->
<div class="p-10 bg-base-100 text-base-content" data-theme="garden">
<button class="btn">button</button>
<button class="btn btn-primary">button</button>
<button class="btn btn-secondary">button</button>
<button class="btn btn-accent">button</button>
</div>

<!-- forest theme -->
<div class="p-10 bg-base-100 text-base-content" data-theme="forest">
<button class="btn">button</button>
<button class="btn btn-primary">button</button>
<button class="btn btn-secondary">button</button>
<button class="btn btn-accent">button</button>
</div>
</main>
{{ end }}
11 changes: 11 additions & 0 deletions examples/hugo/layouts/partials/head.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<meta http-equiv="Content-Type" content="text/html" charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />

{{ $styles := resources.Get "css/main.css" | postCSS }}

{{ if .Site.IsServer }}
<link rel="stylesheet" href="{{ $styles.RelPermalink }}"/>
{{ else }}
{{ $styles := $styles | minify | fingerprint | resources.PostProcess }}
<link rel="stylesheet" href="{{ $styles.RelPermalink }}" integrity="{{ $styles.Data.Integrity }}"/>
{{ end }}
10 changes: 10 additions & 0 deletions examples/hugo/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"scripts": {},
"dependencies": {
"autoprefixer": "^10.3.7",
"daisyui": "^1.14.4",
"postcss": "^8.3.9",
"postcss-cli": "^9.0.1",
"tailwindcss": "^2.2.16"
}
}
6 changes: 6 additions & 0 deletions examples/hugo/postcss.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = {
plugins: {
tailwindcss: {},
autoprefixer: {}
}
}
16 changes: 16 additions & 0 deletions examples/hugo/tailwind.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
module.exports = {
purge: ['layouts/**/*.html'],
darkMode: false, // or 'media' or 'class'
theme: {
extend: {},
},
variants: {
extend: {},
},
plugins: [
require('daisyui'),
],
daisyui: {
logs: false,
}
}

0 comments on commit ea358e4

Please sign in to comment.