Compare commits

...

5 Commits

  1. 35
      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

35
layouts/_default/baseof.html

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

2
layouts/_default/single.html

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

3
layouts/partials/article-card.html

@ -1,7 +1,8 @@
<article class="shadow float-on-hover card"> <article class="shadow float-on-hover card">
<div class="article-image"> <div class="article-image">
<a href=" {{ .Permalink }}"> <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> </a>
</div> </div>
<div class="article-info-container"> <div class="article-info-container">

7
layouts/partials/article-meta.html

@ -1,8 +1,8 @@
<section class="article-header"> <section class="article-header">
<h1>{{ .Title | markdownify }}</h1> <h1>{{ .Title | markdownify }}</h1>
{{ $authors := .Params.authors | default (slice .Site.Params.defaultAuthor) }} {{- $authors := .Params.authors | default (slice .Site.Params.defaultAuthor) }}
{{ $primaryAuthor := index $authors 0 }} {{- $primaryAuthor := index $authors 0 }}
{{ with $primaryAuthor }} {{ with $primaryAuthor }}
<a class="center-text" href={{ printf "/%s/%s" "authors" (urlize .) }}> <a class="center-text" href={{ printf "/%s/%s" "authors" (urlize .) }}>
@ -16,6 +16,7 @@
<a class="small-text" href="{{ .Permalink }}">{{ .LinkTitle }}</a> <a class="small-text" href="{{ .Permalink }}">{{ .LinkTitle }}</a>
{{ end }} {{ 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> </section>

2
layouts/partials/footer.html

@ -1,5 +1,5 @@
<footer> <footer>
<hr/> <hr>
<p class="center-text"><a class="small-text" href="/authors">Authors</a></p> <p class="center-text"><a class="small-text" href="/authors">Authors</a></p>
<p class="center-text small-text">{{ $.Site.Copyright | safeHTML }}</p> <p class="center-text small-text">{{ $.Site.Copyright | safeHTML }}</p>
</footer> </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> <header>
<nav class="spread"> <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"> <ul class="spread">
<li><a href="https://gitea.beetbox.io/BeetBox" title="Gitea Repositories">Gitea</a></li> <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> <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