-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
187 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file added
BIN
+825 KB
...Site/content/post/markdown-syntax/images/david-drucsko-eZ_hyar3qqc-unsplash.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,41 @@ | ||
{{ define "main" }} | ||
<div class="w-full max-w-4xl lg:max-w-5xl"> | ||
<div class="flex flex-col gap-y-3 p-6 mt-6 mx-2 md:mx-0 rounded-lg shadow-md bg-white dark:bg-gray-700"> | ||
<h1 class="text-4xl font-semibold text-slate-800 dark:text-slate-100"> | ||
<a href="{{ .RelPermalink }}">{{ .Title | .RenderString }}</a> | ||
</h1> | ||
<div class="flex flex-col mt-6 mx-2 md:mx-0 rounded-lg overflow-hidden shadow-md bg-white dark:bg-gray-700"> | ||
<div> | ||
<a href="{{ .RelPermalink }}"> | ||
{{ partial "block/image.html" . }} | ||
</a> | ||
</div> | ||
<div class="flex flex-col gap-y-3 p-6"> | ||
<h1 class="text-4xl font-semibold text-slate-800 dark:text-slate-100"> | ||
<a href="{{ .RelPermalink }}">{{ .Title | .RenderString }}</a> | ||
</h1> | ||
|
||
{{ with .Description }} | ||
<h2 class="my-4 text-large text-slate-600 dark:text-slate-300"> | ||
{{ . | $.Page.RenderString }} | ||
</h2> | ||
{{ end }} | ||
{{ partial "block/taxonomies.html" .}} | ||
{{ with .Description }} | ||
<h2 class="my-4 text-large text-slate-600 dark:text-slate-300"> | ||
{{ . | $.Page.RenderString }} | ||
</h2> | ||
{{ end }} | ||
{{ partial "block/taxonomies.html" .}} | ||
|
||
{{ partial "block/time.html" . }} | ||
{{ partial "block/time.html" . }} | ||
|
||
{{ if or .Params.Toc $.Site.Params.Toc }} | ||
{{ if ne .Params.Toc false }} | ||
<section class="prose prose-slate dark:prose-invert w-full max-w-4xl lg:max-w-5xl mt-6"> | ||
<h2>{{ T "table_of_contents" }}</h2> | ||
<aside>{{ .TableOfContents }}</aside> | ||
</section> | ||
{{ if or .Params.Toc $.Site.Params.Toc }} | ||
{{ if ne .Params.Toc false }} | ||
<section class="prose prose-slate dark:prose-invert w-full max-w-4xl lg:max-w-5xl mt-6"> | ||
<h2>{{ T "table_of_contents" }}</h2> | ||
<aside>{{ .TableOfContents }}</aside> | ||
</section> | ||
{{ end }} | ||
{{ end }} | ||
{{ end }} | ||
|
||
<article class="mt-6 w-full max-w-4xl lg:max-w-5xl prose prose-slate dark:prose-invert prose-quoteless post-content"> | ||
{{ .Content | safeHTML }} | ||
</article> | ||
<article class="mt-6 w-full max-w-4xl lg:max-w-5xl prose prose-slate dark:prose-invert prose-quoteless post-content"> | ||
{{ .Content | safeHTML }} | ||
</article> | ||
|
||
{{ partial "comments.html" . }} | ||
|
||
{{ partial "comments.html" . }} | ||
</div> | ||
</div> | ||
</div> | ||
{{ end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
{{- $alt := .Title -}} | ||
|
||
{{- $respSizes := slice "960" "1600" -}} | ||
{{- $hint := "photo" -}} | ||
{{- $filter := "box" -}} | ||
{{- if .Params.image -}} | ||
{{- $dest := .Params.image | safeURL -}} | ||
{{- $dest = path.Base $dest -}} | ||
{{- with (.Resources.ByType "image").GetMatch ( printf "{**/%s,%s}" $dest $dest ) -}} | ||
{{- $src := . -}} | ||
{{- $dataSzes := "(min-width: 1024px) 100vw, 50vw" -}} | ||
{{- $actualImg := $src.Resize (print "640x jpg " $filter) -}} | ||
<picture> | ||
<source type="image/webp" srcset=" | ||
{{- with $respSizes -}} | ||
{{- range $i, $e := . -}} | ||
{{- if ge $src.Width . -}} | ||
{{- if $i }}, {{ end -}}{{- ($src.Resize (print . "x webp " $hint " " $filter) ).RelPermalink }} {{ . }}w | ||
{{- end -}} | ||
{{- end -}} | ||
{{- end -}}" sizes="{{ $dataSzes }}" /> | ||
<source type="image/jpeg" srcset=" | ||
{{- with $respSizes -}} | ||
{{- range $i, $e := . -}} | ||
{{- if ge $src.Width . -}} | ||
{{- if $i }}, {{ end -}}{{- ($src.Resize (print . "x jpg " $filter) ).RelPermalink }} {{ . }}w | ||
{{- end -}} | ||
{{- end -}} | ||
{{- end -}}" sizes="{{ $dataSzes }}" /> | ||
<img class="w-full object-cover h-36 md:h-48 xl:h-60" src="{{ $actualImg.RelPermalink }}" width="{{ $src.Width }}" height="{{ $src.Height }}" alt="{{ $alt }}" title="{{ $alt }}" loading="lazy" /> | ||
</picture> | ||
<!-- or otherwise simply load the URL --> | ||
{{- else -}} | ||
<figure> | ||
<img class="w-full object-cover h-36 md:h-48 xl:h-60" src="{{ .Params.image | safeURL }}" | ||
alt="{{ $alt }}" title="{{ $alt }}" | ||
loading="lazy" | ||
> | ||
</figure> | ||
{{- end -}} | ||
{{- end -}} |