Compare commits
No commits in common. "73fa28a1da42d4e20c4be759410ee1171b10d597" and "56c6b4ada9fb2dfd7587f84ff9808dea17f1288c" have entirely different histories.
73fa28a1da
...
56c6b4ada9
146
.drone.yml
146
.drone.yml
|
|
@ -1,40 +1,132 @@
|
|||
kind: pipeline
|
||||
type: kubernetes
|
||||
name: Build and Publish
|
||||
type: docker
|
||||
name: master build and deploy
|
||||
|
||||
volumes:
|
||||
- name: dockersock
|
||||
host:
|
||||
path: /var/run/docker.sock
|
||||
|
||||
environment:
|
||||
GOPATH: /go/
|
||||
HUGO_VERSION: 0.59.1
|
||||
DOCKER_PASSWORD:
|
||||
from_secret: DOCKER_TOKEN
|
||||
|
||||
trigger:
|
||||
event:
|
||||
- push
|
||||
|
||||
- cron
|
||||
branch:
|
||||
include:
|
||||
- master
|
||||
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}
|
||||
- name: docker build and publish - prod
|
||||
image: docker:dind
|
||||
environment:
|
||||
DOCKER_PASSWORD:
|
||||
from_secret: DOCKER_TOKEN
|
||||
volumes:
|
||||
- name: dockersock
|
||||
path: /var/run/docker.sock
|
||||
commands:
|
||||
- apk add make git
|
||||
- docker login -u adamveld12 -p ${DOCKER_PASSWORD}
|
||||
- make build publish-master
|
||||
|
||||
- name: deploy master
|
||||
image: adamveld12/nomad:v1.0.4
|
||||
environment:
|
||||
NOMAD_ADDR: http://192.168.1.15:4646
|
||||
commands:
|
||||
- nomad job run ./nomad.job
|
||||
trigger:
|
||||
event:
|
||||
- push
|
||||
branch:
|
||||
include:
|
||||
- master
|
||||
|
||||
- name: docker build and publish PR
|
||||
image: docker:dind
|
||||
environment:
|
||||
DOCKER_PASSWORD:
|
||||
from_secret: DOCKER_TOKEN
|
||||
volumes:
|
||||
- name: dockersock
|
||||
path: /var/run/docker.sock
|
||||
commands:
|
||||
- apk add make git
|
||||
- docker login -u adamveld12 -p $${DOCKER_PASSWORD}
|
||||
- make build publish
|
||||
trigger:
|
||||
event:
|
||||
- pull_request
|
||||
- cron
|
||||
|
||||
---
|
||||
|
||||
kind: pipeline
|
||||
type: kubernetes
|
||||
name: Deploy
|
||||
type: docker
|
||||
name: PR build
|
||||
|
||||
volumes:
|
||||
- name: dockersock
|
||||
host:
|
||||
path: /var/run/docker.sock
|
||||
|
||||
environment:
|
||||
GOPATH: /go/
|
||||
HUGO_VERSION: 0.59.1
|
||||
|
||||
trigger:
|
||||
event:
|
||||
- promote
|
||||
- cron
|
||||
- pull_request
|
||||
|
||||
branch:
|
||||
include:
|
||||
- master
|
||||
steps:
|
||||
- name: Publish Latest
|
||||
image: plugins/kaniko
|
||||
settings:
|
||||
username:
|
||||
from_secret: DOCKER_USERNAME
|
||||
password:
|
||||
from_secret: DOCKER_PASSWORD
|
||||
repo: vdhsn/blog
|
||||
tags:
|
||||
- latest
|
||||
- name: docker build and publish - prod
|
||||
image: docker:dind
|
||||
environment:
|
||||
DOCKER_PASSWORD:
|
||||
from_secret: DOCKER_TOKEN
|
||||
volumes:
|
||||
- name: dockersock
|
||||
path: /var/run/docker.sock
|
||||
commands:
|
||||
- apk add make git
|
||||
- docker login -u adamveld12 -p ${DOCKER_PASSWORD}
|
||||
- make build publish-master
|
||||
|
||||
- name: deploy master
|
||||
image: adamveld12/nomad:v1.0.4
|
||||
environment:
|
||||
NOMAD_ADDR: http://192.168.1.15:4646
|
||||
commands:
|
||||
- nomad job run ./nomad.job
|
||||
trigger:
|
||||
event:
|
||||
- push
|
||||
branch:
|
||||
include:
|
||||
- master
|
||||
|
||||
- name: docker build and publish PR
|
||||
image: docker:dind
|
||||
environment:
|
||||
DOCKER_PASSWORD:
|
||||
from_secret: DOCKER_TOKEN
|
||||
volumes:
|
||||
- name: dockersock
|
||||
path: /var/run/docker.sock
|
||||
commands:
|
||||
- apk add make git
|
||||
- docker login -u adamveld12 -p $${DOCKER_PASSWORD}
|
||||
- make build publish
|
||||
trigger:
|
||||
event:
|
||||
- pull_request
|
||||
- cron
|
||||
|
|
|
|||
|
|
@ -1,9 +1,4 @@
|
|||
public
|
||||
resources
|
||||
|
||||
# generated by hugo gen
|
||||
assets/css/syntax.light.css
|
||||
assets/css/syntax.dark.css
|
||||
|
||||
# generated by openring
|
||||
layouts/partials/footer.html
|
||||
public
|
||||
assets/css/syntax.css
|
||||
layouts/partials/openring.out.html
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
[submodule "themes/lines"]
|
||||
path = themes/lines
|
||||
url = https://github.com/adamveld12/lines
|
||||
[submodule "themes/solar-theme-hugo"]
|
||||
path = themes/solar-theme-hugo
|
||||
url = https://github.com/bake/solar-theme-hugo/
|
||||
|
|
|
|||
|
|
@ -1,2 +0,0 @@
|
|||
hugo extended_0.110.0
|
||||
golang 1.19
|
||||
|
|
@ -1,11 +1,10 @@
|
|||
FROM golang:1.19
|
||||
FROM klakegg/hugo:0.81.0-ext-ubuntu-ci as build
|
||||
|
||||
ENV GOPATH=/go
|
||||
ENV GOBIN=/go/bin
|
||||
|
||||
COPY . /go/src/blog
|
||||
WORKDIR /go/src/blog
|
||||
|
||||
RUN go get -u git.sr.ht/~sircmpwn/openring
|
||||
RUN make public
|
||||
|
||||
FROM nginx
|
||||
|
|
|
|||
|
|
@ -0,0 +1,29 @@
|
|||
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"]
|
||||
73
Makefile
73
Makefile
|
|
@ -1,73 +0,0 @@
|
|||
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://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
|
||||
|
||||
public: ./assets/css/syntax.light.css ./assets/css/syntax.dark.css ./layouts/partials/openring.out.html
|
||||
hugo --minify --gc --templateMetrics --templateHints --verbose --enableGitInfo
|
||||
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
---
|
||||
title: "{{ replace .Name "-" " " | title }}"
|
||||
date: {{ dateFormat "2006-01-02" .Date }}
|
||||
date: {{ .Date }}
|
||||
draft: true
|
||||
tags: []
|
||||
---
|
||||
|
|
@ -0,0 +1,76 @@
|
|||
@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;
|
||||
}
|
||||
|
|
@ -0,0 +1,36 @@
|
|||
.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;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
nav {
|
||||
ul {
|
||||
list-style-type: none;
|
||||
padding: 0;
|
||||
|
||||
li {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
.title {
|
||||
font-size: 0.9rem;
|
||||
}
|
||||
}
|
||||
|
||||
#license {
|
||||
font-size: 1rem;
|
||||
}
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
/* 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</h3>
|
||||
<h3>Articles from blogs I follow around the net</h3>
|
||||
<section class="articles">
|
||||
{{range .Articles}}
|
||||
<div class="article">
|
||||
|
|
@ -34,6 +34,7 @@
|
|||
flex-direction: column;
|
||||
margin: 0.5rem;
|
||||
padding: 0.5rem;
|
||||
background: #002a35;
|
||||
min-width: 10rem;
|
||||
}
|
||||
.webring .summary {
|
||||
|
|
@ -43,5 +44,6 @@
|
|||
.webring .attribution {
|
||||
text-align: right;
|
||||
font-size: 0.8rem;
|
||||
color: #eee;
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
52
config.toml
52
config.toml
|
|
@ -1,44 +1,52 @@
|
|||
baseURL = "https://vdhsn.com"
|
||||
title = "VDHSN"
|
||||
theme = "lines"
|
||||
languageCode = "en-us"
|
||||
title = "Adam's Blog"
|
||||
theme = "solar-theme-hugo"
|
||||
pygmentsStyle = "solarized-dark256" # solarized-light, -dark or -dark256
|
||||
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"
|
||||
scheme = "https"
|
||||
|
||||
[menu]
|
||||
[[menu.main]]
|
||||
name = "VDHSN"
|
||||
title = "VDHSN"
|
||||
url = "/"
|
||||
weight = -10
|
||||
title ="Email"
|
||||
name = "adam@vdhsn.com"
|
||||
url = "mailto:adam@vdhsn.com"
|
||||
weight = -100
|
||||
|
||||
[[menu.main]]
|
||||
name = "About"
|
||||
url = "/about"
|
||||
weight = -5
|
||||
title = "PGP"
|
||||
name = "A466CEE1415C0B9C"
|
||||
url = "/gpg.pub"
|
||||
weight = 0
|
||||
|
||||
[[menu.main]]
|
||||
name = "Source"
|
||||
Title = "Code for this site"
|
||||
name = "git.vdhsn.com/adam/blog"
|
||||
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"
|
||||
|
||||
|
||||
|
||||
disableKinds = ['taxonomy', 'term']
|
||||
|
||||
[taxonomies]
|
||||
tag = 'tags'
|
||||
|
||||
[[menu.other]]
|
||||
name = "Resume"
|
||||
url = "/resume_2019.pdf"
|
||||
|
||||
[markup]
|
||||
[markup.highlight]
|
||||
|
|
@ -46,7 +54,7 @@ disableKinds = ['taxonomy', 'term']
|
|||
guessSyntax = false
|
||||
lineNoStart = 1
|
||||
lineNos = true
|
||||
lineNumbersInTable = false
|
||||
lineNumbersInTable = true
|
||||
noClasses = false
|
||||
# style = "monokai"
|
||||
style = "monokai"
|
||||
tabWidth = 4
|
||||
|
|
@ -1,20 +0,0 @@
|
|||
---
|
||||
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]
|
||||
---
|
||||
|
||||
A nice last minute sanity check I use is a `pre-commit` hook that auto runs test and lint commands from a `makefile` or
|
||||
One of my favorite inventions is a `pre-commit` hook that auto runs test and lint commands from a `makefile` or
|
||||
`package.json` if they're found:
|
||||
|
||||
```bash
|
||||
```bash {linenos=table}
|
||||
#!/usr/bin/env bash
|
||||
|
||||
if [ -f "$PWD/makefile" ] && [ ! -z "$(cat $PWD/makefile | grep '^lint:')" ]; then
|
||||
|
|
@ -27,6 +27,9 @@ 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
|
||||
```makefile {linenos=table}
|
||||
# secrets.mk
|
||||
github_access_token := 'xxxxxxxxxxxxxxxxx'
|
||||
slack_access_token := 'xxxxxxxxxxxxxxxxx'
|
||||
```
|
||||
|
||||
Then in makefile I added `include secrets.mk`. Don't forget to add `secrets.mk` to your `.gitignore`!
|
||||
Then in my makefile I added `include secrets.mk`. Don't forget to add `secrets.mk` to your `.gitignore`!
|
||||
|
||||
```makefile
|
||||
include secrets.mk
|
||||
|
|
|
|||
|
|
@ -0,0 +1,10 @@
|
|||
#!/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
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
<div class="mermaid">
|
||||
{{- .Inner | safeHTML }}
|
||||
</div>
|
||||
{{ .Page.Store.Set "hasMermaid" true }}
|
||||
|
||||
|
|
@ -0,0 +1,37 @@
|
|||
<!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>
|
||||
|
||||
{{ 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>
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
{{ 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>
|
||||
{{ end }}
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
{{ 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 }}
|
||||
|
|
@ -1,21 +0,0 @@
|
|||
{{ $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 }}
|
||||
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
<div id="partial-footer">
|
||||
<p class="copyright">
|
||||
© 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,7 +1,22 @@
|
|||
{{ $style := resources.Get (printf "css/syntax.%s.css" (.Site.Params.theme | default "light")) | toCSS | minify | fingerprint }}
|
||||
<base href="{{ .Site.BaseURL }}">
|
||||
|
||||
<link rel="preload" href="{{ $style.Permalink }}" as="style">
|
||||
<link rel="stylesheet" href="{{ $style.Permalink }}">
|
||||
<link rel="canonical" href="{{ .Permalink }}">
|
||||
|
||||
<link rel="shortcut icon" type="image/gif" href="favicon.gif"/>
|
||||
<link rel="icon" href="party-tp.gif" type="image/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>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,24 @@
|
|||
<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>
|
||||
|
|
@ -1,79 +0,0 @@
|
|||
<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. 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…</p>
|
||||
<small class="source">
|
||||
via <a href="https://drewdevault.com">Drew DeVault'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, it’s 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>
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
{{ $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>
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
User-agent: *
|
||||
|
||||
|
|
@ -0,0 +1,58 @@
|
|||
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
|
||||
|
||||
|
|
@ -0,0 +1,42 @@
|
|||
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"]
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Before Width: | Height: | Size: 22 KiB After Width: | Height: | Size: 22 KiB |
|
|
@ -1 +0,0 @@
|
|||
Subproject commit a85d561cac091fcd73a248c3d3c426d39ac15155
|
||||
|
|
@ -0,0 +1 @@
|
|||
Subproject commit 0b8bd8f65caca1128654060d28b1808e7a4d984b
|
||||
Loading…
Reference in New Issue