Migrate to lume
Some checks failed
continuous-integration/drone Build is failing

WIP

Signed-off-by: Sam Therapy <sam@samtherapy.net>
This commit is contained in:
Sam Therapy 2022-10-11 20:41:01 +02:00
parent 1b5f0b63bf
commit 247b146e7d
Signed by: sam
GPG key ID: 4D8B07C18F31ACBD
26 changed files with 318 additions and 356 deletions

View file

@ -1,21 +1,26 @@
kind: pipeline
type: docker
name: example pipeline
steps:
- name: deploy
image: drillster/drone-rsync
settings:
user:
from_secret: user
hosts:
- samtherapy.net
port:
from_secret: port
key:
from_secret: rsync_key
recursive: true
source:
target:
from_secret: target
args:
from_secret: args
secrets: [ args, user, port, rsync_key, target ]
- name: Build site
image: denoland/deno:alpine
commands:
- deno task build
- name: Deploy to Deno Deploy (prod)
image: git.froth.zone/sam/drone-deno-deploy
environment:
DENO_DEPLOY_TOKEN:
from_secret: DENO_DEPLOY_TOKEN
settings:
project: samme-blog
entrypoint: server.ts
production: true
depends_on:
- "Build site"
when:
branch:
- master
event:
- push

12
.editorconfig Normal file
View file

@ -0,0 +1,12 @@
# EditorConfig is awesome: https://EditorConfig.org
# top-most EditorConfig file
root = true
[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

88
.gitignore vendored Normal file
View file

@ -0,0 +1,88 @@
# Lume generated site
dist/
# DS Store
.DS_Store
._.DS_Store
**/.DS_Store
**/._.DS_Store
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
# Runtime data
pids
*.pid
*.seed
*.pid.lock
# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov
# Coverage directory used by tools like istanbul
coverage
# nyc test coverage
.nyc_output
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt
# Bower dependency directory (https://bower.io/)
bower_components
# node-waf configuration
.lock-wscript
# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release
# Dependency directories
node_modules/
jspm_packages/
# TypeScript v1 declaration files
typings/
# Optional npm cache directory
.npm
# Optional eslint cache
.eslintcache
# Optional REPL history
.node_repl_history
# Output of 'npm pack'
*.tgz
# Yarn Integrity file
.yarn-integrity
# dotenv environment variables file
.env
# parcel-bundler cache (https://parceljs.org/)
.cache
# next.js build output
.next
# nuxt.js build output
.nuxt
# vuepress build output
.vuepress/dist
# Serverless directories
.serverless
# FuseBox cache
.fusebox/
# Snyk
.dccache

3
.gitmodules vendored Normal file
View file

@ -0,0 +1,3 @@
[submodule "src/_includes/styles/external/pico"]
path = src/_includes/styles/external/pico
url = https://github.com/picocss/pico

13
.vscode/settings.json vendored Normal file
View file

@ -0,0 +1,13 @@
{
"deno.enable": true,
"deno.lint": true,
"deno.unstable": true,
"deno.config": "./deno.json",
"[typescript]": {
"editor.defaultFormatter": "denoland.vscode-deno"
},
"deno.suggest.imports.hosts": {
"https://deno.land": true,
"https://esm.sh": true
}
}

View file

@ -1,27 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>The Abyss</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="shortcut icon" href="favicon.png" />
<link rel="stylesheet" href="style.css" />
</head>
<body>
<div align="center">
<h1>404</h1>
<em>
You may ask yourself:
<strong> well, how did I get here? </strong>
</em>
<br />
<small>
<small> By a bad link, probably </small>
</small>
<br />
<br />
<a href="https://samtherapy.net">Go back home</a>
</div>
</body>
</html>

35
PGP.asc
View file

@ -1,35 +0,0 @@
-----BEGIN PGP PUBLIC KEY BLOCK-----
xsDNBGCfNEIBDADbW1ulzxmX4D5eUswJk86tHI7xeopuH8mfITgvggv3fD8QjDPvlcxaLTZ6dqNw
ryYR585KK+ONBdbi+5aDtdeyBkhdW0Qky+F0Zfr1lLkn3XaNzJuEYYosnvVH52QnYq7Wi6Azku14
Z1b0+8ZPgT4/VoxC+t2fleo1tdlveBwzGN0yj/XuSWBrcvbykGYZotz265zzny10WCMFK9XVSP/N
cecHia1+OwsT1DWr1d1j5FyZV6RWVqwhn12j8fNeXi3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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 jsx_preact from "lume/plugins/jsx_preact.ts";
// import lightningcss from "lume/plugins/lightningcss.ts";
import sass from "lume/plugins/sass.ts";
import svgo from "lume/plugins/svgo.ts";
const site = lume({
src: "./src",
dest: "./dist",
});
site
.copy("img")
.copy(".well-known")
.use(attributes())
.use(date())
.use(jsx_preact())
// .use(mdx())
.use(sass())
.use(codeHighlight())
// .use(lightningcss())
.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",
);
export default site;

