diff --git a/.gitignore b/.gitignore index e40aca2..5b31419 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,9 @@ resources public -assets/css/syntax.css -layouts/partials/openring.out.html + +# generated by hugo gen +assets/css/syntax.light.css +assets/css/syntax.dark.css + +# generated by openring +layouts/partials/footer.html diff --git a/.gitmodules b/.gitmodules index cf739aa..45becd8 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,3 @@ -[submodule "themes/solar-theme-hugo"] - path = themes/solar-theme-hugo - url = https://github.com/bake/solar-theme-hugo/ +[submodule "themes/lines"] + path = themes/lines + url = https://github.com/adamveld12/lines diff --git a/.hugo_build.lock b/.hugo_build.lock new file mode 100644 index 0000000..e69de29 diff --git a/.tool-versions b/.tool-versions new file mode 100644 index 0000000..a9dd02a --- /dev/null +++ b/.tool-versions @@ -0,0 +1,2 @@ +hugo extended_0.110.0 +golang 1.19 diff --git a/Dockerfile.dev b/Dockerfile.dev deleted file mode 100644 index c6e190b..0000000 --- a/Dockerfile.dev +++ /dev/null @@ -1,29 +0,0 @@ -FROM debian:bullseye-slim - - -ARG VERSION=0.59.1 - -WORKDIR /tmp -RUN apt-get update \ - && apt-get install -y tar curl ca-certificates python3 python3-pip \ - && apt-get clean \ - && pip3 install Pygments \ - && curl https://github.com/gohugoio/hugo/releases/download/v${VERSION}/hugo_extended_${VERSION}_Linux-64bit.tar.gz -L | tar -xvz \ - && mv /tmp/hugo /usr/local/bin/hugo \ - && rm -rf /tmp/* - -RUN useradd -m -u 1000 -U -p '' -s /bin/bash hugo \ - && mkdir -p /opt/workdir \ - && chown -R 1000:1000 /home/hugo /opt/workdir /usr/local/bin/hugo - -USER 1000 - -WORKDIR /opt/workdir - -VOLUME /opt/workdir - -EXPOSE 1313 - -ENTRYPOINT /usr/local/bin/hugo - -CMD ["--help"] diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..eceaa96 --- /dev/null +++ b/Makefile @@ -0,0 +1,74 @@ +VERSION := $(shell git rev-parse --abbrev-ref HEAD) +GOBIN = $(shell go env GOPATH)/bin + + +.PHONY: serve +serve: assets + hugo server -D --log -w --bind 0.0.0.0 + +.PHONY: new-post +new-post: + @hugo new posts/$(TITLE).md + +.PHONY: build +build: + docker build -t vdhsn/blog:${VERSION} -f Dockerfile . + +.PHONY: publish-master +publish-master: publish + @echo 'master build detected' + docker tag vdhsn/blog:${VERSION} vdhsn/blog:latest + docker push vdhsn/blog:latest + +.PHONY: clean build +publish: clean build + docker push vdhsn/blog:${VERSION} + +.PHONY: test-publish +test-publish: build + docker run -it -p 8080:80 vdhsn/blog:${VERSION} + +.PHONY: docker-build-dev +docker-build-dev: + @docker build --build-arg='VERSION=0.62.0' -t hugo -f Dockerfile.dev . + +.PHONY: deploy +deploy: + kubectl rollout restart deployment blog + +.PHONY: clean +clean: + @rm -rf ./public ./resources ./assets/css/syntax.* ./layouts/partials/single/footer.html + +assets: ./assets/css/syntax.light.css ./assets/css/syntax.dark.css ./layouts/partials/single/footer.html + +HUGO_BIN = $(GOBIN)/hugo +$(HUGO_BIN): + @go install --tags extended github.com/gohugoio/hugo@latest + +OPENRING_BIN = $(GOBIN)/openring +$(OPENRING_BIN): + @go install -v git.sr.ht/~sircmpwn/openring@latest + +./assets/css: + mkdir -p ./assets/css + +./assets/css/syntax.light.css: + hugo gen chromastyles --style=github > assets/css/syntax.light.css + +./assets/css/syntax.dark.css: + hugo gen chromastyles --style=github-dark > assets/css/syntax.dark.css + +./layouts/partials/single/footer.html: $(OPENRING_BIN) + mkdir -p ./layouts/partials/single + $(OPENRING_BIN) \ + -s https://drewdevault.com/feed.xml \ + -s https://dave.cheney.net/feed/atom \ + -s https://blog.benjojo.co.uk/rss.xml \ + -s https://tech.davis-hansson.com/index.xml \ + < ./assets/openring.in.html \ + > ./layouts/partials/single/footer.html + +public: ./assets/css/syntax.light.css ./assets/css/syntax.dark.css ./layouts/partials/openring.out.html + hugo --minify --gc + diff --git a/archetypes/default.md b/archetypes/posts/default.md similarity index 97% rename from archetypes/default.md rename to archetypes/posts/default.md index ecee6bd..0b0486e 100644 --- a/archetypes/default.md +++ b/archetypes/posts/default.md @@ -1,6 +1,6 @@ --- title: "{{ replace .Name "-" " " | title }}" -date: {{ .Date }} +date: {{ dateFormat "2006-01-02" .Date }} draft: true tags: [] --- diff --git a/assets/css/layout.scss b/assets/css/layout.scss deleted file mode 100644 index 6493709..0000000 --- a/assets/css/layout.scss +++ /dev/null @@ -1,76 +0,0 @@ -@import "nav"; -@import "list"; -@import "syntax"; -@import "syntax_edit"; - -html, -body { - font-family: Verdana, Sans-Serif; - font-size: 12pt; - line-height: 1.7; -} - -h1, -h2, -h3 { - font-size: 12pt; - margin: 0 0 10px 0; -} - -p { - margin: 0 0 10px 0; - word-break: keep-all; -} - -.container { - max-width: 1280px; - margin: 0 auto; - display: flex; - flex-direction: column; - - #header { - margin-bottom: 20px; - } - - #center { - display: flex; - flex-direction: row-reverse; - width: 100%; - - #content { - flex-grow: 2; - max-width: 1010px; - } - - #sidebar { - padding-top: 20px; - padding-left: 20px; - flex-grow: 1; - min-width: 230px; - } - } - - #footer { - font-size: 0.8rem; - } -} - -@media (max-width: 1280px) { - .container { - #center { - flex-direction: column-reverse; - #content { - max-width: 100%; - } - } - } -} - -.highlight { - line-height: 1.5em; - margin: 15px 0; -} - -#openring { - margin: 35px 0; -} diff --git a/assets/css/list.scss b/assets/css/list.scss deleted file mode 100644 index d8466c3..0000000 --- a/assets/css/list.scss +++ /dev/null @@ -1,36 +0,0 @@ -.post { - #tags { - display: flex; - list-style-type: none; - padding: 0; - margin: 0 0 10px 0; - - li { - margin-right: 5px; - //background-color: black; - padding: 0 5px; - border-radius: 5px; - - a { - text-decoration: none; - &:hover { - text-decoration: underline; - text-decoration-color: #cb4b16; - } - } - } - } - - p code { - background-color: #1c1c1c; - color: #f73b3b; - } - - .postdate { - font-size: 10pt; - } - - .title { - font-size: 16pt; - } -} diff --git a/assets/css/nav.scss b/assets/css/nav.scss deleted file mode 100644 index 98c50d5..0000000 --- a/assets/css/nav.scss +++ /dev/null @@ -1,18 +0,0 @@ -nav { - ul { - list-style-type: none; - padding: 0; - - li { - margin-bottom: 10px; - } - } - - .title { - font-size: 0.9rem; - } -} - -#license { - font-size: 1rem; -} diff --git a/assets/css/syntax_edit.css b/assets/css/syntax_edit.css deleted file mode 100644 index f32b073..0000000 --- a/assets/css/syntax_edit.css +++ /dev/null @@ -1,5 +0,0 @@ -/* LineHighlight */ .chroma .hl { background-color: white; color: black } -/* Comment */ .chroma .c { color: white } -/* CommentHashbang */ .chroma .ch { color: white } -/* CommentMultiline */ .chroma .cm { color: white } -/* CommentSingle */ .chroma .c1 { color: white } \ No newline at end of file diff --git a/assets/openring.in.html b/assets/openring.in.html index c8d8f39..fd4ad3b 100644 --- a/assets/openring.in.html +++ b/assets/openring.in.html @@ -1,5 +1,5 @@
-

