hugo init

chore: add .gitignore

feat: add hugo configs

chore: initialize npm

feat: add hugo tailwind starter site

chore: add basic taskfile

chore: add README.md

feat: add 404 template

chore: add .prettierrc

chore: update hugo.toml

feat: add icons and icon.html partial
This commit is contained in:
Xin
2023-07-19 22:11:34 +01:00
parent ed3ced0d67
commit 3ec2e18870
23 changed files with 1985 additions and 0 deletions

29
layouts/404.html Normal file
View File

@ -0,0 +1,29 @@
{{ define "main" }}
<div style='font-family:system-ui,"Segoe UI",Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji"; height:100vh; text-align:center; display:flex; flex-direction:column; align-items:center; justify-content:center'>
<div>
<style>
body {
color: #000;
background: #fff;
margin: 0;
}
.next-error-h1 {
border-right: 1px solid rgba(0, 0, 0, 0.3);
}
@media (prefers-color-scheme: dark) {
body {
color: #fff;
background: #000;
}
.next-error-h1 {
border-right: 1px solid rgba(255, 255, 255, 0.3);
}
}
</style>
<h1 class="next-error-h1" style='display: inline-block; margin: 0 20px 0 0; padding-right: 23px; font-size: 24px; font-weight: 500; vertical-align: top; line-height: 49px; font-feature-settings: "rlig" 1,"calt" 1,"ss01" 1,"ss06" 1 !important;'>404</h1>
<div style="display: inline-block; text-align: left">
<h2 style="font-size: 14px; font-weight: 400; line-height: 49px; margin: 0">This page could not be found.</h2>
</div>
</div>
</div>
{{ end }}

View File

@ -0,0 +1,11 @@
<!DOCTYPE html>
<html>
{{- partial "head.html" . -}}
<body>
{{- partial "header.html" . -}}
<div id="content">
{{- block "main" . }}{{- end }}
</div>
{{- partial "footer.html" . -}}
</body>
</html>

View File

View File

8
layouts/index.html Normal file
View File

@ -0,0 +1,8 @@
{{ define "main" }}
<div class="container px-4 lg:mx-auto">
<article class="prose lg:prose-xl">
<h1>{{ .Title }}</h1>
{{ .Content }}
</article>
</div>
{{ end }}

View File

View File

@ -0,0 +1,14 @@
<head>
<meta charset="utf-8" />
<title>
{{ .Title }}
</title>
<meta name="description" content="{{ .Description }}" />
{{ $options := dict "inlineImports" true }}
{{ $styles := resources.Get "css/styles.css" }}
{{ $styles = $styles | resources.PostCSS $options }}
{{ if hugo.IsProduction }}
{{ $styles = $styles | minify | fingerprint | resources.PostProcess }}
{{ end }}
<link href="{{ $styles.RelPermalink }}" rel="stylesheet" />
</head>

View File

View File

@ -0,0 +1,13 @@
{{- $icon := index .context.Site.Data.icons .name -}}
{{- if not $icon -}}
{{ errorf "icon %q not found" .name }}
{{- end -}}
{{- $icon = $icon | safeHTML -}}
{{- if .attributes -}}
{{- $icon = replaceRE "<svg" (printf "<svg %s" .attributes) $icon -}}
{{- end -}}
{{- return ($icon | safeHTML) -}}