12
deno.json Normal file
View file

@ -0,0 +1,12 @@
{
"importMap": "import_map.json",
"tasks": {
"lume": "deno eval \"import 'lume/task.ts'\" --",
"build": "deno task lume",
"serve": "deno task lume -s"
},
"compilerOptions": {
"jsx": "react-jsx",
"jsxImportSource": "preact"
}
}

7
import_map.json Normal file
View file

@ -0,0 +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"
}
}

View file

@ -1,191 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>Plain HTML is good</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no" />
<link rel="shortcut icon" href="favicon.png" />
<link rel="stylesheet" href="style.css" />
</head>
<body>
<span id="header">
<h1>Just somebody on the internet</h1>
<h2>Just a person on the internet too much.</h2>
<br />
<br />
</span>
<div id="grid">
<div class="top">
<div class="left">
<iframe allowfullscreen sandbox="allow-top-navigation allow-scripts" width="400" height="600"
src="https://fedifeed.com/api/v1/feed?user=sam&instance=https%3A%2F%2Ffroth.zone&instance_type=&theme=pleroma&size=95&header=true&replies=false&boosts=false"></iframe>
</div>
<div class="right">
<table id="hosting">
<tr>
<th>Things I host</th>
</tr>
<tr>
<td>
<a href="https://froth.zone">Pleroma</a>
</td>
</tr>
<tr>
<td>
<a href="https://git.froth.zone">Gitea</a>
</td>
</tr>
<tr>
<td>
<a href="https://blog.froth.zone">Writefreely</a>
</td>
</tr>
<tr>
<td>
<a href="https://mk.froth.zone">Misskey</a>
</td>
</tr>
<tr>
<td>
<a href="https://funkwhale.samtherapy.net">Funkwhale</a>
</td>
</tr>
<tr>
<td>
<a href="https://tube.froth.zone">Peertube</a>
</td>
</tr>
<tr>
<td>
<a href="https://poopchan.org">Poopchan</a>
</td>
</tr>
<tr>
<td>
<a href="https://cy.tube.froth.zone">Cytube</a>
</td>
</tr>
<tr>
<td>
<a href="https://invidious.samtherapy.net">Invidious</a>
</td>
</tr>
<tr>
<td>
<a href="https://nitter.bird.froth.zone">Nitter</a>
</td>
</tr>
<tr>
<td>
<a href="https://bibliogram.froth.zone">Bibliogram</a>
</td>
</tr>
<tr>
<td>
<a href="https://teddit.froth.zone">Teddit</a>
</td>
</tr>
<tr>
<td>
<a href="https://scribe.froth.zone">Scribe</a>
</td>
</tr>
<tr>
<td>
<a href="https://f.ruina.exposed">linx-server</a>
</td>
</tr>
<tr>
<td>
<a href="https://fedifeed.com/">Fedifeed</a>
<br />(left)
</td>
</tr>
</table>
<br /><br />
<table id="comms">
<tr>
<th>Find me if you want to</th>
</tr>
<tr>
<td>
<a href="https://froth.zone/users/sam">Shitpost</a>
</td>
</tr>
<tr>
<td>
<a href="https://mk.froth.zone/@samme">Misskey alt</a>
</td>
</tr>
<tr>
<td>
<a href="https://git.froth.zone/Sam">Code</a>
</td>
</tr>
<tr>
<td>
<a href="https://blog.froth.zone/sam/">Blog</a>
</td>
</tr>
<tr>
<td>
<a href="https://pixelfed.froth.zone/sam/">Images, possibly</a>
</td>
</tr>
</table>
</div>
</div>
<div class="bottom">
<div class="left">
<br />
<br />
<details>
<summary>Contact details</summary>
<br />
Maybe my
<a href="/PGP.asc">PGP key</a>
if you want to shoot me an email?<br />
<small>
The fingerprint is 31EC 437B 458E 29B4 2F76 4409 4D8B 07C1 8F31
ACBD
<br /><br />
<small>
the email is sam @ this website
<br />
or on XMPP, same address
<br />
or on Matrix, @samme:schizo.cafe
</small>
</small>
</details>
</div>
<div class="right">
<br />
<br />
<em>
cool people's secrtion
<div id="frens">
<a href="https://8777.ch/">8777.ch</a>
|
<a href="https://coy.neocities.org/~coy/">coy.neocities.org</a>
|
<a href="https://grumbulon.xyz/">grumbulon.xyz</a>
|
<a href="https://nekobit.net/">nekobit.net</a>
|
<a href="https://newblue.life/">newblue.life</a>
|
<a href="https://the.waifuism.life">the.waifuism.life</a>
</div>
</em>
</div>
</div>
</div>
</footer>
</body>
</html>

