mirror of
https://git.mills.io/prologic/zs-starter-template.git
synced 2024-11-21 21:06:03 +03:00
Add better layout, fixed Drone CI and dpeloyed to zs.mills.io
This commit is contained in:
parent
f66dbadf21
commit
46696aaf03
10
.dockerfiles/entrypoint.sh
Executable file
10
.dockerfiles/entrypoint.sh
Executable file
@ -0,0 +1,10 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
[ -n "${PUID}" ] && usermod -u "${PUID}" mpp
|
||||||
|
[ -n "${PGID}" ] && groupmod -g "${PGID}" mpp
|
||||||
|
|
||||||
|
printf "Configuring mpp...\n"
|
||||||
|
npx react-inject-env set -d /data
|
||||||
|
|
||||||
|
printf "Switching UID=%s and GID=%s\n" "${PUID}" "${PGID}"
|
||||||
|
exec su-exec mpp:mpp "$@"
|
32
.drone.yml
32
.drone.yml
@ -1,21 +1,39 @@
|
|||||||
---
|
---
|
||||||
kind: pipeline
|
kind: pipeline
|
||||||
name: default
|
name: 🐳 Docker
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: build-image-push
|
- name: 📦 Image
|
||||||
image: plugins/kaniko
|
image: plugins/kaniko
|
||||||
settings:
|
settings:
|
||||||
registry: <register>
|
repo: r.mills.io/prologic/zs
|
||||||
repo: <register>/<user>/<image>
|
|
||||||
tags: latest
|
tags: latest
|
||||||
username:
|
username:
|
||||||
from_secret: <regsitry_username>
|
from_secret: registry_username
|
||||||
password:
|
password:
|
||||||
from_secret: <registry_password>
|
from_secret: registry_password
|
||||||
|
when:
|
||||||
|
branch:
|
||||||
|
- main
|
||||||
|
event:
|
||||||
|
- push
|
||||||
|
|
||||||
|
---
|
||||||
|
kind: pipeline
|
||||||
|
name: 🥳 Done
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: 🔔 Notify
|
||||||
|
image: plugins/webhook
|
||||||
|
settings:
|
||||||
|
urls:
|
||||||
|
- https://msgbus.mills.io/ci.mills.io
|
||||||
|
|
||||||
|
depends_on:
|
||||||
|
- 🐳 Docker
|
||||||
|
|
||||||
trigger:
|
trigger:
|
||||||
branch:
|
branch:
|
||||||
- master
|
- main
|
||||||
event:
|
event:
|
||||||
- push
|
- push
|
||||||
|
@ -8,15 +8,19 @@
|
|||||||
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png">
|
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png">
|
||||||
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png">
|
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png">
|
||||||
<title>{{ title }}</title>
|
<title>{{ title }}</title>
|
||||||
|
<meta name="title" content="{{ title }}" />
|
||||||
|
<meta name="description" content="{{ description }}" />
|
||||||
|
<meta name="keywords" content="{{ keywords }}" />
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
{{ content }}
|
<main>{{ content }}</main>
|
||||||
<hr />
|
<hr />
|
||||||
<footer>
|
<footer>
|
||||||
<small>
|
<p>
|
||||||
|
Copyright (c) James Mills ·
|
||||||
Last modified <time datetime="{{ date +%Y-%m-%dT%H:%M:%SZ%:z }}">{{ date }}</time> ·
|
Last modified <time datetime="{{ date +%Y-%m-%dT%H:%M:%SZ%:z }}">{{ date }}</time> ·
|
||||||
Built with <a href="https://git.mills.io/prologic/zs">zs
|
Built with <a href="https://git.mills.io/prologic/zs">zs
|
||||||
</small>
|
</p>
|
||||||
</footer>
|
</footer>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
4
COPYING
Normal file
4
COPYING
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
Copyright © 2023 James Mills <prologic@shortcircuit.net.au>
|
||||||
|
This work is free. You can redistribute it and/or modify it under the
|
||||||
|
terms of the Do What The Fuck You Want To Public License, Version 2,
|
||||||
|
as published by Sam Hocevar. See the COPYING file for more details.
|
25
Dockerfile
25
Dockerfile
@ -22,13 +22,28 @@ COPY . .
|
|||||||
RUN make build
|
RUN make build
|
||||||
|
|
||||||
# Runtime
|
# Runtime
|
||||||
FROM scratch
|
FROM alpine AS runtime
|
||||||
|
|
||||||
|
RUN apk --no-cache -U add su-exec shadow
|
||||||
|
|
||||||
|
ENV PUID=10000
|
||||||
|
ENV PGID=10000
|
||||||
|
|
||||||
|
RUN addgroup -g "${PGID}" zs && \
|
||||||
|
adduser -D -H -G zs -h /var/empty -u "${PUID}" zs && \
|
||||||
|
mkdir -p /data && chown -R zs:zs /data
|
||||||
|
|
||||||
|
EXPOSE 8000
|
||||||
|
|
||||||
WORKDIR /
|
|
||||||
VOLUME /data
|
VOLUME /data
|
||||||
|
|
||||||
COPY --from=build /go/bin/static /static
|
WORKDIR /
|
||||||
|
|
||||||
|
COPY --from=build /go/bin/static /usr/local/bin/static
|
||||||
COPY --from=build /src/.pub /data
|
COPY --from=build /src/.pub /data
|
||||||
|
|
||||||
ENTRYPOINT ["/static"]
|
COPY .dockerfiles/entrypoint.sh /init
|
||||||
CMD ["-r", "/data"]
|
|
||||||
|
ENTRYPOINT ["/init"]
|
||||||
|
|
||||||
|
CMD ["static", "-n", "-s", "-r", "/data"]
|
||||||
|
14
LICENSE
14
LICENSE
@ -1,9 +1,13 @@
|
|||||||
MIT License
|
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
|
||||||
|
Version 2, December 2004
|
||||||
|
|
||||||
Copyright (c) <year> <copyright holders>
|
Copyright (C) 2004 Sam Hocevar <sam@hocevar.net>
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
Everyone is permitted to copy and distribute verbatim or modified
|
||||||
|
copies of this license document, and changing it is allowed as long
|
||||||
|
as the name is changed.
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
|
||||||
|
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
0. You just DO WHAT THE FUCK YOU WANT TO.
|
||||||
|
18
Makefile
18
Makefile
@ -1,9 +1,8 @@
|
|||||||
-include environ.inc
|
.PHONY: deps dev build image clean
|
||||||
.PHONY: deps dev build install image release test clean
|
|
||||||
|
|
||||||
GOCMD=go
|
GOCMD=go
|
||||||
REGISTRY=<registry>
|
IMAGE := r.mills.io/prologic/zs
|
||||||
IMAGE=<image>
|
TAG := latest
|
||||||
|
|
||||||
all: build
|
all: build
|
||||||
|
|
||||||
@ -13,18 +12,21 @@ deps:
|
|||||||
|
|
||||||
dev : DEBUG=1
|
dev : DEBUG=1
|
||||||
dev : build
|
dev : build
|
||||||
@zs watch
|
@bash -c 'trap "jobs -p | xargs kill" EXIT; \
|
||||||
|
zs watch & \
|
||||||
|
static -r .pub & \
|
||||||
|
echo http://localhost:8000/; \
|
||||||
|
wait'
|
||||||
|
|
||||||
build:
|
build:
|
||||||
@zs build
|
@zs build
|
||||||
|
|
||||||
ifeq ($(PUBLISH), 1)
|
ifeq ($(PUBLISH), 1)
|
||||||
image:
|
image:
|
||||||
@docker build -t $(REGISTRY)/$(IMAGE) .
|
@docker buildx build --platform linux/amd64,linux/arm64 --push -t $(IMAGE):$(TAG) .
|
||||||
@docker push $(REGISTRY)/$(IMAGE)
|
|
||||||
else
|
else
|
||||||
image:
|
image:
|
||||||
@docker build -t $(REGISTRY)/$(IMAGE) .
|
@docker build -t $(IMAGE):$(TAG) .
|
||||||
endif
|
endif
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
|
31
index.md
31
index.md
@ -1,9 +1,32 @@
|
|||||||
# zs starter tempalte
|
---
|
||||||
|
title: zs starter template
|
||||||
|
description: A starter template for the Zen Static (zs) site generator
|
||||||
|
keywords: zen, static, zs, starter, template, site, website, template, generator, ssg
|
||||||
|
---
|
||||||
|
|
||||||
|
# zs starter template
|
||||||
|
|
||||||
This is a [zs](https://git.mills.io/prologic/zs) starter template.
|
This is a [zs](https://git.mills.io/prologic/zs) starter template.
|
||||||
|
|
||||||
It includes:
|
It includes:
|
||||||
|
|
||||||
- A basic `index.md` content
|
- A basic index page
|
||||||
- A basic "layout"
|
- A basic layout using [SimpleCSS](https://simplecss.org/) for style
|
||||||
- A basic CSS for styling
|
|
||||||
|
## Quick Start
|
||||||
|
|
||||||
|
```console
|
||||||
|
git clone https://git.mills.io/prologic/zs.git
|
||||||
|
cd zs
|
||||||
|
make dev
|
||||||
|
```
|
||||||
|
|
||||||
|
Open your browser to http://localhost:8000
|
||||||
|
|
||||||
|
## Demo
|
||||||
|
|
||||||
|
A demo of this starter template can be found here: https://zs.mills.io/
|
||||||
|
|
||||||
|
## License
|
||||||
|
|
||||||
|
`zs-starter-template` is licensed under the terms of the [WTFPL License](/LICENSE)
|
Loading…
Reference in New Issue
Block a user