Articles from blogs I follow around the net

+

Articles from blogs I follow

{{range .Articles}}
@@ -34,7 +34,6 @@ flex-direction: column; margin: 0.5rem; padding: 0.5rem; - background: #002a35; min-width: 10rem; } .webring .summary { @@ -44,6 +43,5 @@ .webring .attribution { text-align: right; font-size: 0.8rem; - color: #eee; } diff --git a/config.toml b/config.toml index 1d8089d..d9a3dc6 100644 --- a/config.toml +++ b/config.toml @@ -1,52 +1,44 @@ baseURL = "https://vdhsn.com" -languageCode = "en-us" -title = "Adam's Blog" -theme = "solar-theme-hugo" -pygmentsStyle = "solarized-dark256" # solarized-light, -dark or -dark256 +title = "VDHSN" +theme = "lines" summaryLength = 32 enableRobotsTXT = true enableEmoji = true +ignoreErrors = ["error-missing-instagram-accesstoken"] [params] author = "Adam Veldhousen" + email = "adam@vdhsn.com" description = "I write software for a living and sometimes for fun. Copyright 2019 Adam Veldhousen" - scheme = "https" + theme = "light" [menu] [[menu.main]] - title ="Email" - name = "adam@vdhsn.com" - url = "mailto:adam@vdhsn.com" - weight = -100 + name = "VDHSN" + title = "VDHSN" + url = "/" + weight = -10 [[menu.main]] - title = "PGP" - name = "A466CEE1415C0B9C" - url = "/gpg.pub" - weight = 0 + name = "About" + url = "/about" + weight = -5 [[menu.main]] - Title = "Code for this site" - name = "git.vdhsn.com/adam/blog" + name = "Source" url = "https://git.vdhsn.com/adam/blog" - [[menu.other]] - Title = "Find me on GitHub" - name = "github.com/adamveld12" - url = "https://github.com/adamveld12" - - [[menu.other]] - Title = "Follow me on Keybase" - name = "keybase.io/aveldhousen" - url = "https://keybase.io/aveldhousen" - [[menu.other]] name = "RSS" url = "/index.xml" - [[menu.other]] - name = "Resume" - url = "/resume_2019.pdf" + + +disableKinds = ['taxonomy', 'term'] + +[taxonomies] + tag = 'tags' + [markup] [markup.highlight] @@ -54,7 +46,7 @@ enableEmoji = true guessSyntax = false lineNoStart = 1 lineNos = true - lineNumbersInTable = true + lineNumbersInTable = false noClasses = false - style = "monokai" + # style = "monokai" tabWidth = 4 \ No newline at end of file diff --git a/content/about.md b/content/about.md new file mode 100644 index 0000000..f5b7ac2 --- /dev/null +++ b/content/about.md @@ -0,0 +1,20 @@ +--- +title: About +hideFooter: true +--- + +Hi :wave: I'm Adam Veldhousen. This is my corner of the web where I (inconsistently) write +about technology and other passions of mine. + +- PGP [A466CEE1415C0B9C](/gpg.pub) +- [github.com/adamveld12](https://github.com/adamveld12) +- [keybase.io/aveldhousen](https://keybase.io/aveldhousen) +- [linkedin.com/in/aveldhousen](https://www.linkedin.com/in/aveldhousen) +- [Resume](/resume_2019.pdf) +- [Email me](mailto:blog@vdhsn.com) + + + + + +Content on this site is [CC-BY-SA](https://creativecommons.org/licenses/by/3.0/) diff --git a/content/posts/git-tips-lint-test-precommit-hook.md b/content/posts/git-tips-lint-test-precommit-hook.md index 6744931..a130414 100755 --- a/content/posts/git-tips-lint-test-precommit-hook.md +++ b/content/posts/git-tips-lint-test-precommit-hook.md @@ -4,10 +4,10 @@ date: 2020-01-01T21:00:39Z tags: [git, bash] --- -One of my favorite inventions is a `pre-commit` hook that auto runs test and lint commands from a `makefile` or +A nice last minute sanity check I use is a `pre-commit` hook that auto runs test and lint commands from a `makefile` or `package.json` if they're found: -```bash {linenos=table} +```bash #!/usr/bin/env bash if [ -f "$PWD/makefile" ] && [ ! -z "$(cat $PWD/makefile | grep '^lint:')" ]; then @@ -27,9 +27,6 @@ elif [ -f "$PWD/package.json" ] && [ ! -z "$(cat $PWD/package.json | grep "^\"te fi ``` -The `/usr/bin/env bash` piece ensures that the script has access to all of the environment variables you expect in your -regular shell. - If the test or lint command fails then the `git commit` command fails. If I absolutely need to commit something in spite of the lint/test results I can do `git commit --no-verify` to skip the `pre-commit` hook. diff --git a/content/posts/secrets-in-makefiles.md b/content/posts/secrets-in-makefiles.md index d090aaf..a3db54b 100755 --- a/content/posts/secrets-in-makefiles.md +++ b/content/posts/secrets-in-makefiles.md @@ -11,13 +11,13 @@ with my *Make* based build setup. I found that a nice way to do this is with the The `include` command allows you to include external files to augment your makefile. First I created a `secrets.mk` and declared variables in it for my API keys. -```makefile {linenos=table} +```makefile # secrets.mk github_access_token := 'xxxxxxxxxxxxxxxxx' slack_access_token := 'xxxxxxxxxxxxxxxxx' ``` -Then in my makefile I added `include secrets.mk`. Don't forget to add `secrets.mk` to your `.gitignore`! +Then in makefile I added `include secrets.mk`. Don't forget to add `secrets.mk` to your `.gitignore`! ```makefile include secrets.mk diff --git a/hugo b/hugo deleted file mode 100755 index e8d55bc..0000000 --- a/hugo +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash -if [ -z "$(docker ps | grep hugo)" ]; then - exec docker run -it --rm --name hugo \ - -p 1313:1313 \ - -v $PWD:/opt/workdir \ - -u 0 \ - --entrypoint=/usr/local/bin/hugo hugo $@ -else - exec docker exec -it hugo hugo $@ -fi \ No newline at end of file diff --git a/layouts/_default/_markup/render-codeblock-mermaid.html b/layouts/_default/_markup/render-codeblock-mermaid.html new file mode 100644 index 0000000..c8d3612 --- /dev/null +++ b/layouts/_default/_markup/render-codeblock-mermaid.html @@ -0,0 +1,5 @@ +
+ {{- .Inner | safeHTML }} +
+{{ .Page.Store.Set "hasMermaid" true }} + diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html deleted file mode 100644 index 201d2a2..0000000 --- a/layouts/_default/baseof.html +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - {{ with .OutputFormats.Get "RSS" }} - - - {{ end }} - - {{ .Title }} - - {{ partial "head.html" . }} - - -
- - -
- - -
- {{ block "main" . }}{{ end }} -
-
- -
- {{ partial "foot.html" . }} -
-
- - diff --git a/layouts/_default/list.html b/layouts/_default/list.html deleted file mode 100644 index 39f8836..0000000 --- a/layouts/_default/list.html +++ /dev/null @@ -1,20 +0,0 @@ -{{ define "main" }} -
- {{ range .Paginator.Pages }} -
-

