Commit cbdaff92 authored by Sylvain Kerkour's avatar Sylvain Kerkour

minimal template

parent fe9311bf
// document ready
$(document).ready(function() {
// deofuscate emails
var emails = document.getElementsByClassName("obfuscated-email");
if (emails) {
for (var i = 0; i < emails.length; i += 1) {
emails[i].innerHTML = rot13(window.obfuscatedEmail);
}
}
// open all links in new tab
$(document.links).filter(function() {
return this.hostname != window.location.hostname;
}).attr('target', '_blank').attr('rel', 'noopener');
});
// from https://manuelmoreale.com/
$font-family-serif: "Iowan Old Style", "Iowan", "Charter", "Palatino Linotype", "Palatino", "Book Antiqua", "Palatino LT STD", "Times New Roman", Times, serif;
// from bootstrap
$font-family-sans-serif: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";
$font-family-code: monospace;
$font-size-base: 18px;
$font-size-small: 16px;
$font-color: #424242;
@import "theme.scss";
@import "const.scss";
body {
margin: 0 auto;
font-family: $font-family-serif;
font-size: $font-size-base;
line-height: 1.5;
color: $font-color;
background-color: #ffffff;
@media (max-width: 600px) {
font-size: $font-size-small;
}
max-width: 800px;
padding: 0 21px;
}
nav {
.active {
text-decoration: underline;
}
a {
padding-right: 5px;
}
}
a {
text-decoration: none;
&:not(.anchor):hover {
text-decoration: underline;
}
}
......@@ -4,10 +4,7 @@ type = "page"
date = 2019-02-05T01:42:42+02:00
+++
<script type="text/javascript">
location.href = '/';
</script>
<!--
# Subscribe to {{< sitename >}}
<br />
......@@ -28,4 +25,4 @@ Follow
## Mastodon
<a href="https://mastodon.social/@42bloom" target="_blank" rel="me noopener">@[email protected]</a> -->
<a href="https://mastodon.social/@42bloom" target="_blank" rel="me noopener">@[email protected]</a>
{{ define "main" -}}
<img src="{{ "imgs/404.svg" | relURL }}" />
<h1>Page not found</h1>
<h3><a href="{{ "/" | relURL }}" >Back to Home</a></h3>
{{- end }}
<!DOCTYPE html>
<html lang="{{ $.Site.Language }}">
{{ partial "head.html" . }}
<body>
<header>
{{ partial "nav.html" . }}
</header>
<main>
{{ block "main" . }} {{ end }}
</main>
<footer>
{{ partial "footer.html" . }}
</footer>
</body>
<script src="{{ "js/jquery-3.4.1.min.js" | relURL }}"></script>
{{ with resources.Get "js/index.js" | minify }}
<script type="text/javascript">{{ .Content | safeJS }}</script>
{{ end }}
</html>
{{ define "main" -}}
<ul>
{{ range .Data.Pages -}}
<li>
<span>
<a href="{{ .Permalink }}">{{ .Title }}</a>
<time datetime="{{ .Date.Format "2006-01-02T15:04:05Z0700" }}">{{ .Date.Format "Mon, Jan 2, 2006" }}</time>
</span>
</li>
{{- end }}
</ul>
{{- end }}
{{ define "main" -}}
{{ if eq .Type "post"}}
{{ partial "post.html" . }}
{{ else }}
{{ partial "page.html" . }}
{{ end }}
{{ end }}
{{ define "main" }}
{{ $types := slice "" }}
{{ $paginator := .Paginate (where (where .Site.Pages "Type" "post") "IsPage" true) }}
{{ partial "post_list.html" . }}
{{ partial "pagination.html" . }}
{{ end }}
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, height=device-height, initial-scale=1.0, maximum-scale=1.0" />
<meta name="mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="#343a40" />
<meta name="theme-color" content="#343a40" />
<meta name="msapplication-TileColor" content="#343a40" />
<link rel="shortcut icon" href="{{ "imgs/favicon.png" | relURL }}"/>
<meta name="description" content="{{ .Site.Params.Description }}" />
<!-- SOCIAL -->
<meta name="og:title" property="og:title" content="{{ .Site.Title }}" />
<meta name="og:description" property="og:description" content="{{ .Site.Params.Description }}" />
<meta name="og:type" property="og:type" content="website" />
<meta name="og:url" property="og:url" content="{{ .Site.BaseURL }}" />
<meta name="og:image" property="og:image" content="{{ .Site.BaseURL }}/imgs/og_image.jpg">
<!-- <meta name="twitter:card" property="twitter:card" content="summary_large_image"> -->
<meta name="twitter:url" property="twitter:url" content="{{ .Site.BaseURL }}">
<meta name="twitter:title" property="twitter:title" content="{{ .Site.Title }}">
<meta name="twitter:description" property="twitter:description" content="{{ .Site.Params.Description }}">
<meta name="twitter:image" property="twitter:image" content="{{ .Site.BaseURL }}/imgs/og_image.jpg">
<link rel="canonical" href="{{ .Permalink }}" />
<link rel="alternate" hreflang="en" href="{{ .Permalink }}" />
<link rel="alternate" hreflang="x-default" href="{{ .Permalink }}" />
<!-- FEEDS -->
{{ with .Site.GetPage "/" }}
{{ with .OutputFormats.Get "rss" -}}
{{ printf `<link rel="%s" type="%s" href="%s" title="%s" />` .Rel .MediaType.Type .Permalink $.Site.Title | safeHTML }}
{{ end -}}
{{ end }}
{{ with .Site.GetPage "/" }}
{{ with .OutputFormats.Get "jsonfeed" -}}
{{ printf `<link rel="%s" type="%s" href="%s" title="%s" />` .Rel .MediaType.Type .Permalink $.Site.Title | safeHTML }}
{{ end -}}
{{ end }}
<!-- CSS -->
{{ $style := resources.Get "sass/style.scss" | toCSS | minify | fingerprint }}
<link rel="stylesheet" href="{{ $style.Permalink }}" integrity="{{ $style.Data.Integrity }}">
<!-- TITLE -->
{{ if .IsHome -}}
<title>{{ .Site.Title }}</title>
{{- else -}}
<title>{{ .Site.Title }} - {{ .Title }}</title>
{{- end }}
</head>
<nav>
<h1><a href="{{ .Site.BaseURL }}">{{ .Site.Title }}</a></h1>
<a href="{{ .Site.BaseURL }}" {{ if eq "/" .Permalink }}class="active"{{ end }}>Home</a>
<a href="{{ "/subscribe" | relURL }}" {{ if eq "/subscribe/" (.Permalink | relURL) }}class="active"{{ end }}>Subscribe</a>
<a href="{{ "/about" | relURL }}" {{ if eq "/about/" (.Permalink | relURL) }}class="active"{{ end }}>About</a>
</nav>
<!-- <div class='site-container'>
<header class='site-header'>
<h1 class='site-title'><a href=''></a></h1>
<nav class='site-nav'>
<a href='/' class='{% if not page.path %}active{% endif %}'>Blog</a>
<a href='/readings' class='{% if page and page.path == "readings/" %}active{% endif %}'>Readings</a>
<a href='/photos' class='{% if page and page.path == "photos/" %}active{% endif %}'>Photos</a>
<a href='/about' class='{% if page and page.path == "about/" %}active{% endif %}'>About</a>
</nav>
</header> -->
{{ $pag := $.Paginator }}
{{ if gt $pag.TotalPages 1 }}
<ul>
{{ if $pag.HasPrev }}
<li>
<a href="{{ $pag.Prev.URL }}">&larr; Newer Posts</a>
</li>
{{ end }}
{{ if (and $pag.HasNext $pag.HasPrev) }}
&nbsp;&nbsp;&nbsp;&nbsp;
{{ end }}
{{ if $pag.HasNext }}
<li>
<a href="{{ $pag.Next.URL }}">Older Posts &rarr;</a>
</li>
{{ end }}
</ul>
{{ end }}
<h1>{{ .Title }}</h1>
<div>
{{ .Content }}
</div>
<!-- post list -->
{{ range $index, $element := $.Paginator.Pages }}
<div class="entry-preview pt-3 pb-3">
<a href="{{ .Permalink }}">
<h2 class="entry-title text-center mb-2">{{ .Title }}</h2>
</a>
<p class="entry-meta mb-3">
<span classn="entry-author"><a href="https://kerkour.fr">{{ index .Params.authors 0 }}</a></span>
/
<time datetime={{ .Date.Format "2006-01-02T15:04:05Z0700" }} class="entry-date">{{ .Date.Format "Mon, Jan 2, 2006" }}</time>
</p>
<h3 class="entry-subtitle">
{{ .Params.subtitle }}
</h3>
<div class="entry-preview-content">
{{ with .Description }}
{{ . }}
{{ else }}
{{ .Summary }}
{{ end }}
</div>
<div class="mt-3 text-center">
<i><a href="{{ .Permalink }}" class="read-more-btn">KEEP READING</a></i>
</div>
{{ if .Truncated }}
{{ end }}
<!-- <p class="post-meta">
Posted by {{ with .Params.author }}{{ . }}{{ else }}{{ .Site.Title }}{{ end }} {{ .Date.Format "Monday, January 2, 2006" }}
<!-- Don't show "Last Modified on" if update happened on the same day.
{{ if (and (not .Lastmod.IsZero) (not (eq (dateFormat "2006-01-02" .Lastmod) (dateFormat "2006-01-02" .Date)))) }}
<br>Last Modified on {{ dateFormat "Monday, January 2, 2006" .Params.LastMod }}
{{ end }}
</p> -->
</div>
{{ if ne $index (sub (len $.Paginator.Pages) 1) }}<hr>{{ end }}
{{ end }}
<div class="mb-5"></div>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment