Initialisierung

This commit is contained in:
mdn 2022-11-13 20:52:45 +01:00
parent 4084518848
commit 6dd9fa38f6
116 changed files with 17349 additions and 2 deletions

View file

@ -0,0 +1,8 @@
<footer class="footer bg-dark text-white">
<nav class="nav justify-content-center navbar-expand-md navbar-dark ">
<a class="nav-link" href="#">Impressum & Datenschutz</a>
<a class="nav-link" href="#">RSS-Feed</a>
</nav>
<p><a class="nav-link" href="#"><small>&copy; 2009-{{ now.Format "2006"}} MarcoDN</small></a></p>
</footer>

View file

@ -0,0 +1,24 @@
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, intial-scale=1">
<meta name="author" content="{{ .Site.Params.Author }}">
{{ $title := print .Site.Title " | " .Title }}
{{ if .IsHome }}{{ $title := .Site.Title }} {{ end }}
<title>{{ $title }}</title>
<meta name="description" content="{{ with .Description }}{{ . }}{{ else }}{{ if .IsPage }}{{ .Summary }}{{ else }}{{ with .Site.Params.description }}{{ . }}{{ end }}{{ end }}{{ end }}">
{{/* compressed soll besser sein als minify bei SASS */}}
{{ $sassOptions := (dict "targetPath" "main.css" "outputStyle" "compressed" "enableSourceMap" (not hugo.IsProduction) "includePaths" "assets/bootstrap/scss") }}
{{ $sassStyle := resources.Get "_own/sass/main.scss" | resources.ToCSS $sassOptions | minify }}
<link rel="stylesheet" type="text/css" href="{{ $sassStyle.RelPermalink | relURL }}">
{{ $style := resources.Match "_own/css/**.css" | resources.Concat "css/custom.css" | minify }}{{/* .Resources.GetMatch "css/**.css" */}}
<link rel="stylesheet" type="text/css" href="{{ $style.RelPermalink | relURL }}">
{{ if isset .Site.Params "custom_css" }}
{{ range .Site.Params.custom_css }}
<link rel="stylesheet" type="text/css" href="{{ $.Site.BaseURL }}{{ . }}">
{{ end }}
{{ end }}
</head>

View file

@ -0,0 +1,31 @@
<header class="fixed-top_" style="padding-bottom: 3px;">
<div class="px-3 py-2 text-bg-dark">
<div class="container">
<div class="d-flex flex-wrap align-items-center justify-content-center justify-content-lg-start">
<a href="/" class="d-flex align-items-center my-2 my-lg-0 me-lg-auto text-white text-decoration-none">
<!-- TODO Via SVG eigenes Icon vielleicht mal zeichnen wie bei Bootstrap mit MDN als Inhalt -->
<i class="bi me-2" data-feather="home"></i>
{{ if .IsHome }}
{{ print .Site.Title }}
{{ else }}
{{ print .Site.Title " | " .Title }}
{{ end }}
</a>
<nav id="nav" class="nav col-12 col-lg-auto my-2 justify-content-center my-md-0 text-small navbar-expand-md navbar-dark bg-dark">
{{ range .Site.Menus.main }}
<!-- text-secondary bei der aktiven Url sonst text-white -->
<a class="nav-link text-white" href="{{ .URL }}">
{{ if .Pre }}
{{ $icon := printf "<i class=\"bi d-block mx-auto mb-1\" data-feather=\"%s\"></i>" .Pre | safeHTML }}
{{ $icon }}
{{ end}}
{{ $text := print .Name | safeHTML }}
{{ $text }}
</a>
{{ end }}
</nav>
</div>
</div>
</div>
</header>

View file

