Extend Theme

This commit is contained in:
Hoernschen 2022-06-27 16:09:44 +02:00
parent 7239b2c45e
commit 0cf0202035
Signed by: hoernschen
GPG key ID: 37591FAF4E6D3462
29 changed files with 802 additions and 169 deletions

View file

@ -0,0 +1,39 @@
<!DOCTYPE html>
<html lang="{{ .Site.LanguageCode }}">
<head>
<meta name="description" content="{{ if .Params.summary }}{{ .Params.summary }}{{ else if .Site.Params.Description }}{{ .Site.Params.Description }}{{ else }}Hardcoded description; the author should update :){{ end }}" />
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, shrink-to-fit=no" />
<meta http-equiv="x-ua-compatible" content="ie=edge">
{{- $favIcon := .Site.Params.favIcon }}
<link rel="icon" type="image/png" sizes="16x16" href="{{ if $favIcon.small }}{{ $favIcon.small }}{{ else }}/favIcon16x16.png{{ end }}">
<link rel="icon" type="image/png" sizes="32x32" href="{{ if $favIcon.big }}{{ $favIcon.big }}{{ else }}/favIcon32x32.png{{ end }}">
<title>{{ block "title" . }}{{ .Site.Title }}{{ end }}</title>
<link rel="stylesheet" type="text/css" href="/Font-Awesome/css/all.min.css">
{{ $template := resources.Get "scss/index.scss" }}
{{ if $template }}
{{ $index := $template | resources.ExecuteAsTemplate "css/index.scss" . | resources.ToCSS (dict "outputStyle" "compressed") | fingerprint }}
<link rel="stylesheet" type="text/css" href="{{ $index.RelPermalink }}">
{{ end }}
{{ block "styling" . }}
{{ end }}
{{ $template := resources.Get "scss/totop.scss" }}
{{ if $template }}
{{ $totop := $template | resources.ExecuteAsTemplate "css/totop.scss" . | resources.ToCSS (dict "outputStyle" "compressed") | fingerprint }}
<link rel="stylesheet" type="text/css" href="{{ $totop.RelPermalink }}">
{{ end }}
</head>
<body>
{{ block "header" . }}
{{- partial "header.html" . -}}
{{ end }}
{{ block "main" . }}
<!-- The part of the page that begins to differ between templates -->
{{ end }}
{{ block "footer" . }}
{{- partial "footer.html" . -}}
{{ end }}
</body>
</html>

View file

@ -0,0 +1,26 @@
{{ define "main" }}
{{ if .Params.id }}
{{- partial "hero.html" (dict "hero" .Params "color" .Site.Params.color "odd" 0) -}}
{{ end }}
{{.Content}}
<div>
{{- range $index, $page := .Pages }}
{{ $odd := mod (add $index 1) 2 }}
{{ if eq .Params.type "slider" }}
{{- partial "slider.html" (dict "id" $page.File.ContentBaseName "slider" .Params "color" $.Site.Params.color "odd" $odd) -}}
{{ else if eq .Params.type "hero" }}
{{- partial "hero.html" (dict "id" $page.File.ContentBaseName "hero" .Params "color" $.Site.Params.color "odd" $odd) -}}
{{ else if eq .Params.type "video" }}
{{- partial "video.html" (dict "id" $page.File.ContentBaseName "video" .Params "odd" $odd) -}}
{{ else if eq .Params.type "service" }}
{{- partial "service.html" (dict "id" $page.File.ContentBaseName "service" .Params "content" .Content "odd" $odd) -}}
{{ else if eq .Params.type "contact" }}
{{- partial "contact.html" (dict "id" $page.File.ContentBaseName "contact" .Params "odd" $odd) -}}
{{ else if eq .Params.type "logos" }}
{{- partial "logos.html" (dict "id" $page.File.ContentBaseName "logos" .Params "odd" $odd) -}}
{{ else if eq .Params.type "links" }}
{{- partial "links.html" (dict "id" $page.File.ContentBaseName "links" .Params "defaultimage" $.Site.Params.defaultimage "odd" $odd) -}}
{{ end }}
{{ end }}
</div>
{{ end }}

View file

@ -1,18 +1,15 @@
<!DOCTYPE html>
<html lang="{{ .Site.LanguageCode }}">
{{- partial "head.html" . -}}
<body>
{{- partial "header.html" . -}}
{{ block "main" . }}
<div class="article">
{{ define "main" }}
{{ with .Params.image }}
<img class="coverimage" src="{{ . }}" />
{{ end }}
<div class="content">
{{ with .Title }}
<div class="title">
<h1 class="content-title">{{ .Title }}</h1>
<h1 class="content-title">{{ . }}</h1>
<div class="divider"></div>
</div>
<!-- <h6>{{ .Date.Format "Mon, Jan 2, 2006" }}</h6> -->
{{ .Content }}
</div>
{{ end }}
{{- partial "footer.html" . -}}
</body>
</html>
<!-- <h6>{{ .Date.Format "Mon, Jan 2, 2006" }}</h6> -->
{{ .Content }}
</div>
{{ end }}

View file

@ -0,0 +1,20 @@
{{ define "main" }}
<div class="content">
<article>
<div class="title">
<h1 class="content-title">{{ .Title }}</h1>
<div class="divider"></div>
</div>
</article>
<!-- Ranges through content/posts/*.md -->
<div class="cardList">
{{ range .Pages }}
<a href="{{.Permalink}}">
<div class="smallCard">
<div class="cardTitle">{{.Title}}</div>
</div>
</a>
{{ end }}
</div>
</div>
{{ end }}