Skip to content

Commit

Permalink
Improve template readability
Browse files Browse the repository at this point in the history
  • Loading branch information
janheinrichmerker committed Mar 4, 2024
1 parent 64c7ab0 commit 6e00a55
Show file tree
Hide file tree
Showing 7 changed files with 38 additions and 38 deletions.
2 changes: 1 addition & 1 deletion data/skills.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
- name: CSS
url: https://w3.org/Style/CSS/
- name: TypeScript
url: https://www.typescriptlang.org/
url: https://typescriptlang.org/
- name: Elm
url: https://elm-lang.org/
- name: Bash Script
Expand Down
26 changes: 13 additions & 13 deletions layouts/_default/baseof.html
Original file line number Diff line number Diff line change
@@ -1,36 +1,36 @@
<!DOCTYPE html>
<html lang='{{ $.Site.LanguageCode | default "en" }}'>
<html lang='{{ site.LanguageCode | default "en" }}'>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
{{/* NOTE: the Site's title, and if there is a page title, that is set too */}}
<title>{{ block "title" . }}{{ with .Params.Title }}{{ . }} • {{ end }}{{ $.Site.Title }}{{ end }}</title>
<title>{{ block "title" . }}{{ with .Params.Title }}{{ . }} • {{ end }}{{ site.Title }}{{ end }}</title>
<meta name="viewport" content="width=device-width,minimum-scale=1">
{{- hugo.Generator -}}

{{/* NOTE: For Production make sure you add `HUGO_ENV="production"` before your build command */}}
{{- if eq $.Site.Params.env "production" -}}
{{- if eq site.Params.env "production" -}}
<meta name="robots" content="index, follow">
{{- else -}}
<meta name="robots" content="noindex, nofollow">
{{- end -}}

{{- block "styles" . -}}
{{- partial "site/styles" $ -}}
{{- partial "site/styles" page -}}
{{- end -}}

{{- block "favicon" . -}}
{{- partial "site/favicon" $ -}}
{{- partial "site/favicon" page -}}
{{- end -}}

{{- with .OutputFormats.Get "RSS" -}}
<link href="{{ .RelPermalink }}" rel="alternate" type="application/rss+xml" title="{{ $.Site.Title }}"/>
<link href="{{ .RelPermalink }}" rel="feed" type="application/rss+xml" title="{{ $.Site.Title }}"/>
<link href="{{ .RelPermalink }}" rel="alternate" type="application/rss+xml" title="{{ site.Title }}"/>
<link href="{{ .RelPermalink }}" rel="feed" type="application/rss+xml" title="{{ site.Title }}"/>
{{- end -}}

{{- range $.Site.Languages -}}
{{- if ne . $.Site.Language -}}
{{- range $.Translations -}}
{{- range site.Languages -}}
{{- if ne . site.Language -}}
{{- range page.Translations -}}
<link href="{{ .Permalink }}" hreflang="{{ .Language }}" rel="alternate"/>
{{- end -}}
{{- end -}}
Expand All @@ -45,14 +45,14 @@
<body class="{{ if .IsHome }} home {{ else }} page-{{ anchorize .Title }} {{ end }}">

{{ block "navigation" . }}
{{ partial "site/navigation" $ }}
{{ partial "site/navigation" page }}
{{ end }}

<main>
{{ block "main" . }}{{ end }}
</main>
{{ block "footer" . }}{{ partial "site/footer" $ }}{{ end }}
{{ block "scripts" . }}{{ partial "site/scripts" $ }}{{ end }}
{{ block "footer" . }}{{ partial "site/footer" page }}{{ end }}
{{ block "scripts" . }}{{ partial "site/scripts" page }}{{ end }}

</body>
</html>
10 changes: 5 additions & 5 deletions layouts/partials/site/favicon.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
<link rel="icon" type="image/png" sizes="32x32" href="{{ "/favicon-32x32.png" | relURL }}">
<link rel="icon" type="image/png" sizes="16x16" href="{{ "/favicon-16x16.png" | relURL }}">
<link rel="manifest" href="{{ "/site.webmanifest" | relURL }}">
<link rel="mask-icon" href="{{ "/safari-pinned-tab.svg" | relURL }}" color="{{ $.Site.Params.themeColor }}">
<meta name="apple-mobile-web-app-title" content="{{ $.Site.Title }}">
<meta name="application-name" content="{{ $.Site.Title }}">
<meta name="msapplication-TileColor" content="{{ $.Site.Params.colors.theme }}">
<meta name="theme-color" content="{{ $.Site.Params.colors.background }}">
<link rel="mask-icon" href="{{ "/safari-pinned-tab.svg" | relURL }}" color="{{ site.Params.themeColor }}">
<meta name="apple-mobile-web-app-title" content="{{ site.Title }}">
<meta name="application-name" content="{{ site.Title }}">
<meta name="msapplication-TileColor" content="{{ site.Params.colors.theme }}">
<meta name="theme-color" content="{{ site.Params.colors.background }}">
14 changes: 7 additions & 7 deletions layouts/partials/site/footer.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
{{- end -}}
<footer>
<p>
<a href='{{ relref $ "/imprint#license" }}'
<a href='{{ relref page "/imprint#license" }}'
title="CC0 1.0 Universal Public Domain Dedication">
<i class="fa-brands fa-creative-commons-zero"></i>
</a> {{ now.Format "2006" }} {{ $.Site.Data.facts.name }}.
</a> {{ now.Format "2006" }} {{ site.Data.facts.name }}.
</p>
{{ if (or $.Site.Menus.footer $.Site.IsMultiLingual) }}
{{ if (or site.Menus.footer site.IsMultiLingual) }}
<ul>
{{ range $.Site.Menus.footer }}
{{ range site.Menus.footer }}
<li>
{{- $url := .URL -}}
{{- if eq .Identifier "source" -}}
Expand All @@ -20,9 +20,9 @@
<a href="{{ $url }}" title="{{ .Name }}">{{ .Name }}</a>
</li>
{{ end }}
{{ range $.Site.Languages }}
{{ if ne . $.Site.Language }}
{{ range $.Translations }}
{{ range site.Languages }}
{{ if ne . site.Language }}
{{ range page.Translations }}
<li>
<a href="{{ .Permalink }}" title="{{ .Language.LanguageName }}">{{ upper .Language }}</a>
</li>
Expand Down
6 changes: 3 additions & 3 deletions layouts/partials/site/navigation.html