Add photoswipe
Signed-off-by: Nikolaos Karaolidis <nick@karaolidis.com>
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
<footer class="footer">
|
||||
<div class="footer-container">
|
||||
<div class="copyright">
|
||||
<a href="{{- "/" | relURL -}}">{{ .Site.Title }}</a> ©
|
||||
<a href="{{- relURL "" -}}">{{ .Site.Title }}</a> ©
|
||||
{{ now.Year }}
|
||||
</div>
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
{{ $len := len .Site.Params.footer }}
|
||||
{{ range $i, $el := .Site.Params.footer }}
|
||||
<li>
|
||||
<a href="{{- $el.url -}}">{{ $el.name }}</a>
|
||||
<a href="{{- $el.url | safeURL -}}">{{ $el.name }}</a>
|
||||
</li>
|
||||
{{ if lt (add $i 1) $len }}
|
||||
<span class="middot">·</span>
|
||||
|
2
layouts/partials/head/bots.html
Normal file
2
layouts/partials/head/bots.html
Normal file
@@ -0,0 +1,2 @@
|
||||
<meta name="robots" content="all,follow" />
|
||||
<meta name="googlebot" content="index,follow,snippet,archive" />
|
@@ -58,12 +58,11 @@
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
{{ $permalink := .Permalink }}
|
||||
{{ $siteSeries := .Site.Taxonomies.series }}{{ with .Params.series }}
|
||||
{{ range $name := . }}
|
||||
{{ $series := index $siteSeries $name }}
|
||||
{{ range $page := first 6 $series.Pages }}
|
||||
{{ if ne $page.Permalink $permalink }}
|
||||
{{ if ne $page.Permalink .Permalink }}
|
||||
<meta property="og:see_also" content="{{- $page.Permalink -}}" />
|
||||
{{ end }}
|
||||
{{ end }}
|
17
layouts/partials/head/photoswipe.html
Normal file
17
layouts/partials/head/photoswipe.html
Normal file
@@ -0,0 +1,17 @@
|
||||
{{ with resources.Get "css/photoswipe/photoswipe.css" | minify | fingerprint }}
|
||||
<link
|
||||
rel="stylesheet"
|
||||
href="{{- .RelPermalink -}}"
|
||||
integrity="{{- .Data.Integrity -}}"
|
||||
/>
|
||||
{{ end }}
|
||||
|
||||
{{ $opts := dict "minify" true }}
|
||||
{{ with resources.Get "js/photoswipe.js" | js.Build $opts | minify | fingerprint }}
|
||||
<script
|
||||
src="{{ .RelPermalink }}"
|
||||
integrity="{{ .Data.Integrity }}"
|
||||
crossorigin="anonymous"
|
||||
async
|
||||
></script>
|
||||
{{ end }}
|
5
layouts/partials/head/rss.html
Normal file
5
layouts/partials/head/rss.html
Normal file
@@ -0,0 +1,5 @@
|
||||
{{ with .OutputFormats.Get "RSS" }}
|
||||
{{ printf `
|
||||
<link href="%s" rel="%s" type="%s" title="%s" />` .Permalink .Rel .MediaType.Type $.Site.Title | safeHTML
|
||||
}}
|
||||
{{ end }}
|
8
layouts/partials/head/styles.html
Normal file
8
layouts/partials/head/styles.html
Normal file
@@ -0,0 +1,8 @@
|
||||
{{ $opts := dict "targetPath" "css/main.css" }}
|
||||
{{ with resources.Get "sass/main.scss" | css.Sass $opts | minify | fingerprint }}
|
||||
<link
|
||||
rel="stylesheet"
|
||||
href="{{- .RelPermalink -}}"
|
||||
integrity="{{- .Data.Integrity -}}"
|
||||
/>
|
||||
{{ end }}
|
@@ -1,13 +1,3 @@
|
||||
{{ with .Params.image }}
|
||||
{{ $image := $.Resources.GetMatch . }}
|
||||
{{ with $image }}
|
||||
{{ $thumb := .Resize "400x" }}
|
||||
<meta name="twitter:card" content="summary_large_image" />
|
||||
<meta name="twitter:image" content="{{- $thumb.Permalink -}}" />
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
|
||||
<meta name="twitter:title" content="{{- .Title -}}" />
|
||||
<meta
|
||||
name="twitter:description"
|
||||
@@ -21,3 +11,12 @@
|
||||
{{- end -}}
|
||||
{{- end -}}"
|
||||
/>
|
||||
|
||||
{{ with .Params.image }}
|
||||
{{ $image := $.Resources.GetMatch . }}
|
||||
{{ with $image }}
|
||||
{{ $thumb := .Resize "400x" }}
|
||||
<meta name="twitter:card" content="summary_large_image" />
|
||||
<meta name="twitter:image" content="{{- $thumb.Permalink -}}" />
|
||||
{{ end }}
|
||||
{{ end }}
|
@@ -1,7 +1,7 @@
|
||||
<header class="header">
|
||||
<div class="header-container">
|
||||
<div class="site-title">
|
||||
<a href="{{- "/" | relURL -}}">{{ .Site.Title }}</a>
|
||||
<a href="{{- relURL "" -}}">{{ .Site.Title }}</a>
|
||||
</div>
|
||||
|
||||
<input
|
||||
@@ -18,7 +18,7 @@
|
||||
<nav class="nav">
|
||||
<ul>
|
||||
{{ range .Site.Params.navigation }}
|
||||
<li><a href="{{- .url -}}">{{ .name }}</a></li>
|
||||
<li><a href="{{- .url | safeURL -}}">{{ .name }}</a></li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
</nav>
|
||||
|
@@ -2,15 +2,28 @@
|
||||
{{- $caption := .caption -}}
|
||||
{{- $alt := default .caption .alt -}}
|
||||
|
||||
{{ if $path }}
|
||||
<figure class="image">
|
||||
<img
|
||||
src="{{- $path | absURL -}}"
|
||||
{{ with $caption }}title="{{- . -}}"{{ end }}
|
||||
{{ with $alt }}alt="{{- . -}}"{{ end }}
|
||||
/>
|
||||
{{ with $caption }}
|
||||
<figcaption>{{ . }}</figcaption>
|
||||
{{ end }}
|
||||
</figure>
|
||||
{{ end }}
|
||||
{{- if $path -}}
|
||||
{{- $isRemote := strings.HasPrefix $path "http" -}}
|
||||
{{- $image := cond $isRemote (resources.GetRemote $path) (resources.Get $path) -}}
|
||||
|
||||
{{- if $image -}}
|
||||
<figure class="image gallery">
|
||||
<a
|
||||
href="{{- $image.RelPermalink -}}"
|
||||
data-pswp-width="{{- $image.Width -}}"
|
||||
data-pswp-height="{{- $image.Height -}}"
|
||||
>
|
||||
<img
|
||||
src="{{- $image.RelPermalink -}}"
|
||||
width="{{- $image.Width -}}"
|
||||
height="{{- $image.Height -}}"
|
||||
{{ with $caption }}title="{{- . -}}"{{ end }}
|
||||
{{ with $alt }}alt="{{- . -}}"{{ end }}
|
||||
/>
|
||||
</a>
|
||||
{{ with $caption }}
|
||||
<figcaption>{{ . }}</figcaption>
|
||||
{{ end }}
|
||||
</figure>
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
@@ -1,7 +1,7 @@
|
||||
<div class="posts-list">
|
||||
{{ range sort .Pages "Date" "desc" }}
|
||||
{{ if not .Params.private }}
|
||||
<a href="{{ .Permalink }}" class="post">
|
||||
<a href="{{- .RelPermalink -}}" class="post">
|
||||
<h1 class="title">{{ .Title }}</h1>
|
||||
<div class="summary">{{ .Summary }}</div>
|
||||
<div class="meta">
|
||||
|
Reference in New Issue
Block a user