From f661bdff5802b3a1630a00a7ae0feb554f19159b Mon Sep 17 00:00:00 2001
From: Sam Therapy <sam@samtherapy.net>
Date: Sat, 15 Oct 2022 23:16:27 +0200
Subject: [PATCH] commit message

Signed-off-by: Sam Therapy <sam@samtherapy.net>
---
 .drone.yml                        | 23 ++++++++++++++++++++---
 .vscode/settings.json             |  3 +++
 _config.ts                        | 19 ++++++++++++-------
 deno.json                         |  2 +-
 import_map.json                   |  5 ++---
 src/.domains                      |  1 +
 src/404.md                        |  2 +-
 src/_includes/layouts/base.tsx    | 22 ----------------------
 src/_includes/layouts/doctype.njk |  2 --
 src/_includes/layouts/head.njk    | 13 +++++++++++++
 src/_includes/styles/base.scss    | 18 +++++++++++++-----
 src/index.md                      | 22 ----------------------
 src/index.tsx                     | 19 +++++++++++++++++++
 13 files changed, 85 insertions(+), 66 deletions(-)
 create mode 100644 src/.domains
 delete mode 100644 src/_includes/layouts/base.tsx
 delete mode 100644 src/_includes/layouts/doctype.njk
 create mode 100644 src/_includes/layouts/head.njk
 delete mode 100644 src/index.md
 create mode 100644 src/index.tsx

diff --git a/.drone.yml b/.drone.yml
index 80c7c36..581c50e 100644
--- a/.drone.yml
+++ b/.drone.yml
@@ -18,7 +18,7 @@ steps:
     depends_on:
       - "Clone"
 
-  - name: Deploy
+  - name: Deploy to Deno Deploy
     image: git.froth.zone/sam/drone-deno-deploy
     environment:
       DENO_DEPLOY_TOKEN:
@@ -32,6 +32,23 @@ steps:
       - "Build site"
     when:
       branch:
-      - master
+        - master
       event:
-      - push
\ No newline at end of file
+        - push
+
+  - name: Push to Pages
+    image: plugins/gh-pages
+    settings:
+      remote_url:
+        from_secret: URL
+      target_branch: pages
+      pages_directory: dist/
+      user_name: Sam Therapy
+      user_email: sam@samtherapy.net
+    depends_on:
+      - "Build site"
+    when:
+      branch:
+        - master
+      event:
+        - push
diff --git a/.vscode/settings.json b/.vscode/settings.json
index 9ab804a..856accc 100644
--- a/.vscode/settings.json
+++ b/.vscode/settings.json
@@ -6,4 +6,7 @@
   "[typescript]": {
     "editor.defaultFormatter": "denoland.vscode-deno"
   },
+  "[typescriptreact]": {
+    "editor.defaultFormatter": "denoland.vscode-deno"
+  }
 }
diff --git a/_config.ts b/_config.ts
index 7f4d3ea..3b3fd7a 100644
--- a/_config.ts
+++ b/_config.ts
@@ -4,15 +4,17 @@ import lume from "lume/mod.ts";
 import attributes from "lume/plugins/attributes.ts";
 import codeHighlight from "lume/plugins/code_highlight.ts";
 import date from "lume/plugins/date.ts";
-import esbuild from "lume/plugins/esbuild.ts"
-import jsx_preact from "lume/plugins/jsx_preact.ts";
+import esbuild from "lume/plugins/esbuild.ts";
+import jsx from "lume/plugins/jsx_preact.ts";
 import lightningcss from "lume/plugins/lightningcss.ts";
 import minifyHTML from "lume/plugins/minify_html.ts";
+import remark from "lume/plugins/remark.ts";
 import sass from "lume/plugins/sass.ts";
+import sourceMaps from "lume/plugins/source_maps.ts";
 import svgo from "lume/plugins/svgo.ts";
 
 // Experimental plugins