- - {{ .Title }} - {{ if .Draft }}(Draft){{ end }} -

- -
- {{ partial "tags.html" . }} - -
- - -
- {{ end }} -
-{{ end }} diff --git a/layouts/_default/single.html b/layouts/_default/single.html deleted file mode 100644 index eca08b3..0000000 --- a/layouts/_default/single.html +++ /dev/null @@ -1,16 +0,0 @@ -{{ define "main" }} -
-

{{ .Title }} {{ if .Draft }}(Draft){{ end }}

-

-
- {{ partial "tags.html" . }} -

- -
{{ .Content | safeHTML }}
- -
- -
- {{ partial "openring.out.html" . }} -
-{{ end }} diff --git a/layouts/partials/base/footer.html b/layouts/partials/base/footer.html new file mode 100644 index 0000000..f174954 --- /dev/null +++ b/layouts/partials/base/footer.html @@ -0,0 +1,21 @@ +{{ $author := or (.Site.Params.Author) (.Site.Author.name) }} +
+
+ +
+ +{{ if .Page.Store.Get "hasMermaid" }} + + +{{ end }} + diff --git a/layouts/partials/foot.html b/layouts/partials/foot.html deleted file mode 100644 index 4daaf26..0000000 --- a/layouts/partials/foot.html +++ /dev/null @@ -1,7 +0,0 @@ - \ No newline at end of file diff --git a/layouts/partials/head.html b/layouts/partials/head.html index 1c4e60b..21a8e3d 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -1,22 +1,7 @@ - +{{ $style := resources.Get (printf "css/syntax.%s.css" (.Site.Params.theme | default "light")) | toCSS | minify | fingerprint }} - + + - + - - - - - - - - - - diff --git a/layouts/partials/navigation.html b/layouts/partials/navigation.html deleted file mode 100644 index 5af9a21..0000000 --- a/layouts/partials/navigation.html +++ /dev/null @@ -1,24 +0,0 @@ - diff --git a/layouts/partials/single/footer.html b/layouts/partials/single/footer.html new file mode 100644 index 0000000..0c51ab3 --- /dev/null +++ b/layouts/partials/single/footer.html @@ -0,0 +1,79 @@ +
+

