Create CCCHH theme

This commit is contained in:
jtbx 2023-10-02 12:08:18 +02:00
commit 2d267ba9fe
23 changed files with 629 additions and 1 deletions

View file

@ -0,0 +1,8 @@
{{ define "main" }}
<main class="container" aria-role="main">
<div>
<h1 id="title">404 Page not Found</h1>
<a href="{{ "" | relURL }}">Back Home</a>
</div>
</main>
{{ end }}

View file

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

View file

@ -0,0 +1,13 @@
{{ define "main" }}
<main class="container" aria-role="main">
<header class="header">
<h1>{{ .Title }}</h1>
{{ with .Params.subtitle }}
<span class="subtitle">{{ . }}</span>
{{ end }}
</header>
<div class="content">
{{ .Content }}
</div>
</main>
{{ end }}

View file

@ -0,0 +1,33 @@
{{ define "main" }}
<main class="container" aria-role="main">
<header class="header">
<h1>{{ .Title }}</h1>
{{ with .Params.subtitle }}
<span class="subtitle">{{ . }}</span>
{{ end }}
</header>
<div class="content">
{{ .Content }}
</div>
<ul>
{{ range .Pages }}
<li>
<a href="{{ .Permalink }}">{{ .Date.Format "2006-01-02" }} | {{ .Title }}</a>
</li>
{{ end }}
</ul>
{{ range .Pages.GroupByParam "kind" }}
<h3>{{ .Key }}</h3>
<ul>
{{ range .Pages }}
<li>
<a href="{{ .Permalink }}">{{ .Date.Format "2006-01-02" }} | {{ .Title }}</a>
</li>
{{ end }}
</ul>
{{ end }}
<!-- TODO: Pagination: see https://gohugo.io/templates/pagination/ -->
</main>
{{ end }}

View file

@ -0,0 +1,50 @@
{{ define "main" }}
<main class="container" aria-role="main">
<!-- <header class="homepage-header">
<h1>{{ .Title }}</h1>
{{ with .Params.subtitle }}
<span class="subtitle">{{ . }}</span>
{{ end }}
</header> -->
<div class="homepage-content">
<!-- Note that the content for index.html, as a sort of list page, will pull from content/_index.md -->
{{ .Content }}
</div>
{{- $events := where (.Site.GetPage "blog").Pages ".Params.kind" "event" }}
{{- $upcoming := where $events ".Params.date" "ge" now }}
{{ if $upcoming}}
<div class="announcements">
<h3>Neuigkeiten</h3>
{{- range $upcoming.ByDate }}
<div class="announcement">
<p><a href="{{ .Permalink }}">{{ .Date.Format "2006-01-02" }}: {{ .Title }}</a>
{{ .Summary }}
{{- if .Truncated }}
<a href="{{ .RelPermalink }}">Read More…</a>
{{- end }}
</p>
</div>
{{- end }}
</div>
{{- end }}
{{- $home_sections := .Site.GetPage "/home" }}
{{- range sort ($home_sections.Resources.Match "*.md") ".Name" }}
<div class="section">
<h3>{{ .Title }}</h3>
{{ .Content -}}
{{- with .Params.Resources }}
<div class="flex-grid">
{{- range . }}
{{- $img := $home_sections.Resources.GetMatch (printf "%s" .src) }}
<div class="img-link"><a href="{{ .params.url }}"><img src="{{ $img.Permalink }}" class="box-image" alt=""></a></div>
{{- end }}
</div>
{{- end }}
</div>
{{ end }}
</main>
{{ end }}

View file

@ -0,0 +1,6 @@
<footer class="container">
<nav class="menu">
{{- partial "menu.html" (dict "menuID" "footer" "page" . ) -}}
</nav>
</footer>

View file

@ -0,0 +1,22 @@
{{- $options := dict "transpiler" "libsass" "targetPath" "css/style.css" -}}
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta charset="utf-8">
{{- with resources.GetRemote "https://cdn.jsdelivr.net/npm/@picocss/pico@1/css/pico.min.css" }}
<link rel="stylesheet" href="{{ .RelPermalink }}" crossorigin="anonymous">
{{ end }}
{{ with resources.Get "sass/main.scss" | toCSS $options | minify | fingerprint -}}
<link rel="stylesheet" href="{{ .RelPermalink }}" integrity="{{ .Data.Integrity }}" crossorigin="anonymous">
{{- end }}
<link rel="stylesheet" href="{{ .Site.BaseURL }}thirdparty/fontawesome6/css/all.min.css" crossorigin="anonymous">
{{ with resources.Get "js/roomstate.js" | js.Build | minify | fingerprint -}}
<script src="{{ .RelPermalink }}" integrity="{{ .Data.Integrity }}" crossorigin="anonymous"></script>
{{- end }}
{{ range .AlternativeOutputFormats -}}
{{ printf `<link rel="%s" type="%s" href="%s" title="%s" />` .Rel .MediaType.Type .Permalink $.Site.Title | safeHTML }}
{{ end -}}
<title>{{ .Title }}</title>
<!-- TODO: Favicon -->

View file

@ -0,0 +1,6 @@
<div class="container header">
<nav class="menu">
{{- partial "menu.html" (dict "menuID" "main" "page" . ) -}}
</nav>
</div>

View file

@ -0,0 +1,32 @@
{{- $page := .page -}}
{{- $menuID := .menuID -}}
{{- $menuContent := index site.Menus .menuID -}}
<ul>
{{- if compare.Eq $menuID "main" -}}
{{ $image := resources.Get "images/logo.svg" }}
<li><a href="/{{ .Site.Home.URL }}"><img src="{{ $image.RelPermalink }}" class="invert-on-light" width="150px" alt="CCCHH Icon"></a></li>
{{- end }}
{{- range $menuContent }}
<li>
{{- $attrs := dict "href" .URL }}
{{- if $page.IsMenuCurrent $menuID . -}}
{{- $attrs = merge $attrs (dict "class" "active" "aria-current" "page") }}
{{- end -}}
<a
{{- range $k, $v := $attrs }}
{{- with $v }}
{{- printf " %s=%q" $k $v | safeHTMLAttr }}
{{- end }}
{{- end -}}
>{{ or (T .Identifier) .Name | safeHTML }}</a></li>
{{- end }}
</ul>
{{- if compare.Eq $menuID "main" -}}
<ul>
<li class="roomstate" id="roomstate">
<span class="state">unbekannt</span><br><span class="duration">(seit&nbsp;)</span>
</li>
</ul>
{{- end }}