~adnano/kiln-docs

b4293cbd16d40eeb440a20c34cf3c110c484f8c9 — Adnan Maolood 3 months ago 6527701 master
Build with latest kiln
4 files changed, 27 insertions(+), 14 deletions(-)

M .build.yml
M config.toml
M templates/page.gmi
M templates/page.html
M .build.yml => .build.yml +15 -5
@@ 1,23 1,33 @@
image: alpine/edge
oauth: pages.sr.ht/PAGES:RW
packages:
- kiln
- gmnitohtml
environment:
  site: kiln-docs
  domain: kiln.adnano.co
packages:
- go
- scdoc
sources:
- https://git.sr.ht/~adnano/kiln
- https://git.sr.ht/~adnano/gmnitohtml
- https://git.sr.ht/~adnano/kiln-docs
tasks:
- kiln: |
    cd kiln
    make
    sudo make install
- gmnitohtml: |
    cd gmnitohtml
    make
    sudo make install
- build: |
    cd $site
    kiln build
- publish: |
    tar -C $site/public/gemini -cvz . > gemini.tar.gz
    tar -C $site/public/html -cvz . > html.tar.gz
    tar -C $site/public/https -cvz . > https.tar.gz
    acurl -f https://pages.sr.ht/publish/$domain \
      -Fcontent=@gemini.tar.gz \
      -Fprotocol=GEMINI
    acurl -f https://pages.sr.ht/publish/$domain \
      -Fcontent=@html.tar.gz \
      -Fcontent=@https.tar.gz \
      -Fprotocol=HTTPS

M config.toml => config.toml +6 -3
@@ 1,18 1,21 @@
title = "kiln tutorial"

[permalinks]
"/" = "{{with .Params.slug}}/{{.}}/{{else}}{{.Permalink}}{{end}}"
"/" = "{{with .Params.slug}}/{{.}}/{{else}}{{.Path}}{{end}}"

[[tasks]]
name = "gemini"
input = [".gmi"]
output = ".gmi"
template = ".gmi"
output_dir = "public/gemini"

[[tasks]]
input = [".gmi"]
name = "https"
input = [".md", ".gmi"]
output = ".html"
template = ".html"
preprocess.md = "mdtohtml"
preprocess.gmi = "gmnitohtml"
static_dir = "static"
output_dir = "public/html"
output_dir = "public/https"

M templates/page.gmi => templates/page.gmi +1 -1
@@ 3,7 3,7 @@
{{ .Content }}

{{- with .Next }}
=> {{.Permalink}} Next: {{.Title}}
=> {{ .Path }} Next: {{ .Title }}
{{- else }}
=> / Back to home
{{- end }}

M templates/page.html => templates/page.html +5 -5
@@ 14,11 14,11 @@
      <nav aria-label="Table of contents">
        <ol>
          {{- $current := . }}
          {{- range (dir "/").Pages }}
          {{- range site.Root.Pages }}
          {{- if eq $current . }}
          <li><a class="current" href="{{ .Permalink }}">{{ .Title }}</a></li>
          <li><a class="current" href="{{ .Path }}">{{ .Title }}</a></li>
          {{- else }}
          <li><a href="{{ .Permalink }}">{{ .Title }}</a></li>
          <li><a href="{{ .Path }}">{{ .Title }}</a></li>
          {{- end }}
		  {{- end }}
        </ol>


@@ 37,11 37,11 @@

	  <nav>
        {{- with .Prev }}
		<a class="prev" href="{{ .Permalink }}">← {{ .Title }}</a>
		<a class="prev" href="{{ .Path }}">← {{ .Title }}</a>
        {{- end }}

        {{- with .Next }}
		<a class="next" href="{{ .Permalink }}">{{ .Title }} →</a>
		<a class="next" href="{{ .Path }}">{{ .Title }} →</a>
        {{- end }}
	  </nav>
    </article>