24
serve.ts Normal file
View file

@ -0,0 +1,24 @@
import { Application, Router } from "https://deno.land/x/oak@v11.1.0/mod.ts";
const app = new Application();
// First we try to serve static files from the dist folder. If that fails, we
// fall through to the router below.
app.use(async (ctx, next) => {
try {
await ctx.send({
root: `${Deno.cwd()}/dist`,
index: "index.html",
});
} catch {
next();
}
});
const router = new Router();
// After creating the router, we can add it to the app.
app.use(router.routes());
app.use(router.allowedMethods());
await app.listen({ port: 8000 });

13
src/404.md Normal file
View file

@ -0,0 +1,13 @@
---
title: 404 - There's Nothing Here
layout: layouts/base.tsx
url: /404.html
---
# You've found a dead end!
Would you like to [return](/)?
```ts
window.location.replace("/");
```

View file

@ -0,0 +1,16 @@
export default () => {
return (
<nav>
<ul>
<ul>
<li>
<a href="https://google.com">Test</a>
</li>
<li>
<a href="https://google.com">Test 2</a>
</li>
</ul>
</ul>
</nav>
);
};

View file

@ -0,0 +1,27 @@
// 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>
{/* <header>
{/* <Navbar />
</header> */}
<main>
{children}
</main>
</body>
</html>
);

View file

@ -0,0 +1,2 @@
<!DOCTYPE html>
{{ content | safe }}

View file

@ -0,0 +1,16 @@
// Imports
@use "styles/external/pico/scss/pico.classless"; // Pico Framework
@use "styles/external/nord.min"; // Highlight.js
// Font
@import url("https://rsms.me/inter/inter.css");
html {
font-family: "Inter", sans-serif;
}
@supports (font-variation-settings: normal) {
html {
font-family: "Inter var", sans-serif;
}
}

View file

