Compare commits

...

10 commits

6 changed files with 112 additions and 29 deletions

View file

@ -0,0 +1,54 @@
name: Deploy to neocities
# only run on changes to main
on:
push:
branches:
- main
concurrency: # prevent concurrent deploys doing strange things
group: deploy-to-neocities
cancel-in-progress: true
# Default to bash
defaults:
run:
shell: bash
jobs:
deploy:
runs-on: ubuntu-latest
env:
HUGO_VERSION: "0.121.1"
steps:
- name: Install Hugo CLI
run: |
wget -O ${{ runner.temp }}/hugo.deb https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.deb \
&& sudo dpkg -i ${{ runner.temp }}/hugo.deb
- name: Install Dart Sass
run: sudo snap install dart-sass
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Install Node.js dependencies
run: "[[ -f package-lock.json || -f npm-shrinkwrap.json ]] && npm ci || true"
- name: Build with Hugo
env:
# For maximum backward compatibility with Hugo modules
HUGO_ENVIRONMENT: production
HUGO_ENV: production
run: |
hugo \
--minify \
--baseURL "https://runtimeterror.dev/"
- name: Highlight with Torchlight
run: |
npm i @torchlight-api/torchlight-cli
npx torchlight
- name: Deploy to neocities
uses: bcomnes/deploy-to-neocities@v1
with:
api_token: ${{ secrets.NEOCITIES_API_TOKEN }}
cleanup: false
dist_dir: public

View file

@ -171,8 +171,8 @@ title = "hugo"
url = "https://gohugo.io" url = "https://gohugo.io"
[[powerLinks]] [[powerLinks]]
title = "netlify" title = "neocities"
url = "https://www.netlify.com" url = "https://neocities.org/about"
[[powerLinks]] [[powerLinks]]
title = "risotto" title = "risotto"

View file

@ -1,5 +1,6 @@
+++ +++
title = "404'd!" title = "404'd!"
aliases = ["not_found"]
noindex = true noindex = true
timeless = true timeless = true
comments = true comments = true

View file

@ -1,7 +1,24 @@
{{ define "main" }} {{ define "main" }}
{{- $ageDays := div (sub now.Unix .Date.Unix) 86400 -}} {{- $ageDays := div (sub now.Unix .Date.Unix) 86400 -}}
<header class="content__header"> <header class="content__header">
<h1>{{ .Title | markdownify }}</h1> <div class="frontmatter">
<hr>
<table class="frontmatter">
<tr><td class="label">title:</td><td class="title">{{ .Title | markdownify }}</td></tr>
{{- if .Params.date }}
{{- $postDate := .Date.Format "2006-01-02" }}
{{- $updateDate := .Lastmod.Format "2006-01-02" }}
<tr><td class="label">posted:</td><td class="content">{{ $postDate }}</td></tr>
{{- if ne $postDate $updateDate }}
<tr><td class="label">updated:</td><td class="content">{{ $updateDate }}</td></tr>
{{ end }}
{{ end }}
{{- with .Params.tags }}{{- $tagCount := len . }}
<tr class="frontmatter_tags"><td>tags:</td><td>{{- if gt $tagCount 5 }}<details><summary>See all {{ $tagCount }} tags...</summary>{{- end }}[&quot;<a href="/tags">all</a>&quot; {{- range . }}{{- $tag := urlize . }}{{ if $tag }}, {{ end }}&quot;<a href='{{ absLangURL (printf "tags/%s" $tag) }}'>{{ . }}</a>&quot;{{- end }}]{{- if gt $tagCount 5 }}</details>{{- end }}</td></tr>
{{- end }}
</table>
<hr>
</div>
</header> </header>
{{- with .Param "lastmod" -}} {{- with .Param "lastmod" -}}
{{- $ageDays = div (sub now.Unix .Unix) 86400 -}} {{- $ageDays = div (sub now.Unix .Unix) 86400 -}}

View file

@ -1,30 +1,10 @@
{{- $postDate := .Date.Format "2006-01-02" }} {{ if .Params.description }}<p>{{ .Params.description }}</p><hr>{{ end }}
{{- $updateDate := .Lastmod.Format "2006-01-02" }} {{ if and (gt .WordCount 400 ) (gt (len .TableOfContents) 180) }}
{{ if or (.Params.description) (.Params.date) }} <p>
{{ if .Params.description }}<p>{{ .Params.description }}</p>{{ end }}
<p>
{{ if .Params.date }}<table><tr><td>posted:</td><td>{{ $postDate }}</td></tr>{{- if ne $postDate $updateDate }}<tr><td>updated:</td><td>{{ $updateDate }}</td></tr>{{ end }}</table>{{ end }}
</p>
<hr>
{{ if and (gt .WordCount 400 ) (gt (len .TableOfContents) 180) }}
<p>
<h3>On this page</h3> <h3>On this page</h3>
{{ .TableOfContents }} {{ .TableOfContents }}
<hr> <hr>
</p> </p>
{{ end }}
{{- with .Params.tags -}}
<p>
<h3>Tags</h3>
[<a href="/tags">all</a>]
{{- range . }}
{{- $tag := urlize . -}}
[<a href='{{ absLangURL (printf "tags/%s" $tag) }}' title="{{ . }}">{{ . }}</a>]
{{- end }}
<br><br>
<hr>
</p>
{{- end }}
{{ end }} {{ end }}
{{ if isset .Params "categories" }} {{ if isset .Params "categories" }}

View file

@ -303,3 +303,34 @@ button.tinylytics_kudos:hover {
transform: scale(1.1); transform: scale(1.1);
text-shadow: var(--off-fg) 0 0 1px; text-shadow: var(--off-fg) 0 0 1px;
} }
/* post front matter styling*/
.frontmatter hr {
margin-bottom: 0rem;
margin-top: 0rem;
}
.frontmatter h1 {
margin-top: 0rem;
}
.frontmatter .label {
color: var(--off-fg);
font-size: 0.8rem;
}
.frontmatter .title {
color: var(--fg);
font-weight: 600;
font-size: 1.1rem;
}
.frontmatter table {
overflow-wrap: break-word;
margin-bottom: 0rem;
}
.frontmatter_tags {
font-size: 0.8rem;
color: var(--off-fg);
}