Compare commits

...

5 Commits

Author SHA1 Message Date
9905066046 Improve taxonomy handling
Signed-off-by: Nikolaos Karaolidis <nick@karaolidis.com>
2025-09-13 15:07:18 +01:00
4e37655a16 Fix unhighlighted code styles
Signed-off-by: Nikolaos Karaolidis <nick@karaolidis.com>
2025-09-13 15:07:18 +01:00
de272212ca Add shell prompt support
Signed-off-by: Nikolaos Karaolidis <nick@karaolidis.com>
2025-09-13 15:07:18 +01:00
8fac4841d4 Fix layout bugs
Signed-off-by: Nikolaos Karaolidis <nick@karaolidis.com>
2025-09-13 15:07:18 +01:00
c52639e38f Add image processing
Signed-off-by: Nikolaos Karaolidis <nick@karaolidis.com>
2025-09-13 15:07:15 +01:00
21 changed files with 630 additions and 597 deletions

View File

@@ -1,5 +1,4 @@
/* PreWrapper */ pre {
.chroma {
color: var(--text); color: var(--text);
background-color: var(--background-50); background-color: var(--background-50);
padding: 1rem; padding: 1rem;
@@ -7,411 +6,418 @@
overflow-x: auto; overflow-x: auto;
} }
/* Error */ /* PreWrapper */
.chroma .err { .chroma {
color: var(--accent-500); .line.prompt::before {
} content: "$ ";
}
/* LineLink */
.chroma .lnlinks { /* Error */
outline: none; .err {
text-decoration: none; color: var(--accent-500);
color: inherit; }
}
/* LineLink */
/* LineTableTD */ .lnlinks {
.chroma .lntd { outline: none;
vertical-align: top; text-decoration: none;
padding: 0; color: inherit;
margin: 0; }
border: 0;
} /* LineTableTD */
.lntd {
/* LineTable */ vertical-align: top;
.chroma .lntable { padding: 0;
border-spacing: 0; margin: 0;
padding: 0; border: 0;
margin: 0; }
border: 0;
} /* LineTable */
.lntable {
/* LineHighlight */ border-spacing: 0;
.chroma .hl { padding: 0;
background-color: var(--background-200); margin: 0;
} border: 0;
}
/* LineNumbersTable */
.chroma .lnt { /* LineHighlight */
white-space: pre; .hl {
-webkit-user-select: none; background-color: var(--background-200);
user-select: none; }
margin-right: 0.4em;
padding: 0 0.4em 0 0.4em; /* LineNumbersTable */
} .lnt {
white-space: pre;
/* LineNumbers */ -webkit-user-select: none;
.chroma .ln { user-select: none;
white-space: pre; margin-right: 0.4em;
-webkit-user-select: none; padding: 0 0.4em 0 0.4em;
user-select: none; }
margin-right: 0.4em;
padding: 0 0.4em 0 0.4em; /* LineNumbers */
color: color-mix(in srgb, var(--text) 50%, var(--background-50)); .ln {
} white-space: pre;
-webkit-user-select: none;
/* Line */ user-select: none;
.chroma .line { margin-right: 0.4em;
display: flex; padding: 0 0.4em 0 0.4em;
} color: color-mix(in srgb, var(--text) 50%, var(--background-50));
}
/* Keyword */
.chroma .k { /* Line */
color: var(--secondary-600); .line {
} display: flex;
}
/* KeywordConstant */
.chroma .kc { /* Keyword */
color: var(--primary-500); .k {
} color: var(--secondary-600);
}
/* KeywordDeclaration */
.chroma .kd { /* KeywordConstant */
color: var(--secondary-600); .kc {
} color: var(--primary-500);
}
/* KeywordNamespace */
.chroma .kn { /* KeywordDeclaration */
color: var(--secondary-600); .kd {
} color: var(--secondary-600);
}
/* KeywordPseudo */
.chroma .kp { /* KeywordNamespace */
color: var(--primary-500); .kn {
} color: var(--secondary-600);
}
/* KeywordReserved */
.chroma .kr { /* KeywordPseudo */
color: var(--secondary-600); .kp {
} color: var(--primary-500);
}
/* KeywordType */
.chroma .kt { /* KeywordReserved */
color: var(--secondary-600); .kr {
} color: var(--secondary-600);
}
/* Name */
.chroma .nc { /* KeywordType */
color: var(--accent-600); .kt {
font-weight: bold; color: var(--secondary-600);
} }
/* NameConstant */ /* Name */
.chroma .no { .nc {
color: var(--primary-500); color: var(--accent-600);
font-weight: bold; font-weight: bold;
} }
/* NameDecorator */ /* NameConstant */
.chroma .nd { .no {
color: var(--secondary-700); color: var(--primary-500);
font-weight: bold; font-weight: bold;
} }
/* NameEntity */ /* NameDecorator */
.chroma .ni { .nd {
color: var(--accent-600); color: var(--secondary-700);
} font-weight: bold;
}
/* NameException */
.chroma .ne { /* NameEntity */
color: var(--accent-600); .ni {
font-weight: bold; color: var(--accent-600);
} }
/* NameLabel */ /* NameException */
.chroma .nl { .ne {
color: var(--primary-500); color: var(--accent-600);
font-weight: bold; font-weight: bold;
} }
/* NameNamespace */ /* NameLabel */
.chroma .nn { .nl {
color: var(--secondary-600); color: var(--primary-500);
} font-weight: bold;
}
/* NameProperty */
.chroma .py { /* NameNamespace */
color: var(--primary-500); .nn {
} color: var(--secondary-600);
}
/* NameTag */
.chroma .nt { /* NameProperty */
color: var(--primary-600); .py {
} color: var(--primary-500);
}
/* NameVariable */
.chroma .nv { /* NameTag */
color: var(--primary-500); .nt {
} color: var(--primary-600);
}
/* NameVariableClass */
.chroma .vc { /* NameVariable */
color: var(--primary-500); .nv {
} color: var(--primary-500);
}
/* NameVariableGlobal */
.chroma .vg { /* NameVariableClass */
color: var(--primary-500); .vc {
} color: var(--primary-500);
}
/* NameVariableInstance */
.chroma .vi { /* NameVariableGlobal */
color: var(--primary-500); .vg {
} color: var(--primary-500);
}
/* NameVariableMagic */
.chroma .vm { /* NameVariableInstance */
color: var(--primary-500); .vi {
} color: var(--primary-500);
}
/* NameFunction */
.chroma .nf { /* NameVariableMagic */
color: var(--secondary-700); .vm {
font-weight: bold; color: var(--primary-500);
} }
/* NameFunctionMagic */ /* NameFunction */
.chroma .fm { .nf {
color: var(--secondary-700); color: var(--secondary-700);
font-weight: bold; font-weight: bold;
} }
/* Literal */ /* NameFunctionMagic */
.chroma .l { .fm {
color: var(--primary-600); color: var(--secondary-700);
} font-weight: bold;
}
/* LiteralDate */
.chroma .ld { /* Literal */
color: var(--primary-500); .l {
} color: var(--primary-600);
}
/* LiteralString */
.chroma .s { /* LiteralDate */
color: var(--primary-600); .ld {
} color: var(--primary-500);
}
/* LiteralStringAffix */
.chroma .sa { /* LiteralString */
color: var(--primary-500); .s {
} color: var(--primary-600);
}
/* LiteralStringBacktick */
.chroma .sb { /* LiteralStringAffix */
color: var(--primary-600); .sa {
} color: var(--primary-500);
}
/* LiteralStringChar */
.chroma .sc { /* LiteralStringBacktick */
color: var(--primary-600); .sb {
} color: var(--primary-600);
}
/* LiteralStringDelimiter */
.chroma .dl { /* LiteralStringChar */
color: var(--primary-500); .sc {
} color: var(--primary-600);
}
/* LiteralStringDoc */
.chroma .sd { /* LiteralStringDelimiter */
color: var(--primary-600); .dl {
} color: var(--primary-500);
}
/* LiteralStringDouble */
.chroma .s2 { /* LiteralStringDoc */
color: var(--primary-600); .sd {
} color: var(--primary-600);
}
/* LiteralStringEscape */
.chroma .se { /* LiteralStringDouble */
color: var(--primary-500); .s2 {
} color: var(--primary-600);
}
/* LiteralStringHeredoc */
.chroma .sh { /* LiteralStringEscape */
color: var(--primary-500); .se {
} color: var(--primary-500);
}
/* LiteralStringInterpol */
.chroma .si { /* LiteralStringHeredoc */
color: var(--primary-600); .sh {
} color: var(--primary-500);
}
/* LiteralStringOther */
.chroma .sx { /* LiteralStringInterpol */
color: var(--primary-600); .si {
} color: var(--primary-600);
}
/* LiteralStringRegex */
.chroma .sr { /* LiteralStringOther */
color: var(--primary-500); .sx {
} color: var(--primary-600);
}
/* LiteralStringSingle */
.chroma .s1 { /* LiteralStringRegex */
color: var(--primary-600); .sr {
} color: var(--primary-500);
}
/* LiteralStringSymbol */
.chroma .ss { /* LiteralStringSingle */
color: var(--primary-600); .s1 {
} color: var(--primary-600);
}
/* LiteralNumber */
.chroma .m { /* LiteralStringSymbol */
color: var(--primary-600); .ss {
} color: var(--primary-600);
}
/* LiteralNumberBin */
.chroma .mb { /* LiteralNumber */
color: var(--primary-600); .m {
} color: var(--primary-600);
}
/* LiteralNumberFloat */
.chroma .mf { /* LiteralNumberBin */
color: var(--primary-600); .mb {
} color: var(--primary-600);
}
/* LiteralNumberHex */
.chroma .mh { /* LiteralNumberFloat */
color: var(--primary-600); .mf {
} color: var(--primary-600);
}
/* LiteralNumberInteger */
.chroma .mi { /* LiteralNumberHex */
color: var(--primary-600); .mh {
} color: var(--primary-600);
}
/* LiteralNumberIntegerLong */
.chroma .il { /* LiteralNumberInteger */
color: var(--primary-600); .mi {
} color: var(--primary-600);
}
/* LiteralNumberOct */
.chroma .mo { /* LiteralNumberIntegerLong */
color: var(--primary-600); .il {
} color: var(--primary-600);
}
/* Operator */
.chroma .o { /* LiteralNumberOct */
color: var(--secondary-600); .mo {
font-weight: bold; color: var(--primary-600);
} }
/* OperatorWord */ /* Operator */
.chroma .ow { .o {
color: var(--secondary-600); color: var(--secondary-600);
font-weight: bold; font-weight: bold;
} }
/* Comment */ /* OperatorWord */
.chroma .c { .ow {
color: color-mix(in srgb, var(--text) 50%, var(--background-50)); color: var(--secondary-600);
font-style: italic; font-weight: bold;
} }
/* CommentHashbang */ /* Comment */
.chroma .ch { .c {
color: color-mix(in srgb, var(--text) 50%, var(--background-50)); color: color-mix(in srgb, var(--text) 50%, var(--background-50));
font-style: italic; font-style: italic;
} }
/* CommentMultiline */ /* CommentHashbang */
.chroma .cm { .ch {
color: color-mix(in srgb, var(--text) 50%, var(--background-50)); color: color-mix(in srgb, var(--text) 50%, var(--background-50));
font-style: italic; font-style: italic;
} }
/* CommentSingle */ /* CommentMultiline */
.chroma .c1 { .cm {
color: color-mix(in srgb, var(--text) 50%, var(--background-50)); color: color-mix(in srgb, var(--text) 50%, var(--background-50));
font-style: italic; font-style: italic;
} }
/* CommentSpecial */ /* CommentSingle */
.chroma .cs { .c1 {
color: color-mix(in srgb, var(--text) 50%, var(--background-50)); color: color-mix(in srgb, var(--text) 50%, var(--background-50));
font-weight: bold; font-style: italic;
font-style: italic; }
}
/* CommentSpecial */
/* CommentPreproc */ .cs {
.chroma .cp { color: color-mix(in srgb, var(--text) 50%, var(--background-50));
color: color-mix(in srgb, var(--text) 50%, var(--background-50)); font-weight: bold;
font-weight: bold; font-style: italic;
font-style: italic; }
}
/* CommentPreproc */
/* CommentPreprocFile */ .cp {
.chroma .cpf { color: color-mix(in srgb, var(--text) 50%, var(--background-50));
color: color-mix(in srgb, var(--text) 50%, var(--background-50)); font-weight: bold;
font-weight: bold; font-style: italic;
font-style: italic; }
}
/* CommentPreprocFile */
/* GenericDeleted */ .cpf {
.chroma .gd { color: color-mix(in srgb, var(--text) 50%, var(--background-50));
color: var(--accent-900); font-weight: bold;
background-color: var(--accent-300); font-style: italic;
} }
/* GenericEmph */ /* GenericDeleted */
.chroma .ge { .gd {
font-style: italic; color: var(--accent-900);
} background-color: var(--accent-300);
}
/* GenericError */
.chroma .gr { /* GenericEmph */
color: var(--accent-500); .ge {
} font-style: italic;
}
/* GenericHeading */
.chroma .gh { /* GenericError */
color: var(--primary-500); .gr {
font-weight: bold; color: var(--accent-500);
} }
/* GenericInserted */ /* GenericHeading */
.chroma .gi { .gh {
color: var(--primary-800); color: var(--primary-500);
background-color: var(--primary-200); font-weight: bold;
} }
/* GenericOutput */ /* GenericInserted */
.chroma .go { .gi {
color: color-mix(in srgb, var(--text) 70%, var(--background-50)); color: var(--primary-800);
} background-color: var(--primary-200);
}
/* GenericPrompt */
.chroma .gp { /* GenericOutput */
color: color-mix(in srgb, var(--text) 70%, var(--background-50)); .go {
} color: color-mix(in srgb, var(--text) 70%, var(--background-50));
}
/* GenericStrong */
.chroma .gs { /* GenericPrompt */
font-weight: bold; .gp {
} color: color-mix(in srgb, var(--text) 70%, var(--background-50));
}
/* GenericSubheading */
.chroma .gu { /* GenericStrong */
color: var(--primary-500); .gs {
} font-weight: bold;
}
/* GenericTraceback */
.chroma .gt { /* GenericSubheading */
color: var(--secondary-600); .gu {
} color: var(--primary-500);
}
/* GenericUnderline */
.chroma .gl { /* GenericTraceback */
text-decoration: underline; .gt {
color: var(--secondary-600);
}
/* GenericUnderline */
.gl {
text-decoration: underline;
}
} }