@ -0,0 +1,8 @@
{{ $dateTime := .PublishDate.Format "2006-01-02" }}
{{ $dateTimeMod := .Lastmod.Format "2006-01-02" }}
{{ $dateFormat := .Site.Params.dateFormat | default "Jan 2, 2006" }}
<i data-feather="calendar"></i>
<time datetime="{{ $dateTime }}">{{ .PublishDate.Format $dateFormat }}</time>
<i data-feather="user"></i>
{{ .Page.Params.Author }}
<span class="badge bg-secondary"><time datetime="{{ $dateTimeMod }}">{{ .Lastmod.Format $dateFormat }}</time>)</span>

View file

@ -0,0 +1,20 @@
{{ with .Params.tags }}
<i data-feather="tag"></i>
<i class="bi bi-tag"></i> <!-- TODO: umstellen auf bootstrap-icons??? -->
{{ range . }}
{{ $href := print (absURL "tags/") (urlize .) }}
<a class="btn btn-sm btn-outline-dark tag-btn" href="{{ $href }}">{{ . }}</a>
{{ end }}
{{ end }}
&nbsp;
{{ with .Params.categories }}
<!-- list -->
<i data-feather="award"></i>
{{ range . }}
{{ $href := print (absURL "categories/") (urlize .) }}
<a class="btn btn-sm btn-outline-dark tag-btn" href="{{ $href }}">{{ . }}</a>
{{ end }}
{{ end }}

View file

@ -0,0 +1,37 @@
{{ $pag := $.Paginator }}
{{ if gt $pag.TotalPages 1 }}
{{ $.Scratch.Set "dot_rendered" false }}
<nav aria-label="page navigation">
<ul class="pagination">
<!-- Don't show on 1st and 2nd page -->
{{ if and (ne $pag.PageNumber 1) (ne $pag.PageNumber 2) }}
<li class="page-item"><a href="{{ $pag.First.URL }}" rel="first" class="page-link">&laquo;</a></li>
{{ end }}
{{ if $pag.HasPrev }}
<li class="page-item"><a href="{{ $pag.Prev.URL }}" rel="prev" class="page-link">&lsaquo;</a></li>
{{ end }}
{{ range $pag.Pagers }}
{{ if eq . $pag }} <!-- Current Page -->
<li class="page-item active"><a href="{{ .URL }}" class="page-link">{{ .PageNumber }}</a></li>
{{ else if and (ge .PageNumber (sub $pag.PageNumber 2)) (le .PageNumber (add $pag.PageNumber 2)) }}
{{ $.Scratch.Set "dot_rendered" false }} <!-- Render prev 2 page and next 2 pages -->
<li class="page-item"><a href="{{ .URL }}" class="page-link">{{ .PageNumber }}</a></li>
{{ else if eq ($.Scratch.Get "dot_rendered") false }} <!-- render skip pages -->
{{ $.Scratch.Set "dot_rendered" true }}
<li class="page-item disabled"><a class="page-link">...</a></li>
{{ end }}
{{ end }}
{{ if $pag.HasNext }}
<li class="page-item"><a href="{{ $pag.Next.URL }}" rel="next" class="page-link">&rsaquo;</a></li>
{{ end }}
<!-- Don't show on last and 2nd last page -->
{{ if and (ne $pag.PageNumber $pag.TotalPages) ((ne $pag.PageNumber (sub $pag.TotalPages 1))) }}
<li class="page-item"><a href="{{ $pag.Last.URL }}" rel="last" class="page-link">&raquo;</a></li>
{{ end }}
</ul>
</nav>
{{ end }}

View file

@ -0,0 +1,16 @@
{{ $bootstrapJs := resources.Get "bootstrap/js/bootstrap.bundle.min.js" }}
<script src="{{ $bootstrapJs.Permalink | relURL }}"></script>
{{ $featherJs := resources.Get "feather/js/feather.min.js" }}
<script src="{{ $featherJs.Permalink | relURL }}"></script>
{{ $mainJs := resources.Get "_own/js/main.js" | js.Build | minify }}
<script src="{{ $mainJs.Permalink | relURL }}"></script>
{{- range .Site.Params.custom_js -}}
<script src="{{ $.Site.BaseURL }}{{ . }}"></script>
{{ end }}
<script>
feather.replace();
</script>