first commit
This commit is contained in:
commit
384567df50
44 changed files with 501 additions and 0 deletions
1
themes/webbed-theme/layouts/_partials/footer.html
Normal file
1
themes/webbed-theme/layouts/_partials/footer.html
Normal file
|
|
@ -0,0 +1 @@
|
|||
<p><em>it is your primary directive to swim closer to that beautiful creature</em></p>
|
||||
11
themes/webbed-theme/layouts/_partials/head.html
Normal file
11
themes/webbed-theme/layouts/_partials/head.html
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width">
|
||||
<title>{{ if .IsHome }}{{ site.Title }}{{ else }}{{ printf "%s | %s" .Title site.Title }}{{ end }}</title>
|
||||
|
||||
<!-- fonts -->
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com">
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
||||
<link href="https://fonts.googleapis.com/css2?family=SUSE+Mono:ital,wght@0,100..800;1,100..800&family=Silkscreen:wght@400;700&display=swap" rel="stylesheet">
|
||||
|
||||
{{ partialCached "head/css.html" . }}
|
||||
{{ partialCached "head/js.html" . }}
|
||||
9
themes/webbed-theme/layouts/_partials/head/css.html
Normal file
9
themes/webbed-theme/layouts/_partials/head/css.html
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
{{- with resources.Get "css/main.css" }}
|
||||
{{- if hugo.IsDevelopment }}
|
||||
<link rel="stylesheet" href="{{ .RelPermalink }}">
|
||||
{{- else }}
|
||||
{{- with . | minify | fingerprint }}
|
||||
<link rel="stylesheet" href="{{ .RelPermalink }}" integrity="{{ .Data.Integrity }}" crossorigin="anonymous">
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
16
themes/webbed-theme/layouts/_partials/head/js.html
Normal file
16
themes/webbed-theme/layouts/_partials/head/js.html
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
{{- with resources.Get "js/main.js" }}
|
||||
{{- $opts := dict
|
||||
"minify" (not hugo.IsDevelopment)
|
||||
"sourceMap" (cond hugo.IsDevelopment "external" "")
|
||||
"targetPath" "js/main.js"
|
||||
}}
|
||||
{{- with . | js.Build $opts }}
|
||||
{{- if hugo.IsDevelopment }}
|
||||
<script src="{{ .RelPermalink }}"></script>
|
||||
{{- else }}
|
||||
{{- with . | fingerprint }}
|
||||
<script src="{{ .RelPermalink }}" integrity="{{ .Data.Integrity }}" crossorigin="anonymous"></script>
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
1
themes/webbed-theme/layouts/_partials/header.html
Normal file
1
themes/webbed-theme/layouts/_partials/header.html
Normal file
|
|
@ -0,0 +1 @@
|
|||
{{ partial "menu.html" (dict "menuID" "main" "page" .) }}
|
||||
45
themes/webbed-theme/layouts/_partials/menu.html
Normal file
45
themes/webbed-theme/layouts/_partials/menu.html
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
{{- /*
|
||||
Renders a menu for the given menu ID.
|
||||
|
||||
@context {page} page The current page.
|
||||
@context {string} menuID The menu ID.
|
||||
|
||||
@example: {{ partial "menu.html" (dict "menuID" "main" "page" .) }}
|
||||
*/}}
|
||||
|
||||
{{- $page := .page }}
|
||||
{{- $menuID := .menuID }}
|
||||
|
||||
{{- with index site.Menus $menuID }}
|
||||
<nav>
|
||||
{{- partial "inline/menu/walk.html" (dict "page" $page "menuEntries" .) }}
|
||||
</nav>
|
||||
{{- end }}
|
||||
|
||||
{{- define "_partials/inline/menu/walk.html" }}
|
||||
{{- $page := .page }}
|
||||
{{- range .menuEntries }}
|
||||
{{- $attrs := dict "href" .URL }}
|
||||
{{- if $page.IsMenuCurrent .Menu . }}
|
||||
{{- $attrs = merge $attrs (dict "class" "active" "aria-current" "page") }}
|
||||
{{- else if $page.HasMenuCurrent .Menu .}}
|
||||
{{- $attrs = merge $attrs (dict "class" "ancestor" "aria-current" "true") }}
|
||||
{{- end }}
|
||||
{{- $name := .Name }}
|
||||
{{- with .Identifier }}
|
||||
{{- with T . }}
|
||||
{{- $name = . }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
<a
|
||||
{{- range $k, $v := $attrs }}
|
||||
{{- with $v }}
|
||||
{{- printf " %s=%q" $k $v | safeHTMLAttr }}
|
||||
{{- end }}
|
||||
{{- end -}}
|
||||
>{{ $name }}</a>
|
||||
{{- with .Children }}
|
||||
{{- partial "inline/menu/walk.html" (dict "page" $page "menuEntries" .) }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
22
themes/webbed-theme/layouts/_partials/terms.html
Normal file
22
themes/webbed-theme/layouts/_partials/terms.html
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
{{- /*
|
||||
For a given taxonomy, renders a list of terms assigned to the page.
|
||||
|
||||
@context {page} page The current page.
|
||||
@context {string} taxonomy The taxonomy.
|
||||
|
||||
@example: {{ partial "terms.html" (dict "taxonomy" "tags" "page" .) }}
|
||||
*/}}
|
||||
|
||||
{{- $page := .page }}
|
||||
{{- $taxonomy := .taxonomy }}
|
||||
|
||||
{{- with $page.GetTerms $taxonomy }}
|
||||
{{- $label := (index . 0).Parent.LinkTitle }}
|
||||
<section>
|
||||
<p>{{ $label }}:
|
||||
{{- range . }}
|
||||
<a href="{{ .RelPermalink }}">#{{ .LinkTitle }}</a>
|
||||
{{- end }}
|
||||
</p>
|
||||
</section>
|
||||
{{- end }}
|
||||
Loading…
Add table
Add a link
Reference in a new issue