View File

@@ -16,16 +16,6 @@ a:hover {
color: var(--text-800); color: var(--text-800);
} }
sup,
sub {
color: var(--text-600);
}
sup:hover,
sub:hover {
color: var(--text-800);
}
h1, h1,
h2, h2,
h3, h3,
@@ -64,3 +54,11 @@ body {
flex: 1; flex: 1;
} }
} }
p {
margin: 1.5rem 0 1.5rem 0;
}
li {
margin: 0.5rem 0 0.5rem 0;
}

55
assets/sass/details.scss Normal file
View File

@@ -0,0 +1,55 @@
main.with-details {
max-width: $width-wide;
margin: 0 auto;
padding: 2rem;
> .content {
width: 100%;
padding: 0;
}
$width-sidebar: ($width-wide - $width-content) / 2 - 2rem;
display: grid;
grid-template-columns: $width-sidebar $width-content $width-sidebar;
column-gap: 2rem;
.title {
font-size: 1.75rem;
margin: 0;
}
.length {
color: color-mix(in srgb, var(--text) 50%, var(--background));
margin: 0.5rem 0 0.5rem 0;
font-size: 0.8rem;
}
}
@media (max-width: $width-wide) {
main.with-details {
display: block;
padding: 0;
> .details {
max-width: $width-content;
margin: 0 auto;
padding: 2rem;
}
> .content {
padding: 2rem;
}
}
}
@media (max-width: $width-mobile) {
main.with-details {
> .details {
padding: 1rem;
}
> .content {
padding: 0 1rem 1rem 1rem;
}
}
}

