Compare commits
2 Commits
main
...
4e2c24ad59
Author | SHA1 | Date | |
---|---|---|---|
4e2c24ad59
|
|||
903227b07c
|
@@ -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:not(:last-child) {
|
||||||
|
margin-bottom: 0.5rem;
|
||||||
|
}
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
.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;
|
||||||
|
@@ -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 */ -}}
|
||||||
|
2
layouts/_shortcodes/sub.html
Normal file
2
layouts/_shortcodes/sub.html
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
<sub>{{ .Get 0 | markdownify }}</sub>
|
||||||
|
{{- /* chomp trailing newline */ -}}
|
2
layouts/_shortcodes/sup.html
Normal file
2
layouts/_shortcodes/sup.html
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
<sup>{{ .Get 0 | markdownify }}</sup>
|
||||||
|
{{- /* chomp trailing newline */ -}}
|
@@ -5,5 +5,5 @@
|
|||||||
·
|
·
|
||||||
<span class="duration">{{ printf "%d MIN READ" .ReadingTime }}</span>
|
<span class="duration">{{ printf "%d MIN READ" .ReadingTime }}</span>
|
||||||
</div>
|
</div>
|
||||||
{{ partial "components/image/index.html" .Params.hero }}
|
{{ partial "components/image/index.html" (dict "page" .Page "image" .Params.hero) }}
|
||||||
</section>
|
</section>
|
||||||
|
@@ -1,5 +1,39 @@
|
|||||||
{{ $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 "" -}}
|
||||||
|
{{- $alt = $image.alt | default $title | default "" -}}
|
||||||
|
{{- 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="{{- .RelPermalink -}}"
|
||||||
@@ -9,16 +43,16 @@
|
|||||||
class="pswp-image"
|
class="pswp-image"
|
||||||
>
|
>
|
||||||
<img
|
<img
|
||||||
src="{{- .RelPermalink -}}"
|
src="{{- $thumb.RelPermalink -}}"
|
||||||
width="{{- .Width -}}"
|
width="{{- .Width -}}"
|
||||||
height="{{- .Height -}}"
|
height="{{- .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 -}}
|
||||||
|
@@ -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 -}}
|
|
@@ -1,5 +1,4 @@
|
|||||||
{{ $pages := .CurrentSection.Pages.ByDate }}
|
{{ $pages := .CurrentSection.Pages.ByDate.Reverse }}
|
||||||
|
|
||||||
|
|
||||||
<div class="postnav">
|
<div class="postnav">
|
||||||
{{ with $pages.Prev . }}
|
{{ with $pages.Prev . }}
|
||||||
|
Reference in New Issue
Block a user