@ -0,0 +1 @@
pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs{background:#2e3440}.hljs,.hljs-subst{color:#d8dee9}.hljs-selector-tag{color:#81a1c1}.hljs-selector-id{color:#8fbcbb;font-weight:700}.hljs-selector-attr,.hljs-selector-class{color:#8fbcbb}.hljs-property,.hljs-selector-pseudo{color:#88c0d0}.hljs-addition{background-color:rgba(163,190,140,.5)}.hljs-deletion{background-color:rgba(191,97,106,.5)}.hljs-built_in,.hljs-class,.hljs-type{color:#8fbcbb}.hljs-function,.hljs-function>.hljs-title,.hljs-title.hljs-function{color:#88c0d0}.hljs-keyword,.hljs-literal,.hljs-symbol{color:#81a1c1}.hljs-number{color:#b48ead}.hljs-regexp{color:#ebcb8b}.hljs-string{color:#a3be8c}.hljs-title{color:#8fbcbb}.hljs-params{color:#d8dee9}.hljs-bullet{color:#81a1c1}.hljs-code{color:#8fbcbb}.hljs-emphasis{font-style:italic}.hljs-formula{color:#8fbcbb}.hljs-strong{font-weight:700}.hljs-link:hover{text-decoration:underline}.hljs-comment,.hljs-quote{color:#4c566a}.hljs-doctag{color:#8fbcbb}.hljs-meta,.hljs-meta .hljs-keyword{color:#5e81ac}.hljs-meta .hljs-string{color:#a3be8c}.hljs-attr{color:#8fbcbb}.hljs-attribute{color:#d8dee9}.hljs-name{color:#81a1c1}.hljs-section{color:#88c0d0}.hljs-tag{color:#81a1c1}.hljs-template-variable,.hljs-variable{color:#d8dee9}.hljs-template-tag{color:#5e81ac}.language-abnf .hljs-attribute{color:#88c0d0}.language-abnf .hljs-symbol{color:#ebcb8b}.language-apache .hljs-attribute{color:#88c0d0}.language-apache .hljs-section{color:#81a1c1}.language-arduino .hljs-built_in{color:#88c0d0}.language-aspectj .hljs-meta{color:#d08770}.language-aspectj>.hljs-title{color:#88c0d0}.language-bnf .hljs-attribute{color:#8fbcbb}.language-clojure .hljs-name{color:#88c0d0}.language-clojure .hljs-symbol{color:#ebcb8b}.language-coq .hljs-built_in{color:#88c0d0}.language-cpp .hljs-meta .hljs-string{color:#8fbcbb}.language-css .hljs-built_in{color:#88c0d0}.language-css .hljs-keyword{color:#d08770}.language-diff .hljs-meta,.language-ebnf .hljs-attribute{color:#8fbcbb}.language-glsl .hljs-built_in{color:#88c0d0}.language-groovy .hljs-meta:not(:first-child),.language-haxe .hljs-meta,.language-java .hljs-meta{color:#d08770}.language-ldif .hljs-attribute{color:#8fbcbb}.language-lisp .hljs-name,.language-lua .hljs-built_in,.language-moonscript .hljs-built_in,.language-nginx .hljs-attribute{color:#88c0d0}.language-nginx .hljs-section{color:#5e81ac}.language-pf .hljs-built_in,.language-processing .hljs-built_in{color:#88c0d0}.language-scss .hljs-keyword,.language-stylus .hljs-keyword{color:#81a1c1}.language-swift .hljs-meta{color:#d08770}.language-vim .hljs-built_in{color:#88c0d0;font-style:italic}.language-yaml .hljs-meta{color:#d08770}

1
src/_includes/styles/external/pico vendored Submodule

@ -0,0 +1 @@
Subproject commit 3052db4bd3439e236479dc0f98069f7d3b559486

5
src/_site.json Normal file
View file

@ -0,0 +1,5 @@
{
"info": {
"title": "samtherapy.net"
}
}

View file

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 16 KiB

20
src/index.md Normal file
View file

@ -0,0 +1,20 @@
---
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) ;)

4
src/robots.txt.njk Normal file
View file

@ -0,0 +1,4 @@
Sitemap: {{ 'sitemap.xml' | url(true) }}
User-agent: *
Disallow:

1
src/styles/style.scss Normal file
View file

@ -0,0 +1 @@
@use "styles/base";

View file

@ -1,85 +0,0 @@
a {
color: rgba(200, 200, 200, 0.8);
}
a:hover {
color: rgba(200, 200, 200, 1);
}
#frens a {
color: rgba(250, 250, 250, 0.4);
}
#frens a:hover {
color: rgba(200, 200, 200, 0.6);
}
.top, .bottom {
display: grid;
grid-template-rows: 1fr;
grid-column-gap: 0;
grid-row-gap: 5%;
grid-auto-rows: minmax(100px, auto);
}
.top {
grid-template-rows: 0fr;
}
.bottom {
align-items: center;
position: relative;
}
.top .left {
grid-row: 1 / 2;
grid-column: 1 / 2;
}
.top .right {
grid-row: 1 / 2;
grid-column: 2 / 2;
white-space: nowrap;
}
bottom .right {
position: absolute;
}
#header {
text-align: center;
}
#hosting,
#comms {
border-collapse: collapse;
width: 100%;
table-layout: fixed;
justify-content: right;
align-items: right;
text-align: center;
font-size: larger;
}
#frens {
text-justify: auto;
}
body {
background-color: #000000;
color: rgba(255, 255, 255, 1);
max-width: 80%;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
text-align: center;
position: absolute;
top: 50%;
left: 50%;
margin-right: -50%;
transform: translate(-50%, -50%);
margin: auto;
}