-import mdx from "experimental/mdx/mod.ts"
+import mdx from "experimental/mdx/mod.ts";
 import sitemap from "experimental/sitemap/sitemap.ts";
 
 const site = lume({
@@ -23,21 +25,24 @@ const site = lume({
 
 site
   .copy("img")
+  .copy(".domains")
   .copy(".well-known")
   .use(attributes())
   .use(codeHighlight())
   .use(date())
-  .use(jsx_preact())
+  .use(jsx())
   .use(mdx())
+  .use(remark())
   .use(sitemap())
   .use(svgo())
   .remoteFile(
     "_includes/styles/external/nord.min.css",
     "https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@11.6.0/build/styles/nord.min.css",
-)
+  )
   .use(esbuild())
   .use(lightningcss())
-  .use(sass({ extensions: [ ".scss" ] }))
+  .use(sass({ extensions: [".scss"] }))
   .use(minifyHTML())
- 
+  .use(sourceMaps());
+
 export default site;
diff --git a/deno.json b/deno.json
index bace24a..fb51ade 100644
--- a/deno.json
+++ b/deno.json
@@ -7,6 +7,6 @@
   },
   "compilerOptions": {
     "jsx": "react-jsx",
-    "jsxImportSource": "preact"
+    "jsxImportSource": "npm:preact"
   }
 }
diff --git a/import_map.json b/import_map.json
index 1d6100a..15de893 100644
--- a/import_map.json
+++ b/import_map.json
@@ -1,8 +1,7 @@
 {
   "imports": {
-    "lume/": "https://deno.land/x/lume@v1.12.0/",
-    "preact/jsx-runtime": "https://deno.land/x/lume@v1.12.0/deps/preact_runtime.ts",
-    "preact": "https://deno.land/x/lume@v1.12.0/deps/preact.ts",
+    "lume/": "https://deno.land/x/lume@v1.12.1/",
+    "preact/jsx-runtime": "https://deno.land/x/lume@v1.11.4/deps/preact_runtime.ts",
     "experimental/": "https://raw.githubusercontent.com/lumeland/experimental-plugins/main/"
   }
 }
diff --git a/src/.domains b/src/.domains
new file mode 100644
index 0000000..ffa0b4f
--- /dev/null
+++ b/src/.domains
@@ -0,0 +1 @@
+samtherapy.xyz
\ No newline at end of file
diff --git a/src/404.md b/src/404.md
index fb59758..8ffc2b2 100644
--- a/src/404.md
+++ b/src/404.md
@@ -1,6 +1,6 @@
 ---
 title: 404 - There's Nothing Here
-layout: layouts/base.tsx
+layout: layouts/head.njk
 url: /404.html
 ---
 
diff --git a/src/_includes/layouts/base.tsx b/src/_includes/layouts/base.tsx
deleted file mode 100644
index d2429e7..0000000
--- a/src/_includes/layouts/base.tsx
+++ /dev/null
@@ -1,22 +0,0 @@
-// This exists because lume doesn't actually add the <!DOCTYPE> header when rendering.
-export const layout = "layouts/doctype.njk";
-
-import type { PageData } from "lume/core.ts";
-import Navbar from "../components/navbar.tsx";
-
-export default ({ title, children }: PageData) => (
-  <html lang="en">
-    <head>
-      <meta charSet="utf-8" />
-      <meta name="viewport" content="width=device-width, initial-scale=1.0" />
-      <title>{title}</title>
-      <link rel="shortcut icon" href="img/favicon.png" />
-      <link rel="stylesheet" href="/styles/style.css" />
-    </head>
-    <body>
-      <main class="container">
-        {children}
-      </main>
-    </body>
-  </html>
-);
diff --git a/src/_includes/layouts/doctype.njk b/src/_includes/layouts/doctype.njk
deleted file mode 100644
index e9cdbf3..0000000
--- a/src/_includes/layouts/doctype.njk
+++ /dev/null
@@ -1,2 +0,0 @@
-<!DOCTYPE html>
-{{ content | safe }}
diff --git a/src/_includes/layouts/head.njk b/src/_includes/layouts/head.njk
new file mode 100644
index 0000000..a911e65
--- /dev/null
+++ b/src/_includes/layouts/head.njk
@@ -0,0 +1,13 @@
+<!DOCTYPE html>
+<html lang="{{ language }}">
+	<head>
+		<meta charSet="utf-8"/>
+		<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
+		<link rel="shortcut icon" href="img/favicon.png"/>
+		<link rel="stylesheet" href="styles/style.css"/>
+		<title>{{ title }}</title>
+	</head>
+	<body>
+		{{ content | safe }}
+	</body>
+</html>
\ No newline at end of file
diff --git a/src/_includes/styles/base.scss b/src/_includes/styles/base.scss
index fa0b708..4a91f07 100644
--- a/src/_includes/styles/base.scss
+++ b/src/_includes/styles/base.scss
@@ -1,16 +1,24 @@
 // Imports
-@use "styles/external/pico/scss/pico"; // Pico Framework
-@use "styles/external/nord.min"; // Highlight.js
+// Pico CSS, https: //picocss.com/
+@use "styles/external/pico/scss/pico" with (
+  $primary-500: #9e9e9e,
+  $primary-600: #757575,
+  $primary-700: #616161
+);
 
-// Font
+// Highlight.js theme
+@use "styles/external/nord.min";
+
+// // Font
 @import url("https://rsms.me/inter/inter.css");
 
-html {
+/* CSS */
+:root {
   font-family: "Inter", sans-serif;
 }
 
 @supports (font-variation-settings: normal) {
-  html {
+  :root {
     font-family: "Inter var", sans-serif;
   }
 }
diff --git a/src/index.md b/src/index.md
deleted file mode 100644
index 0f30bb5..0000000
--- a/src/index.md
+++ /dev/null
@@ -1,22 +0,0 @@
----
-title: Sam Site 2.0 (currently under construction)
-layout: layouts/base.tsx
----
-
-# Hello there
-
-This is a website.
-
-## There appears to be nothing here
-
-You would be correct.
-
-### Currently under (re)construction
-
-It'll be ready, eventually. :)
-
-#### Plans
-
-As of now I'm using [lume.land](https://lume.land) and deploying to
-[Deno Deploy](https://deno.com/deploy) with a
-[custom Drone CI action](https://git.froth.zone/sam/drone-deno-deploy) ;)
diff --git a/src/index.tsx b/src/index.tsx
new file mode 100644
index 0000000..273adc7
--- /dev/null
+++ b/src/index.tsx
@@ -0,0 +1,19 @@
+import { PageData } from "lume/core.ts";
+
+export const title = "Sam Site 2.0";
+export const layout = "layouts/head.njk";
+
+export default ({ data }: PageData) => (
+  <>
+    <header class="container">
+      <hgroup>
+        <h1>{title}</h1>
+        <h2>Stuff</h2>
+      </hgroup>
+    </header>
+    <main class="container">
+      <p>There was a website here. There isn't anymore.</p>
+      <p>There will be, eventually.</p>
+    </main>
+  </>
+);
