new theme
ci.vdhsn.com/push Build is passing Details
ci.vdhsn.com/promote/production Build is passing Details

master
Adam Veldhousen 2 years ago
parent 39f77a9099
commit 99e5b8cc8c
Signed by: adam
GPG Key ID: 6DB29003C6DD1E4B

@ -0,0 +1,10 @@
public
resources
themes
# generated by hugo gen
assets/css/syntax.light.css
assets/css/syntax.dark.css
# generated by openring
layouts/partials/footer.html

@ -0,0 +1,40 @@
kind: pipeline
type: kubernetes
name: Build and Publish
trigger:
event:
- push
steps:
- name: Build & Publish
image: plugins/kaniko
settings:
username:
from_secret: DOCKER_USERNAME
password:
from_secret: DOCKER_PASSWORD
repo: vdhsn/blog
tags:
- ${DRONE_COMMIT_SHA}
- ${DRONE_BRANCH}
---
kind: pipeline
type: kubernetes
name: Deploy
trigger:
event:
- promote
steps:
- name: Publish Latest
image: plugins/kaniko
settings:
username:
from_secret: DOCKER_USERNAME
password:
from_secret: DOCKER_PASSWORD
repo: vdhsn/blog
tags:
- latest

11
.gitignore vendored

@ -1,4 +1,9 @@
resources
public
assets/css/syntax.css
layouts/partials/openring.out.html
resources
# generated by hugo gen
assets/css/syntax.light.css
assets/css/syntax.dark.css
# generated by openring
layouts/partials/single/footer.html

6
.gitmodules vendored

@ -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

@ -0,0 +1,2 @@
hugo extended_0.110.0
golang 1.19

@ -1,2 +1,11 @@
FROM nginx
COPY ./public /usr/share/nginx/html
FROM docker.io/golang:alpine as build
COPY . /go/src/blog
WORKDIR /go/src/blog
RUN apk add hugo make git --no-cache \
&& go install git.sr.ht/~sircmpwn/openring@latest \
&& make public
FROM docker.io/nginx
COPY --from=build /go/src/blog/public /usr/share/nginx/html

@ -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"]

@ -0,0 +1,56 @@
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: 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: clean
clean:
@rm -rf ./public ./resources ./themes ./assets/css/syntax.* ./layouts/partials/single/footer.html
OPENRING_BIN = $(GOBIN)/openring
$(OPENRING_BIN):
go install git.sr.ht/~sircmpwn/openring@latest
public: ./themes/lines/config.toml ./assets/css/syntax.light.css ./assets/css/syntax.dark.css ./layouts/partials/single/footer.html
hugo --verbose --gc --minify --templateMetrics --templateMetricsHints --enableGitInfo --environment production
./themes/lines/config.toml:
@git submodule update --init
./assets/css:
@mkdir -p ./assets/css
./assets/css/syntax.light.css: $(HUGO_BIN) ./assets/css
@hugo gen chromastyles --style=github > assets/css/syntax.light.css
./assets/css/syntax.dark.css: $(HUGO_BIN) ./assets/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://dave.cheney.net/feed/atom \
-s https://tech.davis-hansson.com/index.xml \
-s https://blog.benjojo.co.uk/rss.xml \
-s https://drewdevault.com/feed.xml \
< ./assets/openring.in.html \
> ./layouts/partials/single/footer.html

@ -1,6 +1,6 @@
---
title: "{{ replace .Name "-" " " | title }}"
date: {{ .Date }}
date: {{ dateFormat "2006-01-02" .Date }}
draft: true
tags: []
---

@ -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;
}

@ -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;
}
}

@ -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;
}

@ -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 }

@ -1,5 +1,5 @@
<section class="webring">
<h3>Articles from blogs I follow around the net</h3>
<h3>Articles from blogs I follow</h3>
<section class="articles">
{{range .Articles}}
<div class="article">
@ -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;
}
</style>

@ -1,51 +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"
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]
@ -53,7 +46,7 @@ enableEmoji = true
guessSyntax = false
lineNoStart = 1
lineNos = true
lineNumbersInTable = true
lineNumbersInTable = false
noClasses = false
style = "monokai"
# style = "monokai"
tabWidth = 4

@ -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/)

@ -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.

@ -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

10
hugo

@ -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

@ -0,0 +1,5 @@
<div class="mermaid">
{{- .Inner | safeHTML }}
</div>
{{ .Page.Store.Set "hasMermaid" true }}

