From 9fc52042ca5a7fc7cb38f41f7ccb7a11eece4253 Mon Sep 17 00:00:00 2001 From: Jeff Date: Fri, 19 May 2023 09:32:14 -0400 Subject: [PATCH] Initial commit --- .gitignore | 1 + www/Caddyfile | 17 +++++++++++++++++ www/Containerfile | 13 +++++++++++++ www/build.fish | 13 +++++++++++++ www/server.bu | 15 +++++++++++++++ www/src/cookbook.md | 36 ++++++++++++++++++++++++++++++++++++ www/src/index.md | 8 ++++++++ www/src/nav.md | 5 +++++ www/templates/nav.html | 1 + www/templates/page.html | 21 +++++++++++++++++++++ 10 files changed, 130 insertions(+) create mode 100644 .gitignore create mode 100644 www/Caddyfile create mode 100644 www/Containerfile create mode 100644 www/build.fish create mode 100644 www/server.bu create mode 100644 www/src/cookbook.md create mode 100644 www/src/index.md create mode 100644 www/src/nav.md create mode 100644 www/templates/nav.html create mode 100644 www/templates/page.html diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..89f9ac0 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +out/ diff --git a/www/Caddyfile b/www/Caddyfile new file mode 100644 index 0000000..23cb8dd --- /dev/null +++ b/www/Caddyfile @@ -0,0 +1,17 @@ +localhost:8080, +jeffa.io { + redir https://www.{host}{uri} +} + +www.localhost:8080, +www.jeffa.io { + root * /srv/ + file_server { + index index.html + } + rewrite @not_html {path}.html + @not_html { + not path *.html + } +} + diff --git a/www/Containerfile b/www/Containerfile new file mode 100644 index 0000000..7048c34 --- /dev/null +++ b/www/Containerfile @@ -0,0 +1,13 @@ +FROM alpine as build + +RUN apk update && apk add pandoc + +WORKDIR /jeffa.io/ + +COPY . . + +FROM caddy:2-alpine + +COPY Caddyfile /etc/caddy/Caddyfile + +COPY --from=build /jeffa.io/out /srv diff --git a/www/build.fish b/www/build.fish new file mode 100644 index 0000000..cf16342 --- /dev/null +++ b/www/build.fish @@ -0,0 +1,13 @@ +for file in src/**/*.md + set -l output (string replace .md .html $file) + set -l output (string replace src/ out/ $output) + pandoc \ + --to html \ + --css basic.css \ + --self-contained \ + $file \ + > $output +end + +podman build -t www.jeffa.io . +podman run -p 8080:8080 www.jeffa.io:latest diff --git a/www/server.bu b/www/server.bu new file mode 100644 index 0000000..95535be --- /dev/null +++ b/www/server.bu @@ -0,0 +1,15 @@ +variant: fcos +version: 1.5.0 +systemd: + units: + - name: www_jeffa_io.service + enabled: true + contents: | + [Unit] + Description=caddy run + [Service] + Type=oneshot + RemainAfterExit=yes + ExecStart=podman-compose up + [Install] + WantedBy=multi-user.target diff --git a/www/src/cookbook.md b/www/src/cookbook.md new file mode 100644 index 0000000..9e1cfc2 --- /dev/null +++ b/www/src/cookbook.md @@ -0,0 +1,36 @@ +# Personal Cookbook + +## Convert file formats + +### Markdown to HTML + +Convert a file + +```sh +pandoc --to html --standalone file.md > file.html +``` + +Add local CSS + +```sh +pandoc --to html --css file.css --self-contained file.md > file.html +``` + +## Kitty + +### Desktop launchers + +The default group uses the main kitty.conf settings. Having the socket set prevents other windows +from using these settings by default. + +```.desktop +[Desktop Entry] +Version=1.0 +Type=Application +Name=kitty +GenericName=Terminal emulator +Comment=Fast, feature-rich, GPU based terminal +Exec=kitty --instance-group default --listen-on unix:@kitty +Icon=kitty +Categories=System;TerminalEmulator; +``` diff --git a/www/src/index.md b/www/src/index.md new file mode 100644 index 0000000..e50c07e --- /dev/null +++ b/www/src/index.md @@ -0,0 +1,8 @@ +# jeffa.io + +jeff@jeffa.io + + +- [/](/index) +- [/cookbook](/cookbook) + diff --git a/www/src/nav.md b/www/src/nav.md new file mode 100644 index 0000000..9e63b36 --- /dev/null +++ b/www/src/nav.md @@ -0,0 +1,5 @@ + +- [jeffa.io](/index) + - Articles + - [How To Code]() + - [/cookbook](/cookbook) \ No newline at end of file diff --git a/www/templates/nav.html b/www/templates/nav.html new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/www/templates/nav.html @@ -0,0 +1 @@ + diff --git a/www/templates/page.html b/www/templates/page.html new file mode 100644 index 0000000..d02b622 --- /dev/null +++ b/www/templates/page.html @@ -0,0 +1,21 @@ + + + + + + + $if(title)$ + $title$ + $endif$ + $if(author)$ + + $endif$ + $if(date)$ + + $endif$ + $styles()$ + + +$body$ + +