Skip to content

Commit

Permalink
copy page from old project
Browse files Browse the repository at this point in the history
  • Loading branch information
Natooz committed Oct 8, 2023
1 parent 7ffa175 commit 25cd8d1
Show file tree
Hide file tree
Showing 32 changed files with 450 additions and 421 deletions.
25 changes: 25 additions & 0 deletions page/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,31 @@ paginate = 3
# You can disabled it PER PAGE by using "disableTitleSeparator" at front
# matter or disable it entirely by commenting the line below
titleSeparator = "|"

# Contact form shortcode
[params.contact]

# formspree.io Form ID
formspreeFormId = "example"

# Autocomplete [on/off] and min character length for message
autoComplete = false # Default is false
messageMinLength = 140 # Default is 140

# Subject
# You can set a single value below (and it will cease to be a dropdown),
# BUT KEEP IT AS AN ARRAY
# It can also be disabled entirely (and it will turn into a text field)
subject = [ 'Just saying "hi"', "I know what you did last winter", "... Is that a sloth?", "お前はもう死んでいる。" ]

# Text placeholders. As usual, comment the lines if you don't want use them
# The "subject" below will only be used if the "subject" above doesn't exist (ie.: commented/deleted)
[params.contact.placeholder]
name = "Jane Doe"
email = "[email protected]"
subject = 'Just saying "hi"'
message = "Aenean lacinia bibendum nulla sed consectetur. Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor. Donec ullamcorper nulla non metus auctor fringilla nullam quis risus."


[params.search]

Expand Down
4 changes: 2 additions & 2 deletions page/layouts/_default/_markup/render-image.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{{ $image := .Page.Resources.GetMatch (printf "%s" (.Destination | safeURL)) }}
{{ if .Title }}
<figure>
<img alt="{{ .Text }}" loading="lazy" src="{{ .Destination | safeURL }}" />
<img src="{{ .Destination | safeURL }}" alt="{{ .Text }}" loading="lazy" />
<figcaption>{{ .Title | markdownify -}}</figcaption>
</figure>
{{ else }}
<img alt="{{ .Text }}" src="{{ .Destination | safeURL }}" />
<img src="{{ .Destination | safeURL }}" alt="{{ .Text }}" />
{{ end }}
30 changes: 15 additions & 15 deletions page/layouts/shortcodes/embed-pdf.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,32 +11,32 @@
min-height: 20vh;
/* overflow-y:scroll; */
}

.pdf-canvas {
border: 1px solid black;
direction: ltr;
width: 100%;
height: auto;
display: none;
}

#the-canvas {
border: 1px solid black;
direction: ltr;
width: 100%;
height: auto;
display: none;
}


.pdf-loadingWrapper {
display: none;
justify-content: center;
align-items: center;
width: 100%;
height: 350px;
}

.pdf-loading {
display: inline-block;
width: 50px;
Expand All @@ -47,17 +47,17 @@
animation: spin 1s ease-in-out infinite;
-webkit-animation: spin 1s ease-in-out infinite;
}

{{/* Download link */}}



#overlayText {
word-wrap: break-word;
display: grid;
justify-content: end;
}

#overlayText a {
position: relative;
top: 10px;
Expand All @@ -71,14 +71,14 @@
border-color: #00000030;
text-decoration: none;
}

#overlayText svg {
height: clamp(1em, 2vw, 1.4em);
width: clamp(1em, 2vw, 1.4em);
}



@keyframes spin {
to { -webkit-transform: rotate(360deg); }
}
Expand Down Expand Up @@ -261,4 +261,4 @@
renderPage(pageNum);
});
})();
</script>
</script>

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"Target":"css/main.min.9350283e6779ea7c9c8af1912b0e7ca9c590d09e3d7bb33d6db21beebbd59ef9.css","MediaType":"text/css","Data":{"Integrity":"sha256-k1AoPmd56nycivGRKw58qcWQ0J49e7M9bbIb7rvVnvk="}}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
html{--accent:#1dbc91}.req-js{display:none}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"Target":"css/noscript.min.3f3b95436b19eaeb9223fb12c0b86737d53ee0a47fdba271a886c244bc03975c.css","MediaType":"text/css","Data":{"Integrity":"sha256-PzuVQ2sZ6uuSI/sSwLhnN9U+4KR/26JxqIbCRLwDl1w="}}
256 changes: 128 additions & 128 deletions page/static/js/web/viewer.html

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,14 @@
>

<img
$altText $class .default endend end height="{{ .Height }}"
{{ with $class }}class="{{ . }}"{{ end }}
loading="lazy"
src="{{ .RelPermalink }}" width="{{ .Width }}" with with
with
{{
{{
{{ {{ {{
{{ }} }} }}}} }}alt="{{ . }}" }}class="{{ . }}"
{{ with .default }}
src="{{ .RelPermalink }}"
width="{{ .Width }}"
height="{{ .Height }}"
{{ end }}
{{ with $altText }}alt="{{ . }}"{{ end }}
/>

</picture>
Expand All @@ -59,11 +59,11 @@
<!-- Avoid trying to get width and height from SVG files -->
{{ if .input }}
<img
$class .MediaType.SubType .input endif loading="lazy" ne
src="{{ .RelPermalink }}"
with with {{ {{
{{
{{ }} }} }}class="{{ . }}" "svg" }}
{{ with $class }}class="{{ . }}"{{ end }}
loading="lazy"
{{ with .input }}
src="{{ .RelPermalink }}"
{{ if ne .MediaType.SubType "svg" }}
width="{{ .Width }}"
height="{{ .Height }}"
{{ end }}
Expand All @@ -75,10 +75,10 @@
<!-- If local file isn't found, assume it's a remote file -->
{{ with ($.Destination | safeURL) }}
<img
$altText $class end endloading="lazy" src="{{ . }}" with
with
{{
{{ {{ {{ }}}} }}alt="{{ . }}" }}class="{{ . }}"
{{ with $class }}class="{{ . }}"{{ end }}
loading="lazy"
src="{{ . }}"
{{ with $altText }}alt="{{ . }}"{{ end }}
/>
{{ end }}
{{ end }}
Expand Down
4 changes: 2 additions & 2 deletions page/themes/color-your-world/layouts/_default/baseof.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{{- $svgBundle := partialCached "svg-bundle" . -}}

<!DOCTYPE html>
<html data-mode="{{ if .Site.Params.Style.isDark }}dark{{ else }}light{{ end }}" lang="{{ .Site.Language.Lang }}">
<html lang="{{ .Site.Language.Lang }}" data-mode="{{ if .Site.Params.Style.isDark }}dark{{ else }}light{{ end }}">
<head prefix="og: http://ogp.me/ns#">
{{ partial "head" . }}
</head>
Expand All @@ -25,7 +25,7 @@
<!-- Search -->
{{ if eq .Layout "search" }}
{{ $searchJS := resources.Get "js/search.js" | resources.ExecuteAsTemplate (print "js/search.js" | relLangURL) . | minify | fingerprint }}
<script async crossorigin="anonymous" integrity="{{ $searchJS.Data.Integrity }}" src="{{ $searchJS.Permalink }}" type="module"></script>
<script async type="module" src="{{ $searchJS.Permalink }}" integrity="{{ $searchJS.Data.Integrity }}" crossorigin="anonymous"></script>
{{ end }}

<!-- KaTeX -->
Expand Down
2 changes: 1 addition & 1 deletion page/themes/color-your-world/layouts/_default/rss.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
{{- $pages = $pages | first $limit -}}
{{- end -}}
{{- printf "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\"?>" | safeHTML }}
<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0">
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title>{{ .Site.Title }}</title>
<link>{{ .Permalink }}</link>
Expand Down
4 changes: 2 additions & 2 deletions page/themes/color-your-world/layouts/_default/search.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ <h1>{{ .Title }}</h1>
</div>

<ul
id="search-results"
class="posts"
data-lib-version="{{ .Site.Data.default.libs.fusejs }}"
data-search-index="{{ $searchIndexLink }}"
id="search-results"
data-lib-version="{{ .Site.Data.default.libs.fusejs }}"
/>
<!-- Results -->
</ul>
Expand Down
4 changes: 2 additions & 2 deletions page/themes/color-your-world/layouts/_default/single.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ <h1>{{ .Title | emojify }}</h1>
{{ if not .Date.IsZero }}
<p>
{{ if eq .PublishDate .Lastmod }}
{{ T "publishedOn" }} <time 2006-01-02datetime="{{ .PublishDate.Format "" }}">{{ .PublishDate.Format "2006-01-02" }}</time>
{{ T "publishedOn" }} <time datetime="{{ .PublishDate.Format "2006-01-02" }}">{{ .PublishDate.Format "2006-01-02" }}</time>
{{ else }}
{{ T "lastUpdatedOn" }} <time 2006-01-02datetime="{{ .Lastmod.Format "" }}">{{ .Lastmod.Format "2006-01-02" }}</time>
{{ T "lastUpdatedOn" }} <time datetime="{{ .Lastmod.Format "2006-01-02" }}">{{ .Lastmod.Format "2006-01-02" }}</time>
{{ end }}
</p>
{{ end }}
Expand Down
4 changes: 2 additions & 2 deletions page/themes/color-your-world/layouts/_default/sitemap.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{{- $pages := .RegularPages -}}
{{- $pages = where $pages "Params.sitemapexclude" "ne" true -}}
{{ printf "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\" ?>" | safeHTML }}
<urlset xmlns:xhtml="http://www.w3.org/1999/xhtml"
xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
xmlns:xhtml="http://www.w3.org/1999/xhtml">
{{ range $pages }}

<url>
Expand Down
20 changes: 10 additions & 10 deletions page/themes/color-your-world/layouts/partials/cover.html
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,13 @@
>

<img
$altText
.default class="cover" end end
height="{{ .Height }}"
class="cover"
{{ with .default }}
src="{{ .RelPermalink }}"
width="{{ .Width }}"
with with {{
{{ {{ {{ }}}} }} }}alt="{{ . }}"
height="{{ .Height }}"
{{ end }}
{{ with $altText }}alt="{{ . }}"{{ end }}
>

</picture>
Expand All @@ -55,10 +55,10 @@
<!-- Avoid trying to get width and height from SVG files -->
{{ if .input }}
<img
.MediaType.SubType
.input class="cover" if ne
class="cover"
{{ with .input }}
src="{{ .RelPermalink }}"
with {{ {{ }} "svg" }}
{{ if ne .MediaType.SubType "svg" }}
width="{{ .Width }}"
height="{{ .Height }}"
{{ end }}
Expand All @@ -70,9 +70,9 @@
<!-- If local file isn't found, assume it's a remote file -->
{{ with ($destination | safeURL) }}
<img
$altText
class="cover"
end src="{{ . }}" with {{{{ }} }}alt="{{ . }}"
src="{{ . }}"
{{ with $altText }}alt="{{ . }}"{{ end }}
>
{{ end }}
{{ end }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
-->

{{- range (resources.Match "fonts/*") -}}
<link as="font" crossorigin="anonymous" href="{{ .RelPermalink }}" rel="preload">
<link rel="preload" href="{{ .RelPermalink }}" as="font" crossorigin="anonymous">
{{ end -}}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
{{ $allAccentColors := union (slice $defaultLightAccent $defaultDarkAccent) .Site.Params.Style.presets }}

<div class="req-js">
<button changeMode class="outline-dashed"title="{{ T "" }}"><svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg"><use xlink:href="{{ $svgBundleLink }}#adjust"/></svg></button><input changeAccent class="outline-dashed" list="presets" title="{{ T " type="color"value="{{ if .Site.Params.Style.isDark }}{{ $defaultDarkAccent }}{{ else }}{{ $defaultLightAccent }}{{ end }}"" }}" aria-label="{{ T "changeAccent" }}"><datalist id="presets">{{ range $allAccentColors }}<option value="{{ . }}">{{ end }}</datalist>
<button class="outline-dashed" title="{{ T "changeMode" }}"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true"><use xlink:href="{{ $svgBundleLink }}#adjust"/></svg></button><input class="outline-dashed" type="color" list="presets" value="{{ if .Site.Params.Style.isDark }}{{ $defaultDarkAccent }}{{ else }}{{ $defaultLightAccent }}{{ end }}" title="{{ T "changeAccent" }}" aria-label="{{ T "changeAccent" }}"><datalist id="presets">{{ range $allAccentColors }}<option value="{{ . }}">{{ end }}</datalist>
</div>

<!-- noscript notice -->
Expand Down
2 changes: 1 addition & 1 deletion page/themes/color-your-world/layouts/partials/footer.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
{{ $processedLangs := slice }}

{{ range .Translations }}
{{ $currentLang := printf `<a href="%s" hreflang="%s" rel="alternate">%s</a>` .Language.Lang .RelPermalink .Language.LanguageName }}
{{ $currentLang := printf `<a rel="alternate" hreflang="%s" href="%s">%s</a>` .Language.Lang .RelPermalink .Language.LanguageName }}
{{ $processedLangs = $processedLangs | append $currentLang }}
{{ end }}

Expand Down
12 changes: 6 additions & 6 deletions page/themes/color-your-world/layouts/partials/head-style.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!-- Main CSS -->
{{ $main := resources.Get "scss/main.scss" | resources.ExecuteAsTemplate "css/main.scss" . | toCSS | minify | fingerprint }}
<link crossorigin="anonymous" href="{{ $main.Permalink }}" integrity="{{ $main.Data.Integrity }}" rel="stylesheet">
<link rel="stylesheet" href="{{ $main.Permalink }}" integrity="{{ $main.Data.Integrity }}" crossorigin="anonymous">


<!-- If JS is disabled -->
Expand All @@ -12,17 +12,17 @@
{{ if .Site.Params.Style.ignoreSystemSettings }}

{{ if .Site.Params.Style.isDark }}
<meta content="{{ $darkAccent }}" name="theme-color">
<meta name="theme-color" content="{{ $darkAccent }}">
{{ else }}
<meta content="{{ $lightAccent }}" name="theme-color">
<meta name="theme-color" content="{{ $lightAccent }}">
{{ end }}

{{ else }}
<meta content="{{ $darkAccent }}" media="(prefers-color-scheme: dark)" name="theme-color">
<meta content="{{ $lightAccent }}" media="(prefers-color-scheme: light)" name="theme-color">
<meta name="theme-color" content="{{ $darkAccent }}" media="(prefers-color-scheme: dark)">
<meta name="theme-color" content="{{ $lightAccent }}" media="(prefers-color-scheme: light)">
{{ end }}

{{ $noscript := resources.Get "scss/noscript.scss" | resources.ExecuteAsTemplate "css/noscript.scss" . | toCSS | minify | fingerprint }}
<link crossorigin="anonymous" href="{{ $noscript.Permalink }}" integrity="{{ $noscript.Data.Integrity }}" rel="stylesheet">
<link rel="stylesheet" href="{{ $noscript.Permalink }}" integrity="{{ $noscript.Data.Integrity }}" crossorigin="anonymous">

</noscript>
Loading

0 comments on commit 25cd8d1

Please sign in to comment.