View File

@@ -36,6 +36,7 @@
list-style: none; list-style: none;
li { li {
margin: 0;
font-size: 0.85rem; font-size: 0.85rem;
} }
} }

View File

@@ -1,28 +1,12 @@
.hero { .hero {
max-width: $width-content; max-width: $width-content;
margin: 0 auto; margin: 0 auto;
padding: 2rem; padding: 2rem 2rem 0 2rem;
.title { .title {
margin: 0; margin: 0;
font-size: 2.5rem; font-size: 2.5rem;
} }
.meta {
font-size: 0.8rem;
.date {
color: var(--text-600);
}
.duration {
color: color-mix(in srgb, var(--text) 50%, var(--background));
}
}
.captioned-image {
padding-top: 1.5rem;
}
} }
.hero + .content { .hero + .content {

View File

@@ -1,64 +1,17 @@
main.with-meta {
max-width: $width-wide;
margin: 0 auto;
padding: 2rem;
> .content {
padding: 0;
}
$width-sidebar: ($width-wide - $width-content) / 2 - 2rem;
display: grid;
grid-template-columns: $width-sidebar $width-content $width-sidebar;
column-gap: 2rem;
h1 {
font-size: 1.75rem;
}
.length {
color: color-mix(in srgb, var(--text) 50%, var(--background));
margin: 0.25rem 0;
font-size: 0.8rem;
}
}
@media (max-width: $width-wide) {
main.with-meta {
display: block;
padding: 0;
> .meta {
max-width: $width-content;
margin: 0 auto;
padding: 2rem;
}
> .content {
padding: 2rem;
}
}
}
@media (max-width: $width-mobile) {
main.with-meta {
> .meta {
padding: 1rem;
}
> .content {
padding: 0 1rem 1rem 1rem;
}
}
}
.list { .list {
.post { .post {
display: block; display: block;
color: inherit;
>a {
color: inherit;
}
>a:hover {
color: var(--text-800);
}
&:not(:first-child) { &:not(:first-child) {
margin-top: 4rem; margin: 4rem 0 4rem 0;
} }
.title { .title {
@@ -67,38 +20,20 @@ main.with-meta {
} }
.summary { .summary {
margin-top: 0.5rem; margin: 0.5rem 0 0.5rem 0;
}
.meta {
margin-top: 1rem;
font-size: 0.8rem;
.date {
color: var(--text-600);
}
.duration {
color: color-mix(in srgb, var(--text) 50%, var(--background));
}
} }
.heading-anchor { .heading-anchor {
display: none; display: none;
} }
} }
.post:hover .title,
.post:hover .summary {
color: var(--text-800);
}
} }
@media (max-width: $width-mobile) { @media (max-width: $width-mobile) {
.list { .list {
.post { .post {
&:not(:first-child) { &:not(:first-child) {
margin-top: 2rem; margin: 2rem 0 2rem 0;
} }
.title { .title {

View File

@@ -11,7 +11,9 @@ $width-wide: 75rem;
@import "blockquote"; @import "blockquote";
@import "code"; @import "code";
@import "table"; @import "table";
@import "meta";
@import "details";
@import "list"; @import "list";
@import "gallery"; @import "gallery";

20
assets/sass/meta.scss Normal file
View File

@@ -0,0 +1,20 @@
.meta {
margin: 1rem 0 1rem 0;
font-size: 0.8rem;
.tag {
color: var(--secondary-600);
}
.tag:hover {
color: var(--secondary-800);
}
.date {
color: var(--text-600);
}
.duration {
color: color-mix(in srgb, var(--text) 50%, var(--background));
}
}

View File

@@ -0,0 +1,4 @@
{{ $result := transform.HighlightCodeBlock . }}
{{ $pattern := `(?s)<span class="line"([^>]*)>(\s*<span[^>]*>)?\$ (.*?)(</span>\s*)</span>` }}
{{ $processed := replaceRE $pattern `<span class="line prompt"$1>$2$3$4</span>` $result.Wrapped }}
{{ $processed | safeHTML }}

View File

@@ -1,7 +1,7 @@
{{ partial "components/image/index.html" (dict {{ partial "components/image/index.html" (dict "page" .Page "image" (dict
"src" .Destination "src" .Destination
"caption" .Text "caption" .Text
"alt" .Title "alt" .Title
) ))
}} }}
{{- /* chomp trailing newline */ -}} {{- /* chomp trailing newline */ -}}

View File

@@ -1,8 +1,8 @@
{{ define "main" }} {{ define "main" }}
{{ $withMeta := default true .Params.withMeta }} {{ $details := default true .Params.details }}
<main class="{{- if $withMeta -}}with-meta{{- end -}}"> <main class="{{- if $details -}}with-details{{- end -}}">
{{ if $withMeta }} {{ if $details }}
{{ partial "components/list/meta.html" . }} {{ partial "components/list/details.html" . }}
{{ end }} {{ end }}
<div class="content"> <div class="content">
{{ partial "posts/list.html" . }} {{ partial "posts/list.html" . }}

View File

@@ -0,0 +1 @@
<sub>{{ .Get 0 | markdownify }}</sub> {{- /* chomp trailing newline */ -}}

View File

@@ -0,0 +1 @@
<sup>{{ .Get 0 | markdownify }}</sup> {{- /* chomp trailing newline */ -}}

View File

@@ -1,10 +1,16 @@
{{ define "main" }} {{ define "main" }}
{{ $withMeta := default true .Params.withMeta }} {{ $details := default true .Params.details }}
<main class="{{- if $withMeta -}}with-meta{{- end -}}"> <main class="{{- if $details -}}with-details{{- end -}}">
{{ if $withMeta }} {{ if $details }}
{{ partial "components/list/meta.html" . }} {{ partial "components/list/details.html" . }}
{{ end }} {{ end }}
<div class="{{- if $withMeta -}}content{{- else -}}content wide{{- end -}}"> <div
class="{{- if $details -}}
content
{{- else -}}
content wide
{{- end -}}"
>
{{ partial "gallery/list.html" . }} {{ partial "gallery/list.html" . }}
</div> </div>
</main> </main>

View File

@@ -1,9 +1,5 @@
<section class="hero"> <section class="hero">
<h1 class="title">{{ .Title }}</h1> <h1 class="title">{{ .Title }}</h1>
<div class="meta"> {{ partial "components/meta/index.html" . }}
<span class="date">{{ .Date | time.Format ":date_medium" }}</span> {{ partial "components/image/index.html" (dict "page" .Page "image" .Params.hero) }}
&middot;
<span class="duration">{{ printf "%d MIN READ" .ReadingTime }}</span>
</div>
{{ partial "components/image/index.html" .Params.hero }}
</section> </section>

View File

@@ -1,24 +1,59 @@
{{ $imageData := partial "components/image/reflect.html" . }} {{- $page := .page -}}
{{- with $imageData.image -}} {{- $image := .image -}}
{{- $src := $image -}}
{{- $caption := "" -}}
{{- $title := "" -}}
{{- $alt := "" -}}
{{- if reflect.IsMap $image -}}
{{- $src = $image.src | default "" -}}
{{- $caption = $image.caption | default "" -}}
{{- $title = $image.title | default $caption | default "" | plainify -}}
{{- $alt = $image.alt | default $title | default "" | plainify -}}
{{- end -}}
{{- if $src -}}
{{- $isRemote := strings.HasPrefix $src "http" -}}
{{- if $isRemote -}}
{{- $remote := resources.GetRemote $src -}}
{{- $image = resources.Copy (printf "static/3rd-party/%s" $remote.Name) $remote -}}
{{- else -}}
{{- $image = ($page.Resources.Get $src) | default (resources.Get $src) -}}
{{- end -}}
{{- end -}}
{{- with $image -}}
{{ $full := . | images.Filter (images.Process "webp q90") }}
{{ $thumb := . }}
{{- if gt .Width 2000 -}}
{{- $thumb = . | images.Filter (images.Process "resize 2000x webp q75") -}}
{{- else -}}
{{- $thumb = . | images.Filter (images.Process "webp q75") -}}
{{- end -}}
<figure class="captioned-image lightbox"> <figure class="captioned-image lightbox">
<a <a
href="{{- .RelPermalink -}}" href="{{- $full.RelPermalink -}}"
data-pswp-src="{{- .RelPermalink -}}" data-pswp-src="{{- $full.RelPermalink -}}"
data-pswp-width="{{- .Width -}}" data-pswp-width="{{- $full.Width -}}"
data-pswp-height="{{- .Height -}}" data-pswp-height="{{- $full.Height -}}"
class="pswp-image" class="pswp-image"
> >
<img <img
src="{{- .RelPermalink -}}" src="{{- $thumb.RelPermalink -}}"
width="{{- .Width -}}" width="{{- $thumb.Width -}}"
height="{{- .Height -}}" height="{{- $thumb.Height -}}"
loading="lazy" loading="lazy"
{{ with $imageData.title }}title="{{- . -}}"{{ end }} {{ with $title }}title="{{- . -}}"{{ end }}
{{ with $imageData.alt }}alt="{{- . -}}"{{ end }} {{ with $alt }}alt="{{- . -}}"{{ end }}
/> />
</a> </a>
{{ with $imageData.caption }} {{ with $caption }}
<figcaption>{{ . }}</figcaption> <figcaption>{{ . | safeHTML }}</figcaption>
{{ end }} {{ end }}
</figure> </figure>
{{- end -}} {{- end -}}

View File

@@ -1,31 +0,0 @@
{{- $input := . -}}
{{- $src := $input -}}
{{- $caption := "" -}}
{{- $title := "" -}}
{{- $alt := "" -}}
{{- if reflect.IsMap $input -}}
{{- $src = $input.src | default "" -}}
{{- $caption = $input.caption | default "" -}}
{{- $title = $input.title | default $caption | default "" -}}
{{- $alt = $input.alt | default $title | default "" -}}
{{- end -}}
{{ $result := dict "image" nil "caption" $caption "title" $title "alt" $alt }}
{{- if $src -}}
{{- $isRemote := strings.HasPrefix $src "http" -}}
{{- $image := "" -}}
{{- if $isRemote -}}
{{- $remote := resources.GetRemote $src -}}
{{- $image = resources.Copy (printf "static/3rd-party/%s" $remote.Name) $remote -}}
{{- else -}}
{{- $image = resources.Get $src -}}
{{- end -}}
{{- $result = (dict "image" $image "caption" $caption "title" $title "alt" $alt) -}}
{{- end -}}
{{- return $result -}}

View File

@@ -1,5 +1,5 @@
<section class="meta"> <section class="details">
<h1>{{ .Page.Title }}</h1> <h1 class="title">{{ .Page.Title }}</h1>
<p class="length">A {{ .Kind }} with {{ len .Pages }} items</p> <p class="length">A {{ .Kind }} with {{ len .Pages }} items</p>
{{ .Content }} {{ .Content }}
</section> </section>

View File

@@ -0,0 +1,18 @@
<div class="meta">
<span class="date">{{ .Date | time.Format ":date_medium" }}</span>
&middot;
{{ if eq .Kind "page" }}
{{ range .Params.tags }}
<a href="/tags/{{ . | urlize }}" class="tag">{{ . }}</a>
&middot;
{{ end }}
<span class="duration">
{{ printf "%d min. read" .ReadingTime }}
</span>
{{ else }}
{{ $count := len .Pages }}
<span class="duration">
{{ printf "%d %s" $count (cond (eq $count 1) "item" "items") }}
</span>
{{ end }}
</div>

View File

@@ -1,22 +1,26 @@
{{ $pages := .CurrentSection.Pages.ByDate }} {{ $pages := .CurrentSection.Pages.ByDate.Reverse }}
<div class="postnav"> <div class="postnav">
{{ with $pages.Prev . }} {{ with $pages.Prev . }}
<a href="{{ .RelPermalink }}"> {{ if eq .Kind "page" }}
<div class="previous"> <a href="{{ .RelPermalink }}">
<p class="caption">Previous Post</p> <div class="previous">
<p class="title">{{ .Title }}</p> <p class="caption">Previous Post</p>
</div> <p class="title">{{ .Title }}</p>
</a> </div>
</a>
{{ end }}
{{ end }} {{ end }}
{{ with $pages.Next . }} {{ with $pages.Next . }}
<a href="{{ .RelPermalink }}"> {{ if eq .Kind "page" }}
<div class="next"> <a href="{{ .RelPermalink }}">
<p class="caption">Next Post</p> <div class="next">
<p class="title">{{ .Title }}</p> <p class="caption">Next Post</p>
</div> <p class="title">{{ .Title }}</p>
</a> </div>
</a>
{{ end }}
{{ end }} {{ end }}
</div> </div>

View File

@@ -1,15 +1,13 @@
<div class="list"> <div class="list">
{{ range sort .Pages "Date" "desc" }} {{ range sort .Pages "Date" "desc" }}
{{ if not .Params.private }} {{ if not .Params.private }}
<a href="{{- .RelPermalink -}}" class="post"> <div class="post">
<h1 class="title">{{ .Title }}</h1> <a href="{{- .RelPermalink -}}">
<div class="summary">{{ .Summary | plainify }}</div> <h1 class="title">{{ .Title }}</h1>
<div class="meta"> <div class="summary">{{ .Summary | plainify }}</div>
<span class="date">{{ .Date | time.Format ":date_medium" }}</span> </a>
&middot; {{ partial "components/meta/index.html" . }}
<span class="duration">{{ printf "%d MIN READ" .ReadingTime }}</span> </div>
</div>
</a>
{{ end }} {{ end }}
{{ end }} {{ end }}
</div> </div>