@ -1,42 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<meta name="description" content="{{if .IsHome}}{{ $.Site.Params.description }}{{else}}{{.Description}}{{end}}" />
{{ with .OutputFormats.Get "RSS" }}
<link href="{{ .RelPermalink }}" rel="alternate" type="application/rss+xml" title="{{ $.Site.Title }}" />
<link href="{{ .RelPermalink }}" rel="feed" type="application/rss+xml" title="{{ $.Site.Title }}" />
{{ end }}
<title>{{ .Title }}</title>
{{ $style := resources.Get (printf "css/colors-%s.scss" (.Site.Params.scheme | default "dark")) | toCSS | minify | fingerprint }}
<link rel="preload" href="{{ $style.Permalink }}" as="style">
<link rel="stylesheet" href="{{ $style.Permalink }}">
{{ partial "head.html" . }}
</head>
<body>
<div class="container">
<header id="header">
<a href="{{ .Site.BaseURL }}">{{ .Site.Title }}</a>
</header>
<div id="center">
<div id="sidebar">
{{ partial "navigation.html" . }}
</div>
<div id="content">
{{ block "main" . }}{{ end }}
</div>
</div>
<footer id="footer">
{{ partial "foot.html" . }}
</footer>
</div>
</body>
</html>

@ -1,21 +0,0 @@
{{ define "main" }}
<section>
{{ range .Paginator.Pages }}
<article class="post">
<h2>
<span class="postdate">{{ .Date.Format "2006-01-02" }}</span>
<a class="title" href="{{ .Permalink }}">{{ .Title }}</a>
{{ if .Draft }}<span>(Draft)</span>{{ end }}
</h2>
<div class="post-content">
{{ partial "tags.html" . }}
<!-- <p>{{ .Summary | plainify | safeHTML }} {{ if .Truncated }} … {{ end }}</p> -->
</div>
<!-- <p class="meta">Posted on <span class="postdate">{{ .Date.Format "02. January 2006" }}</span></p> -->
</article>
{{ end }}
</section>
{{ partial "pagination.html" . }}
{{ end }}

@ -1,16 +0,0 @@
{{ define "main" }}
<article class="post">
<h1 class="title"><a href="{{ .Permalink }}">{{ .Title }}</a> {{ if .Draft }}(Draft){{ end }}</h1>
<p class="meta">
<span class="postdate">Posted {{ .Date.Format "January 02 2006" }}</span><br/>
{{ partial "tags.html" . }}
</p>
<div class="post-content">{{ .Content | safeHTML }}</div>
</article>
<div id="openring">
{{ partial "openring.out.html" . }}
</div>
{{ end }}

@ -0,0 +1,21 @@
{{ $author := or (.Site.Params.Author) (.Site.Author.name) }}
<hr>
<footer>
<nav>
<ul>
<li>
© {{ dateFormat "2006" now }} {{ $author }}
</li>
<li>
</li>
</ul>
</nav>
</footer>
{{ if .Page.Store.Get "hasMermaid" }}
<script src="https://cdn.jsdelivr.net/npm/mermaid/dist/mermaid.min.js"></script>
<script>
mermaid.initialize({ startOnLoad: true });
</script>
{{ end }}

@ -1,7 +0,0 @@
<div id="partial-footer">
<p class="copyright">
&copy; 2019 - {{ now.Format "2006"}} Adam Veldhousen.
<a href="https://creativecommons.org/licenses/by/3.0/" title="Creative Commons Attribution">Some rights reserved</a>.
Powered by <a href="https://vdhsn.com">Hugo</a>.
</p>
</div>

@ -1,22 +1,7 @@
<base href="{{ .Site.BaseURL }}">
{{ $style := resources.Get (printf "css/syntax.%s.css" (.Site.Params.theme | default "light")) | toCSS | minify | fingerprint }}
<link rel="canonical" href="{{ .Permalink }}">
<link rel="preload" href="{{ $style.Permalink }}" as="style">
<link rel="stylesheet" href="{{ $style.Permalink }}">
<link rel="icon" href="party-tp.gif" type="image/gif" >
<link rel="shortcut icon" type="image/gif" href="favicon.gif"/>
<!-- indie auth stuff -->
<link rel="authorization_endpoint" href="https://indieauth.com/auth">
<!-- open ID stuff -->
<link rel="openid2.provider" href="https://www.google.com/accounts/o8/ud">
<link rel="openid2.local_id" href="https://profiles.google.com/adamveld12">
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-155338921-1"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-155338921-1');
</script>