Articles from blogs I follow

+
+ +
+

+ My plans at FOSDEM: SourceHut, Hare, and Helios +

+

FOSDEM is right around the corner, and finally in person after long years of +dealing with COVID. I’ll be there again this year, and I’m looking forward to +it! I have four slots on the schedule (wow! Thanks for arranging these, FOSDEM +team) and I’ll be talkin…

+ + via Drew DeVault's blog + + January 24, 2023 +
+ +
+

+ YSK: Google allows spoofing news headlines in search results +

+

A minor scandal unfolding in the Swedish election highlights a way to influence news narratives: +Google allows you to set headlines for news articles in search results by paying for adwords placements of legitimate articles. +This is being used by political …

+ + via Jacob Davis-Hansson + + September 9, 2022 +
+ +
+

+ Going multipath without Multipath TCP +

+

Going multipath without Multipath TCP + + + +Gigabit ethernet has been around for a long time, it’s so ubiquitous that there is a very strong chance that if you have a RJ-45 port on your compu +

+ + via benjojo blog + + February 24, 2022 +
+ +
+

+ Generated by + openring +

+
+ diff --git a/layouts/partials/tags.html b/layouts/partials/tags.html deleted file mode 100644 index dfc8436..0000000 --- a/layouts/partials/tags.html +++ /dev/null @@ -1,9 +0,0 @@ -{{ $taxo := "tags" }} -
    - {{ range .Param $taxo }} - {{ $name := . }} - {{ with $.Site.GetPage (printf "/%s/%s" $taxo ($name | urlize)) }} -
  • #{{ $name }}
  • - {{ end }} - {{ end }} -
