From 8dd7877c87c6497e598f949bc66199b3ace1a00b Mon Sep 17 00:00:00 2001 From: Andrew Williams Date: Tue, 29 Jun 2021 00:15:47 +0100 Subject: [PATCH] Initial commit --- .github/workflows/deploy.yaml | 23 +++++++++++++++++++++++ .gitignore | 1 + Makefile | 17 +++++++++++++++++ config.toml | 15 +++++++++++++++ content/_index.gmi | 3 +++ templates/_default/atom.xml | 17 +++++++++++++++++ templates/_default/index.gmi | 6 ++++++ templates/_default/page.gmi | 5 +++++ 8 files changed, 87 insertions(+) create mode 100644 .github/workflows/deploy.yaml create mode 100644 .gitignore create mode 100644 Makefile create mode 100644 config.toml create mode 100644 content/_index.gmi create mode 100644 templates/_default/atom.xml create mode 100644 templates/_default/index.gmi create mode 100644 templates/_default/page.gmi diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml new file mode 100644 index 0000000..40e2611 --- /dev/null +++ b/.github/workflows/deploy.yaml @@ -0,0 +1,23 @@ +name: Deploy +on: + push: + branches: + - main +jobs: + deploy: + name: Deploy + environment: production + runs-on: ubuntu-latest + steps: + - name: Deploy to target system + uses: appleboy/ssh-action@master + with: + host: ${{ secrets.TARGET_HOST }} + username: ${{ secrets.DEPLOYMENT_USER }} + key: ${{ secrets.DEPLOYMENT_SSH_KEY }} + port: 22 + script: | + cd ~/src/dimension-nikdoof + sudo git config pull.ff only + sudo git reset --hard + sudo git pull \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3b8bd73 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +public/* \ No newline at end of file diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..f63ab7d --- /dev/null +++ b/Makefile @@ -0,0 +1,17 @@ +.POSIX: +DESTDIR=~/public_gemini + +.PHONY: all +all: pull build + +.PHONY: pull +pull: + git pull origin + +.PHONY: clean +clean: + cd $(DESTDIR) && rm -rf * + +.PHONY: build +build: + ${HOME}/bin/kiln build diff --git a/config.toml b/config.toml new file mode 100644 index 0000000..7fd55af --- /dev/null +++ b/config.toml @@ -0,0 +1,15 @@ +title = "Example website" +urls = ["gemini://example.com"] + +[feeds] +"/" = "Example feed" + +[permalinks] +"/" = "/{{ .Date.Format `2006/01/02` }}/{{ path.Base .Permalink }}/" + +[[tasks]] +input = [".gmi"] +output = ".gmi" +template = ".gmi" +static_dir = "static" +output_dir = "public" diff --git a/content/_index.gmi b/content/_index.gmi new file mode 100644 index 0000000..a43abfc --- /dev/null +++ b/content/_index.gmi @@ -0,0 +1,3 @@ +--- +title: Hello, world! +--- diff --git a/templates/_default/atom.xml b/templates/_default/atom.xml new file mode 100644 index 0000000..89cdd2a --- /dev/null +++ b/templates/_default/atom.xml @@ -0,0 +1,17 @@ +{{ `` | safeHTML }} + +{{ index site.URLs 0 }}{{ .Permalink }} +{{ .Title }} +{{ .Updated.Format "2006-01-02T15:04:05Z07:00" }} + +{{ range .Entries }} + {{ index site.URLs 0 }}{{ .Permalink }} + {{ .Title }} + {{ .Date.Format "2006-01-02T15:04:05Z07:00" }} + {{- $permalink := .Permalink }} + {{- range site.URLs }} + + {{- end }} + +{{ end -}} + diff --git a/templates/_default/index.gmi b/templates/_default/index.gmi new file mode 100644 index 0000000..2716f1c --- /dev/null +++ b/templates/_default/index.gmi @@ -0,0 +1,6 @@ +# {{ .Title }} +{{ if .Content }} +{{ .Content }}{{ end }} +{{ range .Pages }}=> {{ .Permalink }} {{ if not .Date.IsZero -}} +{{.Date.Format "2006-01-02"}} {{end}}{{.Title}} +{{ end -}} diff --git a/templates/_default/page.gmi b/templates/_default/page.gmi new file mode 100644 index 0000000..c9de13a --- /dev/null +++ b/templates/_default/page.gmi @@ -0,0 +1,5 @@ +# {{ .Title }} +{{- if not .Date.IsZero }} +Posted on {{ .Date.Format "2006-01-02" }}{{ end }} + +{{ .Content }}