@ -1,24 +0,0 @@
<nav>
I write software for a living and sometimes for fun.
{{ range .Site.Menus }}
<ul class="nav">
{{ range . }}
<li>
{{ if ne .Title "" }}
<span class="title">{{ .Title }}</span><br/>
{{ end }}
<a {{ if or (strings.HasSuffix .Name "github") (strings.HasSuffix .Name "keybase") }} rel="me" {{ end }}href="{{ .URL }}">
<span>{{ .Name }}</span>
</a>
</li>
{{ end }}
</ul>
{{ end }}
<p id="license">
<span class="title">License</span><br/>
<p>
Content on this site is <a href="https://creativecommons.org/licenses/by/3.0/">CC-BY-SA</a>.<br/>
Code for this site is <a href="https://opensource.org/licenses/MIT">MIT</a>.
</p>
</p>
</nav>

@ -0,0 +1,79 @@
<section class="webring">
<h3>Articles from blogs I follow</h3>
<section class="articles">
<div class="article">
<h4 class="title">
<a href="https://drewdevault.com/2023/01/24/2023-01-24-FOSDEM.html" target="_blank" rel="noopener">My plans at FOSDEM: SourceHut, Hare, and Helios</a>
</h4>
<p class="summary">FOSDEM is right around the corner, and finally in person after long years of
dealing with COVID. Ill be there again this year, and Im looking forward to
it! I have four slots on the schedule (wow! Thanks for arranging these, FOSDEM
team) and Ill be talkin…</p>
<small class="source">
via <a href="https://drewdevault.com">Drew DeVault&#39;s blog</a>
</small>
<small class="date">January 24, 2023</small>
</div>
<div class="article">
<h4 class="title">
<a href="https://tech.davis-hansson.com/p/goog-news-headlines/" target="_blank" rel="noopener">YSK: Google allows spoofing news headlines in search results</a>
</h4>
<p class="summary">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 …</p>
<small class="source">
via <a href="https://tech.davis-hansson.com/">Jacob Davis-Hansson</a>
</small>
<small class="date">September 9, 2022</small>
</div>
<div class="article">
<h4 class="title">
<a href="https://blog.benjojo.co.uk/post/multipath-without-mptcp" target="_blank" rel="noopener">Going multipath without Multipath TCP </a>
</h4>
<p class="summary">Going multipath without Multipath TCP
Gigabit ethernet has been around for a long time, its so ubiquitous that there is a very strong chance that if you have a RJ-45 port on your compu
</p>
<small class="source">
via <a href="https://blog.benjojo.co.uk">benjojo blog</a>
</small>
<small class="date">February 24, 2022</small>
</div>
</section>
<p class="attribution">
Generated by
<a href="https://git.sr.ht/~sircmpwn/openring">openring</a>
</p>
</section>
<style>
.webring .articles {
display: flex;
flex-wrap: wrap;
margin: -0.5rem;
}
.webring .title {
margin: 0;
}
.webring .article {
flex: 1 1 0;
display: flex;
flex-direction: column;
margin: 0.5rem;
padding: 0.5rem;
min-width: 10rem;
}
.webring .summary {
font-size: 0.8rem;
flex: 1 1 0;
}
.webring .attribution {
text-align: right;
font-size: 0.8rem;
}
</style>

@ -1,9 +0,0 @@
{{ $taxo := "tags" }} <!-- Use the plural form here -->
<ul id="{{ $taxo }}" >
{{ range .Param $taxo }}
{{ $name := . }}
{{ with $.Site.GetPage (printf "/%s/%s" $taxo ($name | urlize)) }}
<li><a href="{{ .Permalink }}">#{{ $name }}</a></li>
{{ end }}
{{ end }}
</ul>

@ -1,2 +0,0 @@
User-agent: *

@ -1,54 +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: public
docker build -t vdhsn/blog:${VERSION} -f Dockerfile .
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):
@go get -u --tags extended -v github.com/gohugoio/hugo
$(OPENRING_BIN):
@go get -u 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

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 22 KiB

@ -0,0 +1 @@
Subproject commit a85d561cac091fcd73a248c3d3c426d39ac15155

@ -1 +0,0 @@
Subproject commit 0b8bd8f65caca1128654060d28b1808e7a4d984b
Loading…
Cancel
Save