\ No newline at end of file diff --git a/layouts/robots.txt b/layouts/robots.txt deleted file mode 100644 index 54fb989..0000000 --- a/layouts/robots.txt +++ /dev/null @@ -1,2 +0,0 @@ -User-agent: * - diff --git a/makefile b/makefile deleted file mode 100644 index 6fc681b..0000000 --- a/makefile +++ /dev/null @@ -1,58 +0,0 @@ -VERSION := $(shell git rev-parse --abbrev-ref HEAD) -GOBIN = $(GOPATH)/bin -HUGO_BIN = $(GOBIN)/hugo -OPENRING_BIN = $(GOBIN)/openring - -serve: assets - ./hugo server -D --log -w --bind 0.0.0.0 - -new-post: - @./hugo new posts/$(TITLE).md - -build: - docker build -t vdhsn/blog:${VERSION} -f Dockerfile . - -publish-master: publish - @echo 'master build detected' - docker tag vdhsn/blog:${VERSION} vdhsn/blog:latest - docker push vdhsn/blog:latest -publish: clean build - docker push vdhsn/blog:${VERSION} - -test-publish: build - docker run -it -p 8080:80 vdhsn/blog:${VERSION} - -docker-build-dev: - @docker build --build-arg='VERSION=0.62.0' -t hugo -f Dockerfile.dev . - -deploy: - kubectl rollout restart deployment blog - -assets: ./assets/css/syntax.css ./layouts/partials/openring.out.html - -clean: - @rm -rf ./public ./resources ./assets/css/syntax.css ./layouts/partials/openring.out.html - -.PHONY: serve new-post build publish test-publish docker-build-dev assets clean deploy - -$(HUGO_BIN): - @CGO_ENABLED=1 go get -u -v --tags extended github.com/gohugoio/hugo - -$(OPENRING_BIN): - @go get -u -v git.sr.ht/~sircmpwn/openring - -./assets/css/syntax.css: - hugo gen chromastyles --style=solarized-dark256 > assets/css/syntax.css - -./layouts/partials/openring.out.html: $(OPENRING_BIN) - $(OPENRING_BIN) \ - -s https://drewdevault.com/feed.xml \ - -s https://dave.cheney.net/feed/atom \ - -s https://blog.benjojo.co.uk/rss.xml \ - -s https://tech.davis-hansson.com/index.xml \ - < ./assets/openring.in.html \ - > ./layouts/partials/openring.out.html - -public: ./assets/css/syntax.css ./layouts/partials/openring.out.html - hugo --minify --gc - diff --git a/nomad.job b/nomad.job deleted file mode 100644 index 5919ea8..0000000 --- a/nomad.job +++ /dev/null @@ -1,42 +0,0 @@ -job "frontends" { - datacenters = ["homelab"] - - group "blog" { - count = 2 - network { - port "blog-http" { to = "80" } - } - - service { - port = "blog-http" - tags = [ - "traefik.http.middlewares.blog.redirectscheme.scheme=https", - "traefik.http.middlewares.blog.redirectscheme.permanent=true", - "traefik.http.routers.blog.entryPoints=websecure", - "traefik.http.routers.blog.rule=Host(`vdhsn.com`, `blog.vdhsn.com`)", - "traefik.http.routers.blog.tls.certresolver=default", - "traefik.http.routers.blog.tls=true" - ] - - meta { - meta = "My Blog" - } - } - - - task "blog-vdhsn" { - driver = "docker" - - resources { - cpu = 128 - memory = 64 - } - - config { - image = "vdhsn/blog:master" - ports = ["blog-http"] - } - - } - } -} diff --git a/static/party-tp.gif b/static/favicon.gif similarity index 100% rename from static/party-tp.gif rename to static/favicon.gif diff --git a/themes/lines b/themes/lines new file mode 160000 index 0000000..2d63ad0 --- /dev/null +++ b/themes/lines @@ -0,0 +1 @@ +Subproject commit 2d63ad0141c758b6331efe4aeb48d3ebbeae0b37 diff --git a/themes/solar-theme-hugo b/themes/solar-theme-hugo deleted file mode 160000 index 0b8bd8f..0000000 --- a/themes/solar-theme-hugo +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 0b8bd8f65caca1128654060d28b1808e7a4d984b