optimizations for nicer looking raw html
This commit is contained in:
parent
2b06ee5dfa
commit
59c38330f6
7 changed files with 232 additions and 221 deletions
|
@ -26,7 +26,7 @@ menu:
|
|||
- identifier: fediverse
|
||||
name: fediverse
|
||||
title: fediverse
|
||||
url: https://fedi.vrifox.cc/vrifox
|
||||
url: https://fedi.vrifox.cc/users/vrifox
|
||||
weight: 1
|
||||
- identifier: git
|
||||
name: git
|
||||
|
|
|
@ -1,15 +1,12 @@
|
|||
<!doctype html>
|
||||
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>{{ with .Title }} {{ . }} – {{ end }}{{ .Site.Title }}</title>
|
||||
|
||||
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
{{ block "stylesheet" . }}{{ end }}
|
||||
<link rel="icon" type="image/png" href="{{ "/favicon.png" | relURL }}">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
{{ partial "nav.html" . }}
|
||||
{{ block "main" . }}{{ end }}
|
||||
|
|
|
@ -1,26 +1,28 @@
|
|||
{{ define "stylesheet" }}{{ $scss := resources.Get "/_default/list.scss" }}{{ $style := $scss | resources.ToCSS }}
|
||||
{{- define "stylesheet" -}}
|
||||
{{- $scss := resources.Get "/_default/list.scss" -}}
|
||||
{{- $style := $scss | resources.ToCSS -}}
|
||||
<link rel="stylesheet" href="{{ $style.Permalink }}" type="text/css" media="screen" rel="preload" />
|
||||
{{ end }}
|
||||
{{- end -}}
|
||||
|
||||
{{ define "main" }}
|
||||
<main>
|
||||
{{- define "main" }}
|
||||
<main>
|
||||
<div class="container">
|
||||
<section class="section posts">
|
||||
<div class="section posts inner">
|
||||
{{ range .Pages }}
|
||||
{{- range .Pages }}
|
||||
<a href="{{ .Permalink }}">
|
||||
<article>
|
||||
<h1><span>{{ .Title }}</span></h1>
|
||||
{{ with .Description }}<p class="description">{{ . }}</p>{{ end }}
|
||||
<p class="meta" title="{{ .Date.Format "2 Jan 2006, 15:04 MST" }}">
|
||||
<span class="date">{{ .Date.Format "2 January 2006" }}</span>
|
||||
<span class="author">{{ with .Params.author }}by {{ end }}{{ .Params.author }}</span>
|
||||
{{- with .Params.author }}<span class="author">by {{ . }}</span>{{ end }}
|
||||
</p>
|
||||
</article>
|
||||
</a>
|
||||
{{ end }}
|
||||
{{- end }}
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</main>
|
||||
{{ end }}
|
||||
</main>
|
||||
{{- end }}
|
||||
|
|
|
@ -1,63 +1,69 @@
|
|||
{{ define "stylesheet" }}{{ $scss := resources.Get "/_default/single.scss" }}{{ $style := $scss | resources.ToCSS }}
|
||||
{{- define "stylesheet" -}}
|
||||
{{- $scss := resources.Get "/_default/single.scss" -}}
|
||||
{{- $style := $scss | resources.ToCSS -}}
|
||||
<link rel="stylesheet" href="{{ $style.Permalink }}" type="text/css" media="screen" rel="preload" />
|
||||
{{ end }}
|
||||
{{- end -}}
|
||||
|
||||
{{ define "main" }}
|
||||
<main>
|
||||
{{- define "main" -}}
|
||||
<main>
|
||||
<div class="container">
|
||||
<section class="section-article">
|
||||
<article>
|
||||
<p class="meta">
|
||||
{{ if eq .Params.type "post" }}<span title="{{ .Date.Format "2. January 2006, 15:04 MST" }}">{{ .Date.Format "2. January 2006" }}</span>{{ end }}
|
||||
{{ if eq .Params.type "singlepage" }}<span title="{{ .Date.Format "2. January 2006" }}">version: {{ .Date.Format "2006-01-02" }}</span>{{ end }}
|
||||
<span>{{ with .Params.author }}by {{ end }}{{ .Params.author }}</span>
|
||||
{{- if eq .Params.type "singlepage" }}<span title="{{ .Date.Format "2. January 2006" }}">version: {{ .Date.Format "2006-01-02" }}</span>{{ end }}
|
||||
{{- with .Params.author }}<span>by {{ . }}</span>{{ end }}
|
||||
</p>
|
||||
<h1 class="title">{{ .Title }}</h1>
|
||||
{{ with .Params.featured_image }}<img src="{{ . | relURL }}" loading="lazy" alt="">{{ end }}
|
||||
|
||||
{{ printf "<!-- content -->" | safeHTML }}
|
||||
{{ .Content }}
|
||||
{{- printf "<!-- content END -->" | safeHTML }}
|
||||
|
||||
<aside class="meta">
|
||||
{{ with .Params.topics }}
|
||||
{{- with .Params.topics }}
|
||||
<ul class="topics">
|
||||
{{ range . }}
|
||||
{{- range . }}
|
||||
<li>
|
||||
<a href="{{ "topics" | relURL}}/{{ . | urlize }}">{{ . }}</a>
|
||||
</li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
{{ end }}
|
||||
{{ with .Params.tags }}
|
||||
{{- end }}
|
||||
{{- with .Params.tags }}
|
||||
<h3>tags</h3>
|
||||
<ul class="tags">
|
||||
{{ range . }}
|
||||
{{- range . }}
|
||||
<li>
|
||||
<a href="{{ "tags" | relURL }}/{{ . | urlize }}">{{ . }}</a>
|
||||
</li>
|
||||
{{ end }}
|
||||
{{- end }}
|
||||
</ul>
|
||||
{{ end }}
|
||||
{{- end }}
|
||||
</aside>
|
||||
</article>
|
||||
</section>
|
||||
{{ if ne .Params.type "singlepage" }}
|
||||
{{- if ne .Params.type "singlepage" }}
|
||||
<section class="section-articles">
|
||||
<article class="next-article">
|
||||
{{ with .NextInSection }}
|
||||
{{- with .NextInSection }}
|
||||
<a href="{{ .Permalink }}">
|
||||
{{ if eq .Params.type "project" }}← next project{{ end }}
|
||||
{{ if ne .Params.type "project" }}← next article{{ end }}
|
||||
</a>
|
||||
{{ end }}
|
||||
{{- end }}
|
||||
</article>
|
||||
<article class="previous-article">
|
||||
{{ with .PrevInSection }}<span></span>
|
||||
{{- with .PrevInSection }}<span></span>
|
||||
<a href="{{ .Permalink }}">
|
||||
{{ if eq .Params.type "project" }}previous project →{{ end }}
|
||||
{{ if ne .Params.type "project" }}previous article →{{ end }}
|
||||
{{- if eq .Params.type "project" }}previous project →{{ end -}}
|
||||
{{- if ne .Params.type "project" }}previous article →{{ end -}}
|
||||
</a>
|
||||
{{ end }}
|
||||
{{- end }}
|
||||
</article>
|
||||
</section>
|
||||
{{ end }}
|
||||
{{- end }}
|
||||
</div>
|
||||
</main>
|
||||
{{ end }}
|
||||
</main>
|
||||
{{- end }}
|
||||
|
|
|
@ -1,9 +1,11 @@
|
|||
{{ define "stylesheet" }}{{ $scss := resources.Get "/index.scss" }}{{ $style := $scss | resources.ToCSS }}
|
||||
{{- define "stylesheet" -}}
|
||||
{{- $scss := resources.Get "/index.scss" -}}
|
||||
{{- $style := $scss | resources.ToCSS -}}
|
||||
<link rel="stylesheet" href="{{ $style.Permalink }}" type="text/css" media="screen" />
|
||||
{{ end }}
|
||||
{{- end -}}
|
||||
|
||||
{{ define "main" }}
|
||||
<section class="section header">
|
||||
{{- define "main" -}}
|
||||
<section class="section header">
|
||||
<div class="container">
|
||||
<header>
|
||||
<h1>{{ .Params.heading }}</h1>
|
||||
|
@ -11,36 +13,40 @@
|
|||
</header>
|
||||
<section class="section contact">
|
||||
<table class="table contact">
|
||||
{{ range sort .Params.contact "weight" "asc" }}
|
||||
{{- range sort .Params.contact "weight" "asc" }}
|
||||
<tr>
|
||||
<td>{{ .name }}</td>
|
||||
<td>
|
||||
{{ with .url }}<a href="{{ . }}">{{ end }}
|
||||
{{- with .url }}<a href="{{ . }}">{{ end -}}
|
||||
{{ .handle }}
|
||||
{{ with .url }}</a>{{ end }}
|
||||
{{ with .hint }}<a href="{{ .url }}">{{ .name }}</a>{{ end }}
|
||||
{{- with .url }}</a>{{ end -}}
|
||||
{{- with .hint }}<a href="{{ .url }}">{{ .name }}</a>{{ end -}}
|
||||
</td>
|
||||
</tr>
|
||||
{{ end }}
|
||||
{{- end }}
|
||||
</table>
|
||||
</section>
|
||||
</div>
|
||||
</section>
|
||||
<main>
|
||||
</section>
|
||||
|
||||
<main>
|
||||
<div class="container">
|
||||
<section class="section projects">
|
||||
<span class="latest">
|
||||
latest <a href="{{ "/projects" | relURL }}">projects</a>
|
||||
</span>
|
||||
<div class="section projects inner">
|
||||
{{ range first 4 (where .Site.RegularPages "Type" "project") }}
|
||||
{{- range first 4 (where .Site.RegularPages "Type" "project") }}
|
||||
<a href="{{ .Permalink }}">
|
||||
<article>
|
||||
<h1>{{ .Title }}</h1>
|
||||
<p class="meta">{{ with .Params.activetime }}<span class="date">{{ . }}</span>{{ end }}<br />{{ with .Params.status }}<span class="status">{{ . }}</span>{{ end }}</p>
|
||||
<p class="meta">
|
||||
{{ with .Params.activetime }}<span class="date">{{ . }}</span>{{ end }}<br />
|
||||
{{ with .Params.status }}<span class="status">{{ . }}</span>{{ end }}
|
||||
</p>
|
||||
</article>
|
||||
</a>
|
||||
{{ end }}
|
||||
{{- end }}
|
||||
</div>
|
||||
</section>
|
||||
<hr>
|
||||
|
@ -49,7 +55,7 @@
|
|||
latest <a href="{{ "/blog" | relURL }}">posts</a>
|
||||
</span>
|
||||
<div class="section posts inner">
|
||||
{{ range first 4 (where .Site.RegularPages "Type" "post") }}
|
||||
{{- range first 4 (where .Site.RegularPages "Type" "post") }}
|
||||
<a href="{{ .Permalink }}">
|
||||
<article>
|
||||
<h1><span>{{ .Title }}</span></h1>
|
||||
|
@ -60,9 +66,9 @@
|
|||
</p>
|
||||
</article>
|
||||
</a>
|
||||
{{ end }}
|
||||
{{- end }}
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</main>
|
||||
{{ end }}
|
||||
</main>
|
||||
{{- end }}
|
||||
|
|
|
@ -1,20 +1,21 @@
|
|||
<footer>
|
||||
|
||||
<footer>
|
||||
<div class="container">
|
||||
<section class="website-version">
|
||||
<span title="{{ now.Format "2. January 2006, 15:04 MST" }}">version {{ now.Format "2006-01-02" }}</span>
|
||||
</section>
|
||||
<section class="website-subnav">
|
||||
<ul>
|
||||
{{ $currentPage := . }}
|
||||
{{ range .Site.Menus.footer }}
|
||||
{{- $currentPage := . }}
|
||||
{{- range .Site.Menus.footer }}
|
||||
<li>
|
||||
<a href="{{ .URL }}">
|
||||
{{ .Pre }}
|
||||
{{- .Pre }}
|
||||
<span>{{ .Name }}</span>
|
||||
</a>
|
||||
</li>
|
||||
{{ end }}
|
||||
{{- end }}
|
||||
</ul>
|
||||
</section>
|
||||
</div>
|
||||
</footer>
|
||||
</footer>
|
||||
|
|
|
@ -1,47 +1,46 @@
|
|||
{{ $currentPage := . }}
|
||||
|
||||
<nav>
|
||||
{{ $currentPage := . }}
|
||||
<nav>
|
||||
<div class="container">
|
||||
<section class="website-name">
|
||||
{{ range .Site.Menus.name }}
|
||||
{{ if $currentPage.IsMenuCurrent "name" . }}
|
||||
{{- range .Site.Menus.name }}
|
||||
{{- if $currentPage.IsMenuCurrent "name" . }}
|
||||
<a href="{{ .URL }}" class="active">{{ .Name }}</a>
|
||||
{{ else }}
|
||||
{{- else }}
|
||||
<a href="{{ .URL }}">{{ .Name }}</a>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
</section>
|
||||
<span class="seperator">/</span>
|
||||
<section class="website-mainmenu">
|
||||
<ul>
|
||||
{{ range .Site.Menus.main }}
|
||||
{{ if or ($currentPage.IsMenuCurrent "main" .) ($currentPage.HasMenuCurrent "main" .) }}
|
||||
{{- range .Site.Menus.main -}}
|
||||
{{ if or ($currentPage.IsMenuCurrent "main" .) ($currentPage.HasMenuCurrent "main" .) -}}
|
||||
<li class="active">
|
||||
<a href="{{ .URL }}">
|
||||
<span>{{ .Name }}</span>
|
||||
</a>
|
||||
</li>
|
||||
{{ else }}
|
||||
{{- else }}
|
||||
<li>
|
||||
<a href="{{ .URL }}">
|
||||
<span>{{ .Name }}</span>
|
||||
</a>
|
||||
</li>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
</ul>
|
||||
</section>
|
||||
<section class="website-externallinks">
|
||||
<ul>
|
||||
{{ range .Site.Menus.externallinks }}
|
||||
{{- range .Site.Menus.externallinks }}
|
||||
<li>
|
||||
<a title="{{ .URL }}" href="{{ .URL }}">
|
||||
{{ .Pre }}
|
||||
{{- .Pre }}
|
||||
<span>{{ .Name }}</span>
|
||||
</a>
|
||||
</li>
|
||||
{{ end }}
|
||||
{{- end }}
|
||||
</ul>
|
||||
</section>
|
||||
</div>
|
||||
</nav>
|
||||
</nav>
|
||||
|
|
Loading…
Reference in a new issue