Compare commits

...

5 Commits

  1. 19
      layouts/_default/baseof.html
  2. 2
      layouts/_default/single.html
  3. 3
      layouts/partials/article-card.html
  4. 7
      layouts/partials/article-meta.html
  5. 2
      layouts/partials/footer.html
  6. 10
      layouts/partials/header-image.html
  7. 2
      layouts/partials/header.html
  8. 21
      layouts/partials/image.html
  9. 10
      layouts/partials/responsive-image.html
  10. 3
      layouts/shortcodes/image.html
  11. 11
      layouts/shortcodes/responsive-image.html

19
layouts/_default/baseof.html

@ -1,25 +1,26 @@
<!DOCTYPE html>
<html lang="{{ .Site.Language.Lang }}">
<head>
<link rel="shortcut icon" href="/images/favicon.ico"/>
{{ with .OutputFormats.Get "rss" }}
{{- printf `<link rel="%s" type="%s" href="%s" title="%s" />` .Rel .MediaType.Type .Permalink $.Site.Title | safeHTML -}}
<link rel="shortcut icon" href="/images/favicon.ico">
{{- with .OutputFormats.Get "rss" }}
{{- printf `<link rel="%s" type="%s" href="%s" title="%s">` .Rel .MediaType.Type .Permalink $.Site.Title | safeHTML -}}
{{ end }}
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
{{ if .Params.description -}}
<meta name="description" content="{{ .Params.description }}">
{{ with (default .Site.Params.description .Params.description) -}}
<meta name="description" content="{{- . -}}">
{{- end -}}
{{ if .Params.keywords -}}
<meta name="description" content="{{ delimit .Params.keywords "," }}">
{{ with .Params.keywords -}}
<meta name="description" content="{{ delimit . "," }}">
{{- end }}
{{ $style := resources.Get "/sass/main.scss" | resources.ToCSS -}}
<link rel="stylesheet" href="{{ $style.Permalink }}" />
<link rel="stylesheet" href="{{ $style.Permalink }}">
<title>
{{- block "title" . }}{{ .Site.Title }}{{ end -}}

2
layouts/_default/single.html

@ -1,3 +1,5 @@
{{ define "title" }}{{ .Title }}{{ end }}
{{ define "main" }}
<main>
{{ partial "article-meta.html" . }}

3
layouts/partials/article-card.html

@ -1,7 +1,8 @@
<article class="shadow float-on-hover card">
<div class="article-image">
<a href=" {{ .Permalink }}">
{{ partial "responsive-image.html" (dict "context" .)}}
{{ $image := .Resources.GetMatch .Params.featured.url }}
{{ partial "image.html" (dict "image" $image "alt" .Params.featured.alt "class" "fill-wh")}}
</a>
</div>
<div class="article-info-container">

7
layouts/partials/article-meta.html

@ -1,8 +1,8 @@
<section class="article-header">
<h1>{{ .Title | markdownify }}</h1>
{{ $authors := .Params.authors | default (slice .Site.Params.defaultAuthor) }}
{{ $primaryAuthor := index $authors 0 }}
{{- $authors := .Params.authors | default (slice .Site.Params.defaultAuthor) }}
{{- $primaryAuthor := index $authors 0 }}
{{ with $primaryAuthor }}
<a class="center-text" href={{ printf "/%s/%s" "authors" (urlize .) }}>
@ -16,6 +16,7 @@
<a class="small-text" href="{{ .Permalink }}">{{ .LinkTitle }}</a>
{{ end }}
{{ partial "header-image.html" (dict "image" (.Resources.GetMatch .Params.featured.url) "alt" .Params.featured.alt) }}
{{ $image := (.Resources.GetMatch .Params.featured.url) }}
{{ partial "image.html" (dict "image" $image "alt" .Params.featured.alt "class" "shadow featured") }}
</section>

2
layouts/partials/footer.html

@ -1,5 +1,5 @@
<footer>
<hr/>
<hr>
<p class="center-text"><a class="small-text" href="/authors">Authors</a></p>
<p class="center-text small-text">{{ $.Site.Copyright | safeHTML }}</p>
</footer>

10
layouts/partials/header-image.html

@ -1,10 +0,0 @@
<img class="shadow featured"
{{ with .image }}
srcset="
{{ (.Resize "320x q30").RelPermalink }} 500w,
{{ (.Resize "600x q40").RelPermalink }} 800w,
{{ (.Resize "1200x q65").RelPermalink }} 2x"
src="{{ (.Resize "320x q30").RelPermalink }}"
{{ end }}
alt="{{ .alt }}"
/>

2
layouts/partials/header.html

@ -1,6 +1,6 @@
<header>
<nav class="spread">
<a href="/"><img src="/images/logo.svg" alt="The {{ .Site.Title }} Logo"/></a>
<a href="/"><img src="/images/logo.svg" alt="The {{ .Site.Title }} Logo"></a>
<ul class="spread">
<li><a href="https://gitea.beetbox.io/BeetBox" title="Gitea Repositories">Gitea</a></li>
<li><a href="https://odysee.com/@BeetBox:f" title="Odysee Channel">Odysee</a></li>

21
layouts/partials/image.html

@ -0,0 +1,21 @@
<img class="{{ .class }}"
{{ with .image }}
srcset="
{{- with (.Resize "600x q40") -}}
{{ printf "%s %dw," .RelPermalink .Width }}
{{- end -}}
{{- with (.Resize "1200x q65") -}}
{{ printf "%s %dw" .RelPermalink .Width }}
{{- end -}}"
sizes="
{{- with (.Resize "600x q40") -}}
{{- printf "(max-width: 700px) %dpx," .Width -}}
{{- end -}}
800px"
src="{{ (.Resize "1200x q65").RelPermalink }}"
{{ end }}
alt="{{ .alt }}"
>

10
layouts/partials/responsive-image.html

@ -1,10 +0,0 @@
<img class="{{ .class | default "fill-wh"}}"
{{ with .context.Resources.GetMatch .context.Params.featured.url }}
srcset="
{{ (.Resize "320x q30").RelPermalink }} 500w,
{{ (.Resize "600x q40").RelPermalink }} 800w,
{{ (.Resize "1200x q65").RelPermalink }} 2x"
src="{{ (.Resize "320x q30").RelPermalink }}"
alt="{{ .Params.alt }}"
{{ end }}
/>

3
layouts/shortcodes/image.html

@ -0,0 +1,3 @@
{{ $image := .Page.Resources.GetMatch (.Get "src") }}
{{ partial "image.html" (dict "image" $image "alt" (.Get "alt") "class" "fill-wh") }}

11
layouts/shortcodes/responsive-image.html

@ -1,11 +0,0 @@
<img class="{{ .Get "class" | default "fill-wh" }}"
{{ with .Get "src" | .Page.Resources.GetMatch }}
srcset="
{{ (.Resize "320x q30").RelPermalink }} 500w,
{{ (.Resize "600x q40").RelPermalink }} 800w,
{{ (.Resize "1200x q65").RelPermalink }} 2x"
src="{{ (.Resize "320x q30").RelPermalink }}"
{{ end }}
alt="{{ .Get "alt" }}"
/>
Loading…
Cancel
Save