Compare commits
No commits in common. "763af607c1d9a3958f7f3f3ccab6d8378df85921" and "2b95b42eb6b3322266760f789e27530ac328729e" have entirely different histories.
763af607c1
...
2b95b42eb6
|
|
@ -1,2 +1 @@
|
|||
resources
|
||||
public
|
||||
|
|
|
|||
31
Dockerfile
31
Dockerfile
|
|
@ -1,2 +1,29 @@
|
|||
FROM nginx
|
||||
COPY ./public /usr/share/nginx/html
|
||||
FROM debian:bullseye-slim
|
||||
|
||||
|
||||
ARG VERSION=0.59.1
|
||||
|
||||
WORKDIR /tmp
|
||||
RUN apt-get update \
|
||||
&& apt-get install -y tar curl ca-certificates python3 python-pip \
|
||||
&& apt-get clean \
|
||||
&& pip 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 hugo
|
||||
|
||||
WORKDIR /opt/workdir
|
||||
|
||||
VOLUME /opt/workdir
|
||||
|
||||
EXPOSE 1313
|
||||
|
||||
ENTRYPOINT /usr/local/bin/hugo
|
||||
|
||||
CMD ["--help"]
|
||||
|
|
|
|||
|
|
@ -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 python-pip \
|
||||
&& apt-get clean \
|
||||
&& pip 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 hugo
|
||||
|
||||
WORKDIR /opt/workdir
|
||||
|
||||
VOLUME /opt/workdir
|
||||
|
||||
EXPOSE 1313
|
||||
|
||||
ENTRYPOINT /usr/local/bin/hugo
|
||||
|
||||
CMD ["--help"]
|
||||
|
|
@ -12,11 +12,6 @@ h1,
|
|||
h2,
|
||||
h3 {
|
||||
font-size: 12pt;
|
||||
margin: 0 0 10px 0;
|
||||
}
|
||||
|
||||
p {
|
||||
margin: 0 0 10px 0;
|
||||
}
|
||||
|
||||
.container {
|
||||
|
|
@ -29,7 +24,6 @@ p {
|
|||
}
|
||||
|
||||
#header {
|
||||
margin-bottom: 20px;
|
||||
grid-column-start: 1;
|
||||
grid-column-end: 3;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,27 +3,18 @@
|
|||
display: flex;
|
||||
list-style-type: none;
|
||||
padding: 0;
|
||||
margin: 0 0 10px 0;
|
||||
|
||||
li {
|
||||
margin-right: 5px;
|
||||
//background-color: black;
|
||||
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;
|
||||
color: #a31515;
|
||||
}
|
||||
|
||||
.postdate {
|
||||
|
|
|
|||
|
|
@ -6,15 +6,16 @@ tags: [git, testing, bash]
|
|||
|
||||
[Git hooks][1] are a feature of the Git VCS that allow you to fire off custom logic on the client side when you take
|
||||
actions in your repository. These are shell scripts in the `.git/hooks/` directory of your repository, but they can also
|
||||
exist in your home directory at `~/.githooks/`.
|
||||
exist at `~/.githooks/`.
|
||||
|
||||
Any hooks found in `~/.githooks/` are executed globally, this makes it easy to setup a custom workflow that is consistent
|
||||
across your entire machine.
|
||||
Any hooks found in `~/.githooks/` are executed globally for the user of that shell, this makes it awesome for running a
|
||||
custom workflow that is consistent across your entire machine.
|
||||
|
||||
## Automatically lint and test on commit
|
||||
## Useful hooks
|
||||
|
||||
My favorite hook that I'm running these days is a `~/.githooks/pre-commit` hook that auto runs tests and lint commands
|
||||
if they're found.
|
||||
|
||||
One of my favorite hooks is the `~/.githooks/pre-commit` hook that auto runs test and lint commands from a `makefile` or
|
||||
`package.json` if they're found:
|
||||
|
||||
```sh
|
||||
{{<highlight bash "linenos=table">}}
|
||||
|
|
@ -38,10 +39,8 @@ fi
|
|||
{{</highlight>}}
|
||||
```
|
||||
|
||||
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.
|
||||
of the lint/test results failing I can do `git commit --no-verify` to skip the `pre-commit` hook.
|
||||
|
||||
[1]: https://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks "Git hooks"
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
{{ range .Param $taxo }}
|
||||
{{ $name := . }}
|
||||
{{ with $.Site.GetPage (printf "/%s/%s" $taxo ($name | urlize)) }}
|
||||
<li><a href="{{ .Permalink }}">#{{ $name }}</a></li>
|
||||
<li><a href="{{ .Permalink }}">{{ $name }}</a></li>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</ul>
|
||||
33
makefile
33
makefile
|
|
@ -1,31 +1,16 @@
|
|||
VERSION := $(shell git rev-parse --abbrev-ref HEAD)
|
||||
.PHONY: clean docker-build-dev serve write
|
||||
.PHONY: docker-build serve write
|
||||
|
||||
write: serve
|
||||
|
||||
build: public
|
||||
docker build -t vdhsn/blog:${VERSION} -f Dockerfile .
|
||||
|
||||
publish: build
|
||||
docker push vdhsn/blog:${VERSION}
|
||||
|
||||
test-publish: build
|
||||
docker run -it -p 8080:80 vdhsn/blog:${VERSION}
|
||||
|
||||
new-post:
|
||||
@./hugo new posts/$${TITLE:new_post}.md
|
||||
|
||||
docker-build-dev:
|
||||
@docker build --build-arg='VERSION=0.59.1' -t hugo -f Dockerfile.dev .
|
||||
|
||||
serve:
|
||||
./hugo server -D --log -w --bind 0.0.0.0
|
||||
|
||||
clean:
|
||||
@rm -rf ./public ./resources
|
||||
./hugo new posts/$${TITLE:new_post}.md
|
||||
|
||||
hugo:
|
||||
@go get -u --tags extended -v github.com/gohugoio/hugo
|
||||
go get -u --tags extended -v github.com/gohugoio/hugo
|
||||
go install --tags extended -v github.com/gohugoio/hugo
|
||||
|
||||
public:
|
||||
./hugo --minify --gc
|
||||
docker-build:
|
||||
docker build --build-arg='VERSION=0.59.1' -t hugo .
|
||||
|
||||
serve:
|
||||
./hugo server -D -w --bind 0.0.0.0
|
||||
|
|
|
|||
|
|
@ -0,0 +1,14 @@
|
|||
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
|
||||
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
|
||||
<channel>
|
||||
<title>Categories on Adam's blog</title>
|
||||
<link>https://vdhsn.com/categories/</link>
|
||||
<description>Recent content in Categories on Adam's blog</description>
|
||||
<generator>Hugo -- gohugo.io</generator>
|
||||
<language>en-us</language>
|
||||
|
||||
<atom:link href="https://vdhsn.com/categories/index.xml" rel="self" type="application/rss+xml" />
|
||||
|
||||
|
||||
</channel>
|
||||
</rss>
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
|
||||
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
|
||||
<channel>
|
||||
<title>Adam's blog</title>
|
||||
<link>https://vdhsn.com/</link>
|
||||
<description>Recent content on Adam's blog</description>
|
||||
<generator>Hugo -- gohugo.io</generator>
|
||||
<language>en-us</language>
|
||||
|
||||
<atom:link href="https://vdhsn.com/index.xml" rel="self" type="application/rss+xml" />
|
||||
|
||||
|
||||
</channel>
|
||||
</rss>
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
|
||||
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
|
||||
xmlns:xhtml="http://www.w3.org/1999/xhtml">
|
||||
|
||||
<url>
|
||||
<loc>https://vdhsn.com/</loc>
|
||||
</url>
|
||||
|
||||
<url>
|
||||
<loc>https://vdhsn.com/categories/</loc>
|
||||
</url>
|
||||
|
||||
<url>
|
||||
<loc>https://vdhsn.com/tags/</loc>
|
||||
</url>
|
||||
|
||||
</urlset>
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
|
||||
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
|
||||
<channel>
|
||||
<title>Tags on Adam's blog</title>
|
||||
<link>https://vdhsn.com/tags/</link>
|
||||
<description>Recent content in Tags on Adam's blog</description>
|
||||
<generator>Hugo -- gohugo.io</generator>
|
||||
<language>en-us</language>
|
||||
|
||||
<atom:link href="https://vdhsn.com/tags/index.xml" rel="self" type="application/rss+xml" />
|
||||
|
||||
|
||||
</channel>
|
||||
</rss>
|
||||
Loading…
Reference in New Issue