commit d5d971da3bbf04aa5226d91a11a3e547754362d3 Author: Joe Ardent Date: Fri Nov 11 17:07:47 2022 -0800 mvp diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..76ce7fc --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +*.jpg diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..bf26202 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "themes/apollo"] + path = themes/apollo + url = git@github.com:nebkor/apollo.git diff --git a/config.toml b/config.toml new file mode 100644 index 0000000..94606b4 --- /dev/null +++ b/config.toml @@ -0,0 +1,40 @@ +name = "From the Office of the Chief Sundries Officer and Head of R&D" + +# The URL the site will be built for +base_url = "https://proclamations.nebcorp-hias.com" + +# Whether to automatically compile all Sass files in the sass directory +compile_sass = true + +# Whether to build a search index to be used later on by a JavaScript library +build_search_index = true + +generate_feed = true + +taxonomies = [ + {name = "tags"}, +] + +[markdown] +# Whether to do syntax highlighting +# Theme can be customised by setting the `highlight_theme` variable to a theme supported by Zola +highlight_code = true + +[extra] +# Put all your custom variables here +socials = [ + { name = "gitlab", url = "https://gitlab.com/nebkor", icon = "gitlab" }, + { name = "github", url = "https://github.com/nebkor", icon = "github" }, + { name = "mastodon", url = "https://socialnotwork.net/@nebkor", icon = "mastodon" }, +] + +toc = false +use_cdn = false +favicon = "/icon/favicon.png" +theme = "auto" + +menu = [ + { name = "R&D", url = "/rnd", weight = 1 }, + { name = "sundries", url = "/sundries", weight = 2 }, + { name = "(about)", url = "/about", weight = 3 }, +] diff --git a/content/about.md b/content/about.md new file mode 100644 index 0000000..1c29cac --- /dev/null +++ b/content/about.md @@ -0,0 +1,11 @@ ++++ +title = "About these Proclamations" +path = "about" ++++ + +Congratulations: you've arrived at the one-stop destination for all news about and instructions from +NebCorp Heavy Industries & Sundries. Here at NebCorp HIAS, we (I) take our (my) obligations very +seriously, and that means ensuring all cogs (you) are fully conditioned and equipped with only +NebCorp-approved technology. + +Remember, "Consumption Is Mandatory!™" diff --git a/content/index.md b/content/index.md new file mode 100644 index 0000000..fa3db20 --- /dev/null +++ b/content/index.md @@ -0,0 +1,9 @@ ++++ +toc = false +title = "From the Desk of the Head of R&D and Chief Sundries Officer" +sort_by = "date" +generate_feed = true +path = "." ++++ + +# - [Welcome](./about) diff --git a/content/rnd/_index.md b/content/rnd/_index.md new file mode 100644 index 0000000..0cc9b7b --- /dev/null +++ b/content/rnd/_index.md @@ -0,0 +1,4 @@ ++++ +[extra] +#section_path = "posts/_index.md" ++++ diff --git a/content/sundries/_index.md b/content/sundries/_index.md new file mode 100644 index 0000000..bbbbab9 --- /dev/null +++ b/content/sundries/_index.md @@ -0,0 +1,4 @@ ++++ +title = "Sundries, by NebCorp HIAS" +sort_by = "date" ++++ diff --git a/content/sundries/a-very-digital-artifact/index.md b/content/sundries/a-very-digital-artifact/index.md new file mode 100644 index 0000000..8961442 --- /dev/null +++ b/content/sundries/a-very-digital-artifact/index.md @@ -0,0 +1,9 @@ ++++ +title = "A Very Digital Artifact" +slug = "a-very-digital-artifact" +date = "2022-11-11" +#[taxonomies] +#tags = ["3dprinting", "CAD", "GIS", "CNC", "art", "sundries"] ++++ + +![a CNC-carved exaggerated relief of California made of plywood](PXL_20220723_214758454.jpg) diff --git a/sass/fonts.scss b/sass/fonts.scss new file mode 100644 index 0000000..d87ae41 --- /dev/null +++ b/sass/fonts.scss @@ -0,0 +1,15 @@ +@font-face { + font-family: 'Jetbrains Mono'; + font-style: normal; + font-weight: 400; + src: url('../fonts/JetbrainsMono/JetBrainsMono-Regular.ttf'), local('ttf'); + font-display: swap; +} + +@font-face { + font-family: 'Space Grotesk'; + font-style: normal; + font-weight: 400; + src: url('../fonts/SpaceGrotesk/SpaceGrotesk-Regular.ttf'), local('ttf'); + font-display: swap; +} \ No newline at end of file diff --git a/sass/main.scss b/sass/main.scss new file mode 100644 index 0000000..daf0dbf --- /dev/null +++ b/sass/main.scss @@ -0,0 +1,49 @@ +@import "parts/_cards.scss"; +@import "parts/_code.scss"; +@import "parts/_header.scss"; +@import "parts/_image.scss"; +@import "parts/misc.scss"; +@import "parts/table.scss"; +@import "parts/tags.scss"; + +:root { + /* Used for: block comment, hr, ... */ + --border-color: var(--bg-1); + + /* Fonts */ + --text-font: 'Jetbrains Mono'; + --header-font: 'Space Grotesk'; + --code-font: 'Jetbrains Mono'; +} + +html { + background-color: var(--bg-0); + color: var(--text-0); + font-family: var(--text-font); + line-height: 1.6em; +} + +.content { + max-width: 944px; + margin: 0 auto; + padding: 0 24px; + word-wrap: break-word; +} + +@media all and (min-width:640px) { + html { + font-size: 16.5px; + } +} + +@media all and (min-width:720px) { + html { + font-size: 17px; + } +} + +@media all and (min-width:960px) { + html { + font-size: 18px; + } +} \ No newline at end of file diff --git a/sass/parts/_cards.scss b/sass/parts/_cards.scss new file mode 100644 index 0000000..a23fd91 --- /dev/null +++ b/sass/parts/_cards.scss @@ -0,0 +1,44 @@ +.cards { + display: grid; + grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); + grid-template-rows: auto; + gap: 24px; + padding: 12px 0; +} + +.card { + min-height: 100px; + background: var(--bg-2); + border: 2px solid var(--border-color); + border-radius: 10px; + overflow: hidden; +} + +.card-info { + padding: 0 24px 24px 24px; +} + +.card-title { + margin-top: 0.7em; +} + +.card-image { + border: unset; + width: 100%; +} + +.card-image-placeholder { + height: 12px; + width: 100%; +} + +.card-description { + margin-top: 0.5em; + overflow: hidden; +} + +@media all and (max-width:720px) { + .cards { + gap: 18px; + } +} \ No newline at end of file diff --git a/sass/parts/_code.scss b/sass/parts/_code.scss new file mode 100644 index 0000000..7c5758e --- /dev/null +++ b/sass/parts/_code.scss @@ -0,0 +1,113 @@ + +code { + background-color: var(--bg-1); + padding: 0.1em 0.2em; + border-radius: 5px; + border: 1px solid var(--border-color); +} + +pre { + /* Rounded border */ + border-radius: 5px; + border: 1px solid var(--border-color); + + line-height: 1.4; + overflow-x: auto; + padding: 1em; +} + +pre code { + background-color: transparent; + color: inherit; + font-size: 100%; + padding: 0; + + // We only want a border around `code` and not `pre code` blocks. + border: 0; +} + +pre { + font-family: var(--code-font); + position: relative; + -webkit-overflow-scrolling: touch; +} + +pre code[class*="language-"] { + -webkit-overflow-scrolling: touch; +} + +pre code[class*="language-"]::before { + background: black; + border-radius: 0 0 0.25rem 0.25rem; + color: white; + font-size: 12px; + letter-spacing: 0.025rem; + padding: 0.1rem 0.5rem; + position: absolute; + right: 0.1rem; + margin-top: 0.1rem; + text-align: right; + text-transform: uppercase; + top: 0; +} + +pre code[class="language-javaScript"]::before, +pre code[class="language-js"]::before { + content: "js"; + background: #f7df1e; + color: black; +} + +pre code[class*="language-yml"]::before, +pre code[class*="language-yaml"]::before { + content: "yaml"; + background: #f71e6a; + color: white; +} + +pre code[class*="language-shell"]::before, +pre code[class*="language-bash"]::before, +pre code[class*="language-sh"]::before { + content: "shell"; + background: green; + color: white; +} + +pre code[class*="language-json"]::before { + content: "json"; + background: dodgerblue; + color: #000000; +} + +pre code[class*="language-python"]::before, +pre code[class*="language-py"]::before { + content: "py"; + background: blue; + color: yellow; +} + +pre code[class*="language-css"]::before { + content: "css"; + background: cyan; + color: black; +} + +pre code[class*="language-go"]::before { + content: "Go"; + background: cyan; + color: royalblue; +} + +pre code[class*="language-md"]::before, +pre code[class*="language-md"]::before { + content: "Markdown"; + background: royalblue; + color: whitesmoke; +} + +pre code[class*="language-rust"]::before, +pre code[class*="language-rs"]::before { + content: "rust"; + background: #fff8f6; + color: #ff4647; +} \ No newline at end of file diff --git a/sass/parts/_header.scss b/sass/parts/_header.scss new file mode 100644 index 0000000..31fc388 --- /dev/null +++ b/sass/parts/_header.scss @@ -0,0 +1,114 @@ +.page-header { + font-size: 3em; + line-height: 100%; + font-family: var(--header-font); + margin: 4rem 0px 1rem 0px; +} + +.centered-header { + font-family: var(--header-font); + + position: absolute; + top: 40%; + left: 50%; + transform: translate(-50%, -50%); + text-align: center; + font-size: 4em; +} + +header { + display: flex; + flex-direction: row; + flex-wrap: wrap; + justify-content: space-between; + padding: 1em 0; +} + +header .main { + display: flex; + flex-direction: row; + flex-wrap: wrap; + justify-content: space-between; + align-items: flex-start; + gap: 12px; + font-size: 1.5rem; + + /* Otherwise header and menu is too close on small screens*/ + margin-bottom: 10px; +} + +.socials { + /* flex-child */ + flex-grow: 0; + /* flex-container */ + display: flex; + flex-direction: row; + flex-wrap: wrap; + justify-content: flex-start; + align-items: flex-end; + gap: 6px; +} + +.social { + border-bottom: unset; + background-image: unset; + padding: 2px; +} + +.social>img { + border: unset; + width: 24px; + height: 24px; + +} + +.meta { + color: #999; + letter-spacing: -0.5px; +} + +h1, +h2, +h3, +h4, +h5, +h6 { + font-size: 1.2rem; + margin-top: 2em; +} + +h1::before { + color: var(--primary-color); + content: "# "; +} + +h2::before { + color: var(--primary-color); + content: "## "; +} + +h3::before { + color: var(--primary-color); + content: "### "; +} + +h4::before { + color: var(--primary-color); + content: "#### "; +} + +h5::before { + color: var(--primary-color); + content: "##### "; +} + +h6::before { + color: var(--primary-color); + content: "###### "; +} + +@media (prefers-color-scheme: dark) { + .social>img { + filter: invert(1); + } +} \ No newline at end of file diff --git a/sass/parts/_image.scss b/sass/parts/_image.scss new file mode 100644 index 0000000..447f930 --- /dev/null +++ b/sass/parts/_image.scss @@ -0,0 +1,35 @@ +img { + border: 3px solid #ececec; + max-width: 100%; +} + +figure { + box-sizing: border-box; + display: inline-block; + margin: 0; + max-width: 100%; +} + +figure img { + max-height: 500px; +} + +@media screen and (min-width: 600px) { + figure { + padding: 0 40px; + } +} + +figure h4 { + font-size: 1rem; + margin: 0; + margin-bottom: 1em; +} + +figure h4::before { + content: "↳ "; +} + +svg { + max-height: 15px; +} \ No newline at end of file diff --git a/sass/parts/_misc.scss b/sass/parts/_misc.scss new file mode 100644 index 0000000..cecb254 --- /dev/null +++ b/sass/parts/_misc.scss @@ -0,0 +1,63 @@ +.primary-color { + color: var(--primary-color); +} + +.draft-label { + color: var(--hover-color); + text-decoration: none; + padding: 2px 4px; + border-radius: 4px; + margin-left: 6px; + background-color: var(--primary-color); +} + +::-moz-selection { + background: var(--primary-color); + color: var(--hover-color); + text-shadow: none; +} + +::selection { + background: var(--primary-color); + color: var(--hover-color); +} + +p { + line-height: 1.5; +} + +hr { + border: 0; + border-top: 3px solid var(--border-color); + margin: 1em 0; +} + +blockquote { + border-left: 3px solid var(--border-color); + color: #737373; + margin: 0; + padding-left: 1em; +} + +a { + border-bottom: 3px solid var(--primary-color); + color: inherit; + text-decoration: none; +} + +a:hover { + background-color: var(--primary-color); + color: var(--hover-color); +} + +time { + color: grey; +} + +/* Remove post list padding */ +@media screen and (max-width: 600px) { + .list>ul { + margin: 0; + padding: 0; + } +} \ No newline at end of file diff --git a/sass/parts/_table.scss b/sass/parts/_table.scss new file mode 100644 index 0000000..247db0f --- /dev/null +++ b/sass/parts/_table.scss @@ -0,0 +1,15 @@ +table { + border-spacing: 0; + border-collapse: collapse; +} + +table th { + padding: 6px 13px; + border: 1px solid #dfe2e5; + font-size: large; +} + +table td { + padding: 6px 13px; + border: 1px solid #dfe2e5; +} \ No newline at end of file diff --git a/sass/parts/_tags.scss b/sass/parts/_tags.scss new file mode 100644 index 0000000..461530c --- /dev/null +++ b/sass/parts/_tags.scss @@ -0,0 +1,12 @@ +.tags li::before { + content: "🏷 "; +} + +.tags a { + border-bottom: 3px solid var(--primary-color); +} + +.tags a:hover { + color: var(--hover_color); + background-color: var(--primary-color); +} \ No newline at end of file diff --git a/sass/theme/dark.scss b/sass/theme/dark.scss new file mode 100644 index 0000000..47d5c39 --- /dev/null +++ b/sass/theme/dark.scss @@ -0,0 +1,11 @@ +:root { + --text-0: rgba(255, 255, 255, 87%); + --text-1: rgba(255, 255, 255, 60%); + + --bg-0: #121212; + --bg-1: rgba(255, 255, 255, 5%); + --bg-2: rgba(23, 23, 23, 100%); + + --primary-color: #ef5350; + --hover-color: white; +} \ No newline at end of file diff --git a/sass/theme/light.scss b/sass/theme/light.scss new file mode 100644 index 0000000..d61fd8d --- /dev/null +++ b/sass/theme/light.scss @@ -0,0 +1,11 @@ +:root { + --text-0: rgba(0, 0, 0, 87%); + --text-1: rgba(0, 0, 0, 66%); + + --bg-0: #fff; + --bg-1: #f2f2f2; + --bg-2: #fefefe; + + --primary-color: #ef5350; + --hover-color: white; +} \ No newline at end of file diff --git a/static/fonts/.gitkeep b/static/fonts/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/static/fonts/JetbrainsMono/JetBrainsMono-Bold.ttf b/static/fonts/JetbrainsMono/JetBrainsMono-Bold.ttf new file mode 100644 index 0000000..710c34b Binary files /dev/null and b/static/fonts/JetbrainsMono/JetBrainsMono-Bold.ttf differ diff --git a/static/fonts/JetbrainsMono/JetBrainsMono-BoldItalic.ttf b/static/fonts/JetbrainsMono/JetBrainsMono-BoldItalic.ttf new file mode 100644 index 0000000..fdff00f Binary files /dev/null and b/static/fonts/JetbrainsMono/JetBrainsMono-BoldItalic.ttf differ diff --git a/static/fonts/JetbrainsMono/JetBrainsMono-ExtraBold.ttf b/static/fonts/JetbrainsMono/JetBrainsMono-ExtraBold.ttf new file mode 100644 index 0000000..eb94300 Binary files /dev/null and b/static/fonts/JetbrainsMono/JetBrainsMono-ExtraBold.ttf differ diff --git a/static/fonts/JetbrainsMono/JetBrainsMono-ExtraBoldItalic.ttf b/static/fonts/JetbrainsMono/JetBrainsMono-ExtraBoldItalic.ttf new file mode 100644 index 0000000..b70b4e7 Binary files /dev/null and b/static/fonts/JetbrainsMono/JetBrainsMono-ExtraBoldItalic.ttf differ diff --git a/static/fonts/JetbrainsMono/JetBrainsMono-ExtraLight.ttf b/static/fonts/JetbrainsMono/JetBrainsMono-ExtraLight.ttf new file mode 100644 index 0000000..74efced Binary files /dev/null and b/static/fonts/JetbrainsMono/JetBrainsMono-ExtraLight.ttf differ diff --git a/static/fonts/JetbrainsMono/JetBrainsMono-ExtraLightItalic.ttf b/static/fonts/JetbrainsMono/JetBrainsMono-ExtraLightItalic.ttf new file mode 100644 index 0000000..1a9d2d3 Binary files /dev/null and b/static/fonts/JetbrainsMono/JetBrainsMono-ExtraLightItalic.ttf differ diff --git a/static/fonts/JetbrainsMono/JetBrainsMono-Italic.ttf b/static/fonts/JetbrainsMono/JetBrainsMono-Italic.ttf new file mode 100644 index 0000000..ffd5d77 Binary files /dev/null and b/static/fonts/JetbrainsMono/JetBrainsMono-Italic.ttf differ diff --git a/static/fonts/JetbrainsMono/JetBrainsMono-Light.ttf b/static/fonts/JetbrainsMono/JetBrainsMono-Light.ttf new file mode 100644 index 0000000..c0682f9 Binary files /dev/null and b/static/fonts/JetbrainsMono/JetBrainsMono-Light.ttf differ diff --git a/static/fonts/JetbrainsMono/JetBrainsMono-LightItalic.ttf b/static/fonts/JetbrainsMono/JetBrainsMono-LightItalic.ttf new file mode 100644 index 0000000..f20bac9 Binary files /dev/null and b/static/fonts/JetbrainsMono/JetBrainsMono-LightItalic.ttf differ diff --git a/static/fonts/JetbrainsMono/JetBrainsMono-Medium.ttf b/static/fonts/JetbrainsMono/JetBrainsMono-Medium.ttf new file mode 100644 index 0000000..17ff945 Binary files /dev/null and b/static/fonts/JetbrainsMono/JetBrainsMono-Medium.ttf differ diff --git a/static/fonts/JetbrainsMono/JetBrainsMono-MediumItalic.ttf b/static/fonts/JetbrainsMono/JetBrainsMono-MediumItalic.ttf new file mode 100644 index 0000000..9b699bb Binary files /dev/null and b/static/fonts/JetbrainsMono/JetBrainsMono-MediumItalic.ttf differ diff --git a/static/fonts/JetbrainsMono/JetBrainsMono-Regular.ttf b/static/fonts/JetbrainsMono/JetBrainsMono-Regular.ttf new file mode 100644 index 0000000..9a5202e Binary files /dev/null and b/static/fonts/JetbrainsMono/JetBrainsMono-Regular.ttf differ diff --git a/static/fonts/JetbrainsMono/JetBrainsMono-SemiBold.ttf b/static/fonts/JetbrainsMono/JetBrainsMono-SemiBold.ttf new file mode 100644 index 0000000..84b7795 Binary files /dev/null and b/static/fonts/JetbrainsMono/JetBrainsMono-SemiBold.ttf differ diff --git a/static/fonts/JetbrainsMono/JetBrainsMono-SemiBoldItalic.ttf b/static/fonts/JetbrainsMono/JetBrainsMono-SemiBoldItalic.ttf new file mode 100644 index 0000000..ffa1f39 Binary files /dev/null and b/static/fonts/JetbrainsMono/JetBrainsMono-SemiBoldItalic.ttf differ diff --git a/static/fonts/JetbrainsMono/JetBrainsMono-Thin.ttf b/static/fonts/JetbrainsMono/JetBrainsMono-Thin.ttf new file mode 100644 index 0000000..1317bfe Binary files /dev/null and b/static/fonts/JetbrainsMono/JetBrainsMono-Thin.ttf differ diff --git a/static/fonts/JetbrainsMono/JetBrainsMono-ThinItalic.ttf b/static/fonts/JetbrainsMono/JetBrainsMono-ThinItalic.ttf new file mode 100644 index 0000000..bc72439 Binary files /dev/null and b/static/fonts/JetbrainsMono/JetBrainsMono-ThinItalic.ttf differ diff --git a/static/fonts/SpaceGrotesk/SpaceGrotesk-Bold.ttf b/static/fonts/SpaceGrotesk/SpaceGrotesk-Bold.ttf new file mode 100644 index 0000000..869a60f Binary files /dev/null and b/static/fonts/SpaceGrotesk/SpaceGrotesk-Bold.ttf differ diff --git a/static/fonts/SpaceGrotesk/SpaceGrotesk-Light.ttf b/static/fonts/SpaceGrotesk/SpaceGrotesk-Light.ttf new file mode 100644 index 0000000..76a195f Binary files /dev/null and b/static/fonts/SpaceGrotesk/SpaceGrotesk-Light.ttf differ diff --git a/static/fonts/SpaceGrotesk/SpaceGrotesk-Medium.ttf b/static/fonts/SpaceGrotesk/SpaceGrotesk-Medium.ttf new file mode 100644 index 0000000..667905f Binary files /dev/null and b/static/fonts/SpaceGrotesk/SpaceGrotesk-Medium.ttf differ diff --git a/static/fonts/SpaceGrotesk/SpaceGrotesk-Regular.ttf b/static/fonts/SpaceGrotesk/SpaceGrotesk-Regular.ttf new file mode 100644 index 0000000..792fe1b Binary files /dev/null and b/static/fonts/SpaceGrotesk/SpaceGrotesk-Regular.ttf differ diff --git a/static/fonts/SpaceGrotesk/SpaceGrotesk-SemiBold.ttf b/static/fonts/SpaceGrotesk/SpaceGrotesk-SemiBold.ttf new file mode 100644 index 0000000..0219302 Binary files /dev/null and b/static/fonts/SpaceGrotesk/SpaceGrotesk-SemiBold.ttf differ diff --git a/static/js/count.js b/static/js/count.js new file mode 100644 index 0000000..7c504bc --- /dev/null +++ b/static/js/count.js @@ -0,0 +1,270 @@ +// GoatCounter: https://www.goatcounter.com +// This file (and *only* this file) is released under the ISC license: +// https://opensource.org/licenses/ISC +;(function() { + 'use strict'; + + if (window.goatcounter && window.goatcounter.vars) // Compatibility with very old version; do not use. + window.goatcounter = window.goatcounter.vars + else + window.goatcounter = window.goatcounter || {} + + // Load settings from data-goatcounter-settings. + var s = document.querySelector('script[data-goatcounter]') + if (s && s.dataset.goatcounterSettings) { + try { var set = JSON.parse(s.dataset.goatcounterSettings) } + catch (err) { console.error('invalid JSON in data-goatcounter-settings: ' + err) } + for (var k in set) + if (['no_onload', 'no_events', 'allow_local', 'allow_frame', 'path', 'title', 'referrer', 'event'].indexOf(k) > -1) + window.goatcounter[k] = set[k] + } + + var enc = encodeURIComponent + + // Get all data we're going to send off to the counter endpoint. + var get_data = function(vars) { + var data = { + p: (vars.path === undefined ? goatcounter.path : vars.path), + r: (vars.referrer === undefined ? goatcounter.referrer : vars.referrer), + t: (vars.title === undefined ? goatcounter.title : vars.title), + e: !!(vars.event || goatcounter.event), + s: [window.screen.width, window.screen.height, (window.devicePixelRatio || 1)], + b: is_bot(), + q: location.search, + } + + var rcb, pcb, tcb // Save callbacks to apply later. + if (typeof(data.r) === 'function') rcb = data.r + if (typeof(data.t) === 'function') tcb = data.t + if (typeof(data.p) === 'function') pcb = data.p + + if (is_empty(data.r)) data.r = document.referrer + if (is_empty(data.t)) data.t = document.title + if (is_empty(data.p)) data.p = get_path() + + if (rcb) data.r = rcb(data.r) + if (tcb) data.t = tcb(data.t) + if (pcb) data.p = pcb(data.p) + return data + } + + // Check if a value is "empty" for the purpose of get_data(). + var is_empty = function(v) { return v === null || v === undefined || typeof(v) === 'function' } + + // See if this looks like a bot; there is some additional filtering on the + // backend, but these properties can't be fetched from there. + var is_bot = function() { + // Headless browsers are probably a bot. + var w = window, d = document + if (w.callPhantom || w._phantom || w.phantom) + return 150 + if (w.__nightmare) + return 151 + if (d.__selenium_unwrapped || d.__webdriver_evaluate || d.__driver_evaluate) + return 152 + if (navigator.webdriver) + return 153 + return 0 + } + + // Object to urlencoded string, starting with a ?. + var urlencode = function(obj) { + var p = [] + for (var k in obj) + if (obj[k] !== '' && obj[k] !== null && obj[k] !== undefined && obj[k] !== false) + p.push(enc(k) + '=' + enc(obj[k])) + return '?' + p.join('&') + } + + // Show a warning in the console. + var warn = function(msg) { + if (console && 'warn' in console) + console.warn('goatcounter: ' + msg) + } + + // Get the endpoint to send requests to. + var get_endpoint = function() { + var s = document.querySelector('script[data-goatcounter]') + if (s && s.dataset.goatcounter) + return s.dataset.goatcounter + return (goatcounter.endpoint || window.counter) // counter is for compat; don't use. + } + + // Get current path. + var get_path = function() { + var loc = location, + c = document.querySelector('link[rel="canonical"][href]') + if (c) { // May be relative or point to different domain. + var a = document.createElement('a') + a.href = c.href + if (a.hostname.replace(/^www\./, '') === location.hostname.replace(/^www\./, '')) + loc = a + } + return (loc.pathname + loc.search) || '/' + } + + // Run function after DOM is loaded. + var on_load = function(f) { + if (document.body === null) + document.addEventListener('DOMContentLoaded', function() { f() }, false) + else + f() + } + + // Filter some requests that we (probably) don't want to count. + goatcounter.filter = function() { + if ('visibilityState' in document && document.visibilityState === 'prerender') + return 'visibilityState' + if (!goatcounter.allow_frame && location !== parent.location) + return 'frame' + if (!goatcounter.allow_local && location.hostname.match(/(localhost$|^127\.|^10\.|^172\.(1[6-9]|2[0-9]|3[0-1])\.|^192\.168\.|^0\.0\.0\.0$)/)) + return 'localhost' + if (!goatcounter.allow_local && location.protocol === 'file:') + return 'localfile' + if (localStorage && localStorage.getItem('skipgc') === 't') + return 'disabled with #toggle-goatcounter' + return false + } + + // Get URL to send to GoatCounter. + window.goatcounter.url = function(vars) { + var data = get_data(vars || {}) + if (data.p === null) // null from user callback. + return + data.rnd = Math.random().toString(36).substr(2, 5) // Browsers don't always listen to Cache-Control. + + var endpoint = get_endpoint() + if (!endpoint) + return warn('no endpoint found') + + return endpoint + urlencode(data) + } + + // Count a hit. + window.goatcounter.count = function(vars) { + var f = goatcounter.filter() + if (f) + return warn('not counting because of: ' + f) + + var url = goatcounter.url(vars) + if (!url) + return warn('not counting because path callback returned null') + + var img = document.createElement('img') + img.src = url + img.style.position = 'absolute' // Affect layout less. + img.style.bottom = '0px' + img.style.width = '1px' + img.style.height = '1px' + img.loading = 'eager' + img.setAttribute('alt', '') + img.setAttribute('aria-hidden', 'true') + + var rm = function() { if (img && img.parentNode) img.parentNode.removeChild(img) } + img.addEventListener('load', rm, false) + document.body.appendChild(img) + } + + // Get a query parameter. + window.goatcounter.get_query = function(name) { + var s = location.search.substr(1).split('&') + for (var i = 0; i < s.length; i++) + if (s[i].toLowerCase().indexOf(name.toLowerCase() + '=') === 0) + return s[i].substr(name.length + 1) + } + + // Track click events. + window.goatcounter.bind_events = function() { + if (!document.querySelectorAll) // Just in case someone uses an ancient browser. + return + + var send = function(elem) { + return function() { + goatcounter.count({ + event: true, + path: (elem.dataset.goatcounterClick || elem.name || elem.id || ''), + title: (elem.dataset.goatcounterTitle || elem.title || (elem.innerHTML || '').substr(0, 200) || ''), + referrer: (elem.dataset.goatcounterReferrer || elem.dataset.goatcounterReferral || ''), + }) + } + } + + Array.prototype.slice.call(document.querySelectorAll("*[data-goatcounter-click]")).forEach(function(elem) { + if (elem.dataset.goatcounterBound) + return + var f = send(elem) + elem.addEventListener('click', f, false) + elem.addEventListener('auxclick', f, false) // Middle click. + elem.dataset.goatcounterBound = 'true' + }) + } + + // Add a "visitor counter" frame or image. + window.goatcounter.visit_count = function(opt) { + on_load(function() { + opt = opt || {} + opt.type = opt.type || 'html' + opt.append = opt.append || 'body' + opt.path = opt.path || get_path() + opt.attr = opt.attr || {width: '200', height: (opt.no_branding ? '60' : '80')} + + opt.attr['src'] = get_endpoint() + 'er/' + enc(opt.path) + '.' + enc(opt.type) + '?' + if (opt.no_branding) opt.attr['src'] += '&no_branding=1' + if (opt.style) opt.attr['src'] += '&style=' + enc(opt.style) + if (opt.start) opt.attr['src'] += '&start=' + enc(opt.start) + if (opt.end) opt.attr['src'] += '&end=' + enc(opt.end) + + var tag = {png: 'img', svg: 'img', html: 'iframe'}[opt.type] + if (!tag) + return warn('visit_count: unknown type: ' + opt.type) + + if (opt.type === 'html') { + opt.attr['frameborder'] = '0' + opt.attr['scrolling'] = 'no' + } + + var d = document.createElement(tag) + for (var k in opt.attr) + d.setAttribute(k, opt.attr[k]) + + var p = document.querySelector(opt.append) + if (!p) + return warn('visit_count: append not found: ' + opt.append) + p.appendChild(d) + }) + } + + // Make it easy to skip your own views. + if (location.hash === '#toggle-goatcounter') { + if (localStorage.getItem('skipgc') === 't') { + localStorage.removeItem('skipgc', 't') + alert('GoatCounter tracking is now ENABLED in this browser.') + } + else { + localStorage.setItem('skipgc', 't') + alert('GoatCounter tracking is now DISABLED in this browser until ' + location + ' is loaded again.') + } + } + + if (!goatcounter.no_onload) + on_load(function() { + // 1. Page is visible, count request. + // 2. Page is not yet visible; wait until it switches to 'visible' and count. + // See #487 + if (!('visibilityState' in document) || document.visibilityState === 'visible') + goatcounter.count() + else { + var f = function(e) { + if (document.visibilityState !== 'visible') + return + document.removeEventListener('visibilitychange', f) + goatcounter.count() + } + document.addEventListener('visibilitychange', f) + } + + if (!goatcounter.no_events) + goatcounter.bind_events() + }) +})(); + diff --git a/static/js/main.js b/static/js/main.js new file mode 100644 index 0000000..e69de29 diff --git a/static/social_icons/LICENSE b/static/social_icons/LICENSE new file mode 100644 index 0000000..993facc --- /dev/null +++ b/static/social_icons/LICENSE @@ -0,0 +1 @@ +All icons in this directory are downloaded from [FontAwesome](https://fontawesome.com/). They are part of the [free offer](https://fontawesome.com/license/free) and are licensed under [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/). \ No newline at end of file diff --git a/static/social_icons/apple.svg b/static/social_icons/apple.svg new file mode 100644 index 0000000..d0532d5 --- /dev/null +++ b/static/social_icons/apple.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/static/social_icons/bitcoin.svg b/static/social_icons/bitcoin.svg new file mode 100644 index 0000000..941d9b0 --- /dev/null +++ b/static/social_icons/bitcoin.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/static/social_icons/deviantart.svg b/static/social_icons/deviantart.svg new file mode 100644 index 0000000..7dbd0b6 --- /dev/null +++ b/static/social_icons/deviantart.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/static/social_icons/diaspora.svg b/static/social_icons/diaspora.svg new file mode 100644 index 0000000..55527b5 --- /dev/null +++ b/static/social_icons/diaspora.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/static/social_icons/discord.svg b/static/social_icons/discord.svg new file mode 100644 index 0000000..f0dfeab --- /dev/null +++ b/static/social_icons/discord.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/static/social_icons/discourse.svg b/static/social_icons/discourse.svg new file mode 100644 index 0000000..343bea6 --- /dev/null +++ b/static/social_icons/discourse.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/static/social_icons/email.svg b/static/social_icons/email.svg new file mode 100644 index 0000000..85245e2 --- /dev/null +++ b/static/social_icons/email.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/static/social_icons/ethereum.svg b/static/social_icons/ethereum.svg new file mode 100644 index 0000000..af202de --- /dev/null +++ b/static/social_icons/ethereum.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/static/social_icons/etsy.svg b/static/social_icons/etsy.svg new file mode 100644 index 0000000..ebc040a --- /dev/null +++ b/static/social_icons/etsy.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/static/social_icons/facebook.svg b/static/social_icons/facebook.svg new file mode 100644 index 0000000..0afaf7a --- /dev/null +++ b/static/social_icons/facebook.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/static/social_icons/github.svg b/static/social_icons/github.svg new file mode 100644 index 0000000..e32807a --- /dev/null +++ b/static/social_icons/github.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/static/social_icons/gitlab.svg b/static/social_icons/gitlab.svg new file mode 100644 index 0000000..b577d3f --- /dev/null +++ b/static/social_icons/gitlab.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/static/social_icons/google.svg b/static/social_icons/google.svg new file mode 100644 index 0000000..b3776b0 --- /dev/null +++ b/static/social_icons/google.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/static/social_icons/hacker-news.svg b/static/social_icons/hacker-news.svg new file mode 100644 index 0000000..23e3980 --- /dev/null +++ b/static/social_icons/hacker-news.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/static/social_icons/instagram.svg b/static/social_icons/instagram.svg new file mode 100644 index 0000000..89f63c4 --- /dev/null +++ b/static/social_icons/instagram.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/static/social_icons/linkedin.svg b/static/social_icons/linkedin.svg new file mode 100644 index 0000000..d54fcf5 --- /dev/null +++ b/static/social_icons/linkedin.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/static/social_icons/mastodon.svg b/static/social_icons/mastodon.svg new file mode 100644 index 0000000..5e12f81 --- /dev/null +++ b/static/social_icons/mastodon.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/static/social_icons/paypal.svg b/static/social_icons/paypal.svg new file mode 100644 index 0000000..efdc81a --- /dev/null +++ b/static/social_icons/paypal.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/static/social_icons/pinterest.svg b/static/social_icons/pinterest.svg new file mode 100644 index 0000000..eb977c2 --- /dev/null +++ b/static/social_icons/pinterest.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/static/social_icons/quora.svg b/static/social_icons/quora.svg new file mode 100644 index 0000000..375d302 --- /dev/null +++ b/static/social_icons/quora.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/static/social_icons/reddit.svg b/static/social_icons/reddit.svg new file mode 100644 index 0000000..a8a3a96 --- /dev/null +++ b/static/social_icons/reddit.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/static/social_icons/rss.svg b/static/social_icons/rss.svg new file mode 100644 index 0000000..b862886 --- /dev/null +++ b/static/social_icons/rss.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/static/social_icons/skype.svg b/static/social_icons/skype.svg new file mode 100644 index 0000000..3369aba --- /dev/null +++ b/static/social_icons/skype.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/static/social_icons/slack.svg b/static/social_icons/slack.svg new file mode 100644 index 0000000..0dbc26d --- /dev/null +++ b/static/social_icons/slack.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/static/social_icons/snapchat.svg b/static/social_icons/snapchat.svg new file mode 100644 index 0000000..2cd79dd --- /dev/null +++ b/static/social_icons/snapchat.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/static/social_icons/soundcloud.svg b/static/social_icons/soundcloud.svg new file mode 100644 index 0000000..4724d74 --- /dev/null +++ b/static/social_icons/soundcloud.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/static/social_icons/spotify.svg b/static/social_icons/spotify.svg new file mode 100644 index 0000000..1d393ba --- /dev/null +++ b/static/social_icons/spotify.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/static/social_icons/stack-exchange.svg b/static/social_icons/stack-exchange.svg new file mode 100644 index 0000000..0a3177f --- /dev/null +++ b/static/social_icons/stack-exchange.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/static/social_icons/stack-overflow.svg b/static/social_icons/stack-overflow.svg new file mode 100644 index 0000000..2ca50c7 --- /dev/null +++ b/static/social_icons/stack-overflow.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/static/social_icons/steam.svg b/static/social_icons/steam.svg new file mode 100644 index 0000000..b61f374 --- /dev/null +++ b/static/social_icons/steam.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/static/social_icons/telegram.svg b/static/social_icons/telegram.svg new file mode 100644 index 0000000..02f48c0 --- /dev/null +++ b/static/social_icons/telegram.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/static/social_icons/twitter.svg b/static/social_icons/twitter.svg new file mode 100644 index 0000000..0778f72 --- /dev/null +++ b/static/social_icons/twitter.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/static/social_icons/vimeo.svg b/static/social_icons/vimeo.svg new file mode 100644 index 0000000..d98368e --- /dev/null +++ b/static/social_icons/vimeo.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/static/social_icons/whatsapp.svg b/static/social_icons/whatsapp.svg new file mode 100644 index 0000000..d259142 --- /dev/null +++ b/static/social_icons/whatsapp.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/static/social_icons/youtube.svg b/static/social_icons/youtube.svg new file mode 100644 index 0000000..287dca2 --- /dev/null +++ b/static/social_icons/youtube.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/templates/404.html b/templates/404.html new file mode 100644 index 0000000..a0e1ee0 --- /dev/null +++ b/templates/404.html @@ -0,0 +1,8 @@ +{% extends "page.html" %} + +{% block main_content %} +
+ {{ post_macros::page_header(title="404")}} + Page not found :( +
+{% endblock main_content %} \ No newline at end of file diff --git a/templates/base.html b/templates/base.html new file mode 100644 index 0000000..97936d7 --- /dev/null +++ b/templates/base.html @@ -0,0 +1,18 @@ +{% import "macros/macros.html" as post_macros %} + + + +{% include "partials/header.html" %} + + +
+ {% include "partials/nav.html" %} + + {# Post page is the default #} + {% block main_content %} + Nothing here?! + {% endblock main_content %} +
+ + + \ No newline at end of file diff --git a/templates/cards.html b/templates/cards.html new file mode 100644 index 0000000..2c67f32 --- /dev/null +++ b/templates/cards.html @@ -0,0 +1,35 @@ +{% extends "base.html" %} + +{% block main_content %} + {% if section.extra.section_path -%} + {% set section = get_section(path=section.extra.section_path) %} + {% endif -%} + + {{ post_macros::page_header(title=section.title) }} + +
+ {%- if paginator %} + {%- set show_pages = paginator.pages -%} + {% else %} + {%- set show_pages = section.pages -%} + {% endif -%} + + {{ post_macros::cards_posts(pages=show_pages) }} +
+ + {% if paginator %} + + {% endif %} +{% endblock main_content %} \ No newline at end of file diff --git a/templates/index.html b/templates/index.html new file mode 100644 index 0000000..d0dfc01 --- /dev/null +++ b/templates/index.html @@ -0,0 +1 @@ +{% extends "section.html" %} diff --git a/templates/macros/macros.html b/templates/macros/macros.html new file mode 100644 index 0000000..86a3925 --- /dev/null +++ b/templates/macros/macros.html @@ -0,0 +1,180 @@ +{% macro list_posts(pages) %} + +{% endmacro list_posts %} + +{% macro tags(page, short=false) %} + {%- if page.taxonomies and page.taxonomies.tags %} + + {%- if short %} + :: + {%- set sep = "," -%} + {% else %} + :: tags:  + {%- set sep = " " -%} + {% endif -%} + {%- for tag in page.taxonomies.tags %} + + {%- if not loop.last %}{{ sep | safe }}{% endif -%} + {% endfor -%} + + {% endif -%} +{% endmacro tags %} + +{% macro page_header(title) %} + +{% endmacro content %} + +{% macro content(page) %} +
+
+
+ {#

{{ page.title }}

#} + {{ post_macros::page_header(title=page.title) }} + +
+ {% if page.date %} + Posted on + {% endif %} + + {% if page.draft %} + DRAFT + {% endif %} +
+
+ + {% if page.extra.tldr %} +
+ tl;dr: + {{ page.extra.tldr }} +
+ {% endif %} + + {# Optional table of contents #} + {% if config.extra.toc | default(value=false) %} + {% if page.toc %} +

Table of Contents

+
    + {% for h1 in page.toc %} +
  • + {{ h1.title }} + {% if h1.children %} +
      + {% for h2 in h1.children %} +
    • + {{ h2.title }} +
    • + + {% if h2.children %} + + {% endif %} + {% endfor %} +
    + {% endif %} +
  • + {% endfor %} +
+ {% endif %} + {% endif %} + +
+ {{ page.content | safe }} +
+ + {% if page.taxonomies and page.taxonomies.tags %} + + {% endif %} + +
+
+{% endmacro content %} + +{% macro cards_posts(pages) %} +
+ {%- for page in pages %} +
+ {% if page.extra.local_image %} + {{ + {% elif page.extra.remote_image %} + {{ + {% else %} +
+ {% endif %} + +
+

+ {% if page.extra.link_to %} + {{page.title}} + {% else %} + {{page.title}} + {% endif %} +

+ +
+ {%- if page.date %} + + {% endif -%} + {% if page.draft %} + DRAFT + {% endif %} +
+ +
+ {% if page.description %} + {{ page.description }} + {% endif %} +
+
+
+ + {% endfor -%} +
+{% endmacro cards_posts %} \ No newline at end of file diff --git a/templates/page.html b/templates/page.html new file mode 100644 index 0000000..9bf0abb --- /dev/null +++ b/templates/page.html @@ -0,0 +1,5 @@ +{% extends "base.html" %} + +{% block main_content %} + {{ post_macros::content(page=page)}} +{% endblock main_content %} \ No newline at end of file diff --git a/templates/partials/header.html b/templates/partials/header.html new file mode 100644 index 0000000..cb52ed1 --- /dev/null +++ b/templates/partials/header.html @@ -0,0 +1,67 @@ +{% import "macros/macros.html" as post_macros %} + + + + + + + {# Site title #} + {% set current_path = current_path | default(value="/") %} + {% if current_path == "/" %} + + {{ config.title | default(value="Home") }} + + {% else %} + + {{ page.title | default(value=config.title) | default(value="Post") }} + + {% endif %} + + {# Favicon #} + {% if config.extra.favicon %} + + {% endif %} + + {# Font from cdn or disk #} + {% if config.extra.use_cdn | default(value=false) %} + + + {% else %} + + {% endif %} + + {# Analytics #} + {% if config.extra.analytics.enabled and config.extra.analytics.goatcounter_user %} + {% set user = config.extra.analytics.goatcounter_user %} + {% set host = config.extra.analytics.goatcounter_host | default(value="goatcounter.com") %} + + + + {% endif %} + + {# RSS #} + + + {# Theme #} + {% set theme = config.extra.theme | default(value="light") %} + {% if theme == "dark" %} + + {% elif theme == "light" %} + + {% elif theme == "auto" %} + + + {% endif %} + + + + + {% if config.extra.stylesheets %} + {% for stylesheet in config.extra.stylesheets %} + + {% endfor %} + {% endif %} + \ No newline at end of file diff --git a/templates/partials/nav.html b/templates/partials/nav.html new file mode 100644 index 0000000..8a865b6 --- /dev/null +++ b/templates/partials/nav.html @@ -0,0 +1,25 @@ +
+
+ {{ config.title }} + +
+ {% for social in config.extra.socials %} + + {% endfor %} +
+
+ + +
diff --git a/templates/section.html b/templates/section.html new file mode 100644 index 0000000..e169115 --- /dev/null +++ b/templates/section.html @@ -0,0 +1,35 @@ +{% extends "base.html" %} + +{% block main_content %} + {% if section.extra.section_path -%} + {% set section = get_section(path=section.extra.section_path) %} + {% endif -%} + + {{ post_macros::page_header(title=section.title) }} + +
+ {%- if paginator %} + {%- set show_pages = paginator.pages -%} + {% else %} + {%- set show_pages = section.pages -%} + {% endif -%} + + {{ post_macros::list_posts(pages=show_pages) }} +
+ + {% if paginator %} + + {% endif %} +{% endblock main_content %} \ No newline at end of file diff --git a/templates/taxonomy_list.html b/templates/taxonomy_list.html new file mode 100644 index 0000000..e69de29 diff --git a/themes/apollo b/themes/apollo new file mode 160000 index 0000000..989bdd1 --- /dev/null +++ b/themes/apollo @@ -0,0 +1 @@ +Subproject commit 989bdd129b8bcb474a0336967e7c399433a23f64