Skip to content

Commit

Permalink
Learning me some hugo
Browse files Browse the repository at this point in the history
  • Loading branch information
orta committed Dec 18, 2023
1 parent 4979bdb commit 0d87446
Show file tree
Hide file tree
Showing 12 changed files with 344 additions and 13 deletions.
5 changes: 5 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"deno.enable": true,
"deno.lint": false,
"deno.unstable": true
}
38 changes: 38 additions & 0 deletions assets/themes/bright-white.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
:root {
--theme-name: "Bright white";
--theme-type: "light";
--theme-key: "#67ced2";
--theme-keyFG: "#000000";
--theme-keyStrong: "#26a0a5";
--theme-keyLight: "#ade6e9";
--theme-g_key: "#67ced2";
--theme-subBrand: "#FFC000";
--theme-subBrandFG: "#000000";
--theme-player: "#5DBAFC";
--theme-playerFG: "#000000";
--theme-playerLight: "#9EDDFF";
--theme-alt1: "#d26767";
--theme-alt2: "#fac16c";
--theme-alt3: "#7580bd";
--theme-fg: "#000000";
--theme-error: "#FF3C3C";
--theme-alwaysDark: "#111111";
--theme-alwaysLight: "#FFFFFF";
--theme-g_bg: "#f6f6f6";
--theme-g_bgAlt: "#F4F4F4";
--theme-g_bgDark: "#D6D6D6";
--theme-g_textDark: "#1B1B28";
--theme-g_textLight: "#FFFFFF";
--theme-g_blank: "#000000";
--theme-g_unsolved: "#C2C2C2";
--theme-g_outline: "#1B1D29";
--theme-a_bg: "#FFFFFF";
--theme-a_bgAlt: "#f8fbfc";
--theme-a_puzmo: "#FFC000";
--theme-a_headerText: "#000000";
--theme-a_table: "#EDEDED";
--theme-a_tableAlt: "#DBDBDB";
--theme-a_inlineTag: "#D9D9D9";
--theme-a_anchor: "#1F97EE";
--theme-a_infoBG: "#f6f6f6";
}
38 changes: 38 additions & 0 deletions assets/themes/console-beta.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
:root {
--theme-name: "Console (beta)";
--theme-type: "dark";
--theme-key: "#957df9";
--theme-keyFG: "#000000";
--theme-keyStrong: "#590FF5";
--theme-keyLight: "#590FF5";
--theme-subBrand: "#FFC000";
--theme-subBrandFG: "#000000";
--theme-g_key: "#FFFF00";
--theme-player: "#ffffff";
--theme-playerFG: "#000000";
--theme-playerLight: "#9EDDFF";
--theme-alt1: "#590ff5";
--theme-alt2: "#00e200";
--theme-alt3: "#ff8a02";
--theme-fg: "#00e200";
--theme-error: "#FF3C3C";
--theme-alwaysDark: "#1B1D29";
--theme-alwaysLight: "#00e200";
--theme-g_bg: "#101428";
--theme-g_bgAlt: "#101428";
--theme-g_bgDark: "#00e200";
--theme-g_textDark: "#00e200";
--theme-g_textLight: "#590ff5";
--theme-g_blank: "#00e200";
--theme-g_unsolved: "#0000ff";
--theme-g_outline: "#00e200";
--theme-a_bg: "#000000";
--theme-a_bgAlt: "#112211";
--theme-a_puzmo: "#ffffff";
--theme-a_headerText: "#00e200";
--theme-a_table: "#000000";
--theme-a_tableAlt: "#002200";
--theme-a_inlineTag: "#D9D9D9";
--theme-a_anchor: "#957df9";
--theme-a_infoBG: "#001900";
}
38 changes: 38 additions & 0 deletions assets/themes/foshay.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
:root {
--theme-name: "Foshay";
--theme-type: "light";
--theme-key: "#A4D379";
--theme-keyFG: "#313540";
--theme-keyStrong: "#94BF6D";
--theme-keyLight: "#B2E583";
--theme-g_key: "#A4D379";
--theme-player: "#56C9E9";
--theme-subBrand: "#FFC000";
--theme-subBrandFG: "#000000";
--theme-playerFG: "#292B35";
--theme-playerLight: "#A8B5D6";
--theme-alt1: "#98B389";
--theme-alt2: "#FAC16C";
--theme-alt3: "#D298FF";
--theme-error: "#FF3C3C";
--theme-fg: "#292B35";
--theme-alwaysDark: "#292B35";
--theme-alwaysLight: "#D1DBF2";
--theme-g_bg: "#949EBA";
--theme-g_bgAlt: "#8891AB";
--theme-g_bgDark: "#7B839B";
--theme-g_textDark: "#292B35";
--theme-g_textLight: "#FFFFFF";
--theme-g_blank: "#292B35";
--theme-g_unsolved: "#B6B7BA";
--theme-g_outline: "#676F83";
--theme-a_bg: "#828CA3";
--theme-a_bgAlt: "#7F889F";
--theme-a_puzmo: "#FFC000";
--theme-a_headerText: "#292B35";
--theme-a_table: "#7A8399";
--theme-a_tableAlt: "#767E94";
--theme-a_inlineTag: "#ECECEC";
--theme-a_anchor: "#56C9E9";
--theme-a_infoBG: "#767F95";
}
38 changes: 38 additions & 0 deletions assets/themes/hot-dog-beta.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
:root {
--theme-name: "Hot Dog (beta)";
--theme-type: "light";
--theme-key: "#FFFF00";
--theme-keyFG: "#000000";
--theme-keyStrong: "#FFE600";
--theme-keyLight: "#FFEC44";
--theme-g_key: "#FFFF00";
--theme-subBrand: "#FFC000";
--theme-subBrandFG: "#000000";
--theme-player: "#FF7A00";
--theme-playerFG: "#000000";
--theme-playerLight: "#FFA450";
--theme-alt1: "#3ABC5E";
--theme-alt2: "#5C3ABC";
--theme-alt3: "#BC3AAF";
--theme-fg: "#000000";
--theme-error: "#FF3C3C";
--theme-alwaysDark: "#1B1D29";
--theme-alwaysLight: "#FFFFFF";
--theme-g_bg: "#EBFF00";
--theme-g_bgAlt: "#EBEBEB";
--theme-g_bgDark: "#D6D6D6";
--theme-g_textDark: "#1B1B28";
--theme-g_textLight: "#FFFFFF";
--theme-g_blank: "#000000";
--theme-g_unsolved: "#C2C2C2";
--theme-g_outline: "#1B1D29";
--theme-a_bg: "#FF0000";
--theme-a_bgAlt: "#E50000";
--theme-a_puzmo: "#FFC000";
--theme-a_headerText: "#FFFFFF";
--theme-a_table: "#E50000";
--theme-a_tableAlt: "#FF2525";
--theme-a_inlineTag: "#000000";
--theme-a_anchor: "#000000";
--theme-a_infoBG: "#C6C6C6";
}
38 changes: 38 additions & 0 deletions assets/themes/outlook-hayesy-beta.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
:root {
--theme-name: "Outlook Hayesy (beta)";
--theme-type: "light";
--theme-key: "#DAB98C";
--theme-keyFG: "#000000";
--theme-keyStrong: "#B99368";
--theme-keyLight: "#DAB98C";
--theme-subBrand: "#FFC000";
--theme-subBrandFG: "#000000";
--theme-g_key: "#DAB98C";
--theme-player: "#5DBAFC";
--theme-playerFG: "#000000";
--theme-playerLight: "#9EDDFF";
--theme-alt1: "#5EC386";
--theme-alt2: "#5E93C3";
--theme-alt3: "#C35E5E";
--theme-fg: "#000000";
--theme-error: "#FF3C3C";
--theme-alwaysDark: "#5E390F";
--theme-alwaysLight: "#FFF3E4";
--theme-g_bg: "#FFFFFF";
--theme-g_bgAlt: "#EBEBEB";
--theme-g_bgDark: "#D6D6D6";
--theme-g_textDark: "#1B1B28";
--theme-g_textLight: "#FFFFFF";
--theme-g_blank: "#000000";
--theme-g_unsolved: "#C2C2C2";
--theme-g_outline: "#1B1D29";
--theme-a_bg: "#FEF5E8";
--theme-a_bgAlt: "#ffffff";
--theme-a_puzmo: "#FAC7CE";
--theme-a_headerText: "#000000";
--theme-a_table: "#FAE8D3";
--theme-a_tableAlt: "#EED7BC";
--theme-a_inlineTag: "#D9D9D9";
--theme-a_anchor: "#B99368";
--theme-a_infoBG: "#FFFFFF";
}
38 changes: 38 additions & 0 deletions assets/themes/puzzmo-dark.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
:root {
--theme-name: "Puzzmo (dark)";
--theme-type: "dark";
--theme-key: "#FFAAAC";
--theme-keyFG: "#000000";
--theme-keyStrong: "#F7868B";
--theme-keyLight: "#FFD2D3";
--theme-g_key: "#FFAAAC";
--theme-player: "#5DBAFC";
--theme-playerFG: "#000000";
--theme-playerLight: "#9EDDFF";
--theme-subBrand: "#FFC000";
--theme-subBrandFG: "#000000";
--theme-alt1: "#98B389";
--theme-alt2: "#FAC16C";
--theme-alt3: "#D298FF";
--theme-error: "#FF3C3C";
--theme-fg: "#ECECEC";
--theme-alwaysDark: "#1B1D29";
--theme-alwaysLight: "#FFFFFF";
--theme-g_bg: "#374351";
--theme-g_bgAlt: "#333D49";
--theme-g_bgDark: "#2C2F33";
--theme-g_textDark: "#F2F2F2";
--theme-g_textLight: "#20180E";
--theme-g_blank: "#000000";
--theme-g_unsolved: "#747474";
--theme-g_outline: "#646464";
--theme-a_bg: "#141620";
--theme-a_bgAlt: "#202433";
--theme-a_puzmo: "#FFC000";
--theme-a_headerText: "#A1BAD4";
--theme-a_table: "#303246";
--theme-a_tableAlt: "#393b52";
--theme-a_inlineTag: "#ECECEC";
--theme-a_anchor: "#1F97EE";
--theme-a_infoBG: "#282C3A";
}
38 changes: 38 additions & 0 deletions assets/themes/puzzmo-light.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
:root {
--theme-name: "Puzzmo (light)";
--theme-type: "light";
--theme-key: "#FFAAAC";
--theme-keyFG: "#000000";
--theme-keyStrong: "#F7868B";
--theme-keyLight: "#FFD2D3";
--theme-g_key: "#FFAAAC";
--theme-subBrand: "#FFC000";
--theme-subBrandFG: "#000000";
--theme-player: "#5DBAFC";
--theme-playerFG: "#000000";
--theme-playerLight: "#9EDDFF";
--theme-alt1: "#98B389";
--theme-alt2: "#FAC16C";
--theme-alt3: "#D298FF";
--theme-fg: "#000000";
--theme-error: "#FF3C3C";
--theme-alwaysDark: "#1B1D29";
--theme-alwaysLight: "#FFFFFF";
--theme-g_bg: "#FFFFFF";
--theme-g_bgAlt: "#EBEBEB";
--theme-g_bgDark: "#D6D6D6";
--theme-g_textDark: "#1B1B28";
--theme-g_textLight: "#FFFFFF";
--theme-g_blank: "#000000";
--theme-g_unsolved: "#C2C2C2";
--theme-g_outline: "#1B1D29";
--theme-a_bg: "#F2F2F2";
--theme-a_bgAlt: "#ECECEC";
--theme-a_puzmo: "#FFC000";
--theme-a_headerText: "#000000";
--theme-a_table: "#DFDFDF";
--theme-a_tableAlt: "#D2D2D2";
--theme-a_inlineTag: "#D9D9D9";
--theme-a_anchor: "#1F97EE";
--theme-a_infoBG: "#FFFFFF";
}
38 changes: 38 additions & 0 deletions assets/themes/submersible.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
:root {
--theme-name: "Submersible";
--theme-type: "dark";
--theme-key: "#CD6DC6";
--theme-keyFG: "#031698";
--theme-keyStrong: "#FF7ABC";
--theme-keyLight: "#B467CB";
--theme-g_key: "#CD6DC6";
--theme-subBrand: "#FFC000";
--theme-subBrandFG: "#000000";
--theme-player: "#4AB1D1";
--theme-playerFG: "#071D47";
--theme-playerLight: "#3C99D7";
--theme-alt1: "#8BA964";
--theme-alt2: "#C69A58";
--theme-alt3: "#7644B5";
--theme-fg: "#FFEBFF";
--theme-error: "#FF3C3C";
--theme-alwaysDark: "#031698";
--theme-alwaysLight: "#FFEBFF";
--theme-g_bg: "#043BED";
--theme-g_bgAlt: "#0A31CC";
--theme-g_bgDark: "#0E2DA8";
--theme-g_textDark: "#031698";
--theme-g_textLight: "#FFEBFF";
--theme-g_blank: "#031698";
--theme-g_unsolved: "#3662F1";
--theme-g_outline: "#031698";
--theme-a_bg: "#043BED";
--theme-a_bgAlt: "#0A31CC";
--theme-a_puzmo: "#FFC000";
--theme-a_headerText: "#FFEBFF";
--theme-a_table: "#043BED";
--theme-a_tableAlt: "#0A31CC";
--theme-a_inlineTag: "#FF7ABC";
--theme-a_anchor: "#FF7ABC";
--theme-a_infoBG: "#0A31CC";
}
1 change: 1 addition & 0 deletions content/posts/2023/12/13/first.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ title = 'First Post'
date = 2023-12-13T12:56:32Z
authors = ["orta"]
tags = ["meta"]
theme = "foshay"
+++

### Hello world!
Expand Down
19 changes: 6 additions & 13 deletions layouts/_default/single.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ <h1 class="!my-0 pb-2.5">{{ .Title }}</h1>
{{ end }}
</header>

{{ if .Params.theme }}
<link rel="stylesheet" type="text/css" href="/assets/themes/{{.Params.theme}}.css" />
{{ else }}
<link rel="stylesheet" type="text/css" href="/assets/themes/puzzmo-light.css" />
{{ end }}

<section>{{ .Content }}</section>

<!-- Post Tags -->
Expand Down Expand Up @@ -62,19 +68,6 @@ <h1 class="!my-0 pb-2.5">{{ .Title }}</h1>
{{ end }}<!---->
{{ end }}

<!-- Disqus -->
{{ if and site.DisqusShortname (not (eq .Params.comments false)) }}
<div class="mt-24" id="disqus_thread"></div>
<script>
const disqusShortname = '{{ site.DisqusShortname }}';
const script = document.createElement('script');
script.src = 'https://' + disqusShortname + '.disqus.com/embed.js';
script.setAttribute('data-timestamp', +new Date());
document.head.appendChild(script);
</script>
{{ end }}


<!-- giscus comment -->
{{ if and site.Params.giscus.repo (eq .Params.comments true) }}
<div class="giscus mt-24"></div>
Expand Down
28 changes: 28 additions & 0 deletions scripts/syncThemes.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/**
deno run scripts/syncThemes.ts
only works for puzzmo folks, because it requires an internal submodule in the app repo
*/

import { themes } from "../../app/src/shared/themes.ts";

for (const theme of themes) {
const vars = Object.entries(theme).map(([key, value]) => `--theme-${key}: "${value}";`).join("\n");
const css = `:root {\n${vars}\n}`;
const path = `assets/themes/${slugify(theme.name)}.css`;
Deno.writeTextFileSync(path, css, { create: true });
}


function slugify (text: string) {
return text
.toString()
.normalize("NFD")
.replace(/[\u0300-\u036f]/g, "")
.toLowerCase()
.trim()
.replace(/\s+/g, "-")
.replace(/[^\w-]+/g, "")
.replace(/--+/g, "-")

}

0 comments on commit 0d87446

Please sign in to comment.