summaryrefslogtreecommitdiff
path: root/layouts/_default
diff options
context:
space:
mode:
authorMichał Sapka <michal@sapka.me>2023-01-02 22:15:10 +0100
committerMichał Sapka <michal@sapka.me>2023-01-02 22:15:10 +0100
commit98c04aa1e19e9391a19daf903a024e7ebeaeb36b (patch)
treefbc4a9729a479331f0b33fb613250dad619c95ec /layouts/_default
parent679e6588d1ef6709f9e579f8ab2fa1b3ad2ac9d8 (diff)
feat: blank based on memes
Diffstat (limited to 'layouts/_default')
-rw-r--r--layouts/_default/baseof.html80
-rw-r--r--layouts/_default/list.html12
-rw-r--r--layouts/_default/list.txt5
-rw-r--r--layouts/_default/single.html33
4 files changed, 130 insertions, 0 deletions
diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html
new file mode 100644
index 0000000..b0bfc6f
--- /dev/null
+++ b/layouts/_default/baseof.html
@@ -0,0 +1,80 @@
+<!DOCTYPE html>
+<HTML lang="en">
+ <HEAD>
+ <META charset="utf-8">
+ <TITLE>{{ block "title" . }}
+ {{ .Site.Title }}
+ {{ end }}</TITLE>
+ <link rel='stylesheet' type='text/css' href='/style.css'>
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
+ {{- $image := resources.Get "/icons/apple-touch-icon.png"}}
+ <link rel="apple-touch-icon" sizes="180x180" href="{{ $image.Permalink }}">
+ {{- $image := resources.Get "/icons/favicon-32x32.png" }}
+ <link rel="icon" type="image/png" sizes="32x32" href="{{ $image.Permalink }}">
+ {{- $image := resources.Get "/icons/favicon-16x16.png" }}
+ <link rel="icon" type="image/png" sizes="16x16" href="{{ $image.Permalink }}">
+
+ <meta property="og:title" content="{{ .Page.Title }}" />
+ <meta property="og:type" content="website" />
+ <meta property="og:url" content="{{ .Page.Permalink }}" />
+ {{- $imageUrl := default "logo.png" .Params.image }}
+ {{- $image := resources.Get $imageUrl }}
+ <meta property="og:image" content="{{ $image.Permalink }}" />
+
+ <meta name="twitter:title" content="{{ .Page.Title }}">
+ <meta name="twitter:image" content="{{ $image.Permalink }}">
+ <meta name="twitter:card" content="summary_large_image">
+
+ <link rel="canonical" href="{{ .Site.BaseURL }}">
+ <link rel='alternate' type='application/rss+xml' title="{{ .Site.Title }} RSS" href='/index.xml'>
+ <meta name="robots" content="index, follow">
+ {{ if isset .Params "tags" }}<meta name="keywords" content="{{ with .Params.tags }}{{ delimit . ", " }}{{ end }}">{{end}}
+ </HEAD>
+ <BODY>
+ {{ block "header" . }}
+ <HEADER>
+ {{ $image := resources.Get "logo.png" }}
+ {{ $image := $image.Resize "x45" }}
+ <a href="/">
+ <img alt="logo" src="{{ $image.Permalink }}" width={{$image.Width}} height={{$image.Height}}/>
+ <div>
+ <h1>{{ .Site.Title }}</h1>
+ (because giphy sucks)
+ </div>
+ </a>
+ </HEADER>
+ {{ end }}
+ <MAIN>
+ {{ block "page-title" . }}
+ <h2> {{ .Page.Title }}</h2>
+ {{ end }}
+ {{ block "main" . }}
+ {{ end }}
+ </MAIN>
+
+ {{ block "FOOTER" . }}
+ <FOOTER>
+ <ASIDE>
+ <BR>
+ Terms and conditions
+ <OL>
+ <li> I don't care who you are so I won't track you.
+ <li> I have stolen all those memes so I have no rights to them.
+ <li> You will not kill my server.
+ </OL>
+ </ASIDE>
+ <div>
+ Created by <a href="https://sapka.me" target="_blank">Michal</a>
+ <BR>
+ <BR>
+ <a href="/index.xml">
+ {{ $image := resources.Get "rss.png" }}
+ {{ $image := $image.Resize "x25" }}
+ <img alt="rss" src="{{ $image.Permalink }}" width={{$image.Width}} height={{$image.Height}}/>
+ </a>
+ </div>
+
+ </FOOTER>
+ {{ end }}
+ </BODY>
+</HTML>
diff --git a/layouts/_default/list.html b/layouts/_default/list.html
new file mode 100644
index 0000000..cc3addd
--- /dev/null
+++ b/layouts/_default/list.html
@@ -0,0 +1,12 @@
+{{ define "main" }}
+ {{ range where .Pages "Params.category" "meme"}}
+ <article class="list">
+ <a href="{{ .RelPermalink }}">
+ {{ $imageUrl := .Param "image" }}
+ {{ $image := resources.Get $imageUrl }}
+ {{ $image := $image.Resize "350x" }}
+ <img alt="{{ .Param "title"}}" src="{{ $image.Permalink }}" width={{ $image.Width }} height={{ $image.Height }}/>
+ </a>
+ </article>
+ {{ end }}
+{{ end }}
diff --git a/layouts/_default/list.txt b/layouts/_default/list.txt
new file mode 100644
index 0000000..047ea33
--- /dev/null
+++ b/layouts/_default/list.txt
@@ -0,0 +1,5 @@
+{{- range where .Pages "Params.category" "meme"}}
+ {{- $imageUrl := .Param "image" }}
+ {{- $image := resources.Get $imageUrl }}
+ {{- $image.Permalink }}
+{{ end }}
diff --git a/layouts/_default/single.html b/layouts/_default/single.html
new file mode 100644
index 0000000..47ec310
--- /dev/null
+++ b/layouts/_default/single.html
@@ -0,0 +1,33 @@
+{{ define "title" }}
+{{ end }}
+
+{{ define "main" }}
+{{ $imageUrl := .Params.image }}
+{{ $image := resources.Get $imageUrl }}
+{{ $image := $image.Resize "790x" }}
+<img alt="{{ .Params.title }}" src="{{ $image.Permalink }}" width={{ $image.Width }} height={{ $image.Height }}/><BR/>
+<hr/>
+added on {{ .PublishDate.Format "January 2, 2006" }}
+{{- if isset .Params "tags" -}}
+ {{- $tagsLen := len .Params.tags -}}
+ {{- if gt $tagsLen 0 -}}
+ &nbsp;with tags:
+ {{- range $k, $v := .Params.tags -}}
+ {{- $url := printf "tags/%s" (. | urlize | lower) -}}
+ <a href="{{ $url | absURL }}"> {{ . | title }}</a>
+ {{- if lt $k (sub $tagsLen 1) }} &middot; {{ end -}}
+ {{- end -}}
+ </div>
+ {{- end -}}
+{{- end }}
+<hr/>
+
+{{ if or .Next .Prev -}}
+<div>
+ {{- with .Prev }} <a class="prev-link" href="{{ .RelPermalink}}"> &#8592; Previous</a> {{ end -}}
+ {{- with .Next -}}<a class="next-link" href="{{ .RelPermalink}}">Next &#8594;</a> {{ end -}}
+</div>
+{{ end -}}
+
+{{ end }}
+