Compare commits

...

2 Commits

Author SHA1 Message Date
hedy 88e71594ab
Major update (too lazy to write the detailed commit message, sorry) 2024-04-07 20:18:33 +08:00
hedy 2e4452bfe2
Update index and about 2024-04-06 21:55:48 +08:00
21 changed files with 127 additions and 65 deletions

View File

@ -5,21 +5,39 @@ HUGO_FLAGS=--cleanDestinationDir
RSYNC=rsync
RSYNC_FLAGS=-av
HUT=hut
GEMINI_DEST=~/public_gemini
GEMINI_DEST_BASE=public_gemini
HTML_DEST=~/public_html
UGLYURL_EXCLUDE=*spsrv*
UGLYURL_EXCLUDE=*no-used-anymore*
DEPLOY_DOMAIN=home.hedy.dev
DEPLOY_HTML_DIST=html.tar.gz
DEPLOY_GEMINI_DIST=gemini.tar.gz
.DEFAULT_GOAL := all
deploy-html:
tar -C $(HTML_DEST) -cvz . > $(DEPLOY_HTML_DIST)
$(HUT) pages publish --protocol HTTPS -d $(DEPLOY_DOMAIN) $(DEPLOY_HTML_DIST)
rm $(DEPLOY_HTML_DIST)
deploy-gemini:
tar -C $(GEMINI_DEST) -cvz . > $(DEPLOY_GEMINI_DIST)
$(HUT) pages publish --protocol GEMINI -d $(DEPLOY_DOMAIN) $(DEPLOY_GEMINI_DIST)
rm $(DEPLOY_GEMINI_DIST)
deploy: deploy-html deploy-gemini
backup:
$(RSYNC) $(RSYNC_FLAGS) $(GEMINI_DEST) $(GEMINI_DEST)-back --delete
$(RSYNC) $(RSYNC_FLAGS) $(HTML_DEST) $(HTML_DEST)-back --delete
nonsymlink-clean:
# clean all non-symlink files
find ~/public_gemini -not -type l -type f -delete
find $(GEMINI_DEST) -not -type l -type f -delete
gen:
$(HUGO) $(HUGO_FLAGS) --cacheDir $(HUGO_CACHEDIR)

View File

@ -31,3 +31,25 @@ css](https://simplecss.org) and sometimes [seirdy's site](https://seirdy.one).
- [ ] syntax hilite post
- [ ] gemini post
- [ ] proper reply via email link
## writing
```sh
bin/post
```
## deploy
Also see [gemcgi](../gemcgi)
```sh
make all deploy
```
### twtxt
Hardcodes destination host and gemini directory.
```sh
bin/twt
```

View File

@ -38,14 +38,19 @@ yesno () {
fi
}
read -p "$(blue filename:\ )" filename
read -p "$(blue slug:\ )" filename
filename=posts/$(date "+%Y-%m-%d")-"$filename".md
hugo new "$filename"
created=$(hugo new "$filename" | sed 's/.*"\(.*\)".*/\1/')
if ! yesno "$(blue 'draft?')" y; then
sed -i 's/draft: true/draft: false/' "$filename"
fi
# do I just suck at shell scripting or is shell scripting so f'ed up that it
# just refuses to work??
# echo "$created"
#
# if ! yesno "$(blue 'draft?')" y; then
# # Not using in-place here because of MacOS vs GNU sed mess
# cat "$created" | sed 's/draft: true/draft: false/' > $created
# fi
if yesno "$(blue edit?)" y; then
"${EDITOR:-vim}" "$filename"
"${EDITOR:-vim}" "$created"
fi

23
bin/twt Executable file
View File

@ -0,0 +1,23 @@
#!/usr/bin/env bash
date=$(date -Iseconds)
dest=deploy@do.hedy.dev
destdir="~/static"
read -p ">> "
if [ -z "$REPLY" ]; then
echo cancelled
exit
fi
rsync --port 22 $dest:"$destdir"/tw.txt .
echo "$date $REPLY" >> tw.txt
echo [...]
tail -n2 tw.txt
echo rsync tw.txt -rav --port 22 $dest:"$destdir"
rsync tw.txt -rav --port 22 $dest:"$destdir"
echo gelim -I 'gemini://warmedal.se/~antenna/submit' -i 'gemini://do.hedy.dev/tw.txt'
gelim -I 'gemini://warmedal.se/~antenna/submit' -i 'gemini://do.hedy.dev/tw.txt'

View File

@ -1,4 +1,4 @@
baseURL = "https://hedy.tilde.cafe/"
baseURL = "https://home.hedy.dev/"
languageCode = "en-us"
title = "~hedy's home"
@ -11,7 +11,7 @@ pygmentsCodeFences = true
disableHugoGeneratorInject = true
[params]
description = "hedy's home: Personal website with blog, projects, and links to hedy's other online presences."
description = "~hedy's home: hedy's canonical web presence including contact information and a blog."
src = "https://sr.ht/~hedy/site"
logURLPrefix = "https://git.sr.ht/~hedy/site/log/master/item/"
copyright = "CC-BY-SA"
@ -20,7 +20,7 @@ copyrightYearStart = "2021"
shortTitle = "~hedy"
suffixTitle = " | ~hedy" # prepended after page titles
geminiRoot = "gemini://hedy.tilde.cafe"
geminiRoot = "gemini://home.hedy.dev"
# true: Use shortcode pfp-name as the home link text in nav bar
# false: Use shortTitle there instead
@ -29,7 +29,7 @@ navHomeUsePFPName = true
[author]
name = "hedy"
email = "hedy@tilde.cafe"
email = "hedy.dev@protonmail.com"
[taxonomies]
tag = "tags"
@ -122,5 +122,5 @@ excludeSources = [
"/",
]
excludeDestinations = [
"https://hedy.tilde.cafe"
"https://do.hedy.dev"
]

View File

@ -1,38 +1,35 @@
# hedy's capsule on ~cafe
# hedy's gemlog
Hi, I'm hedy. I like to build and design stuff.
Hi, I'm hedy. This is where I occasionally post long-form articles and
thoughts.
=> mailto:hedy@tilde.cafe contact — email (preferred)
=> mailto:hedy.dev@protonmail.com contact — email (preferred)
=> https://tilde.zone/@hedy @hedy@tilde.zone (fedi)
=> https://github.com/hedyhli hedyhli (github and discord)
=> https://github.com/hedyhli hedyhli (github)
=> https://sr.ht/~hedy ~hedy (sourcehut)
=> https://hedy.tilde.cafe/ hedy.tilde.cafe on the web
=> spartan://hedy.tilde.cafe:3333/ hedy.tilde.cafe on spartan
=> https://home.hedy.dev/ home.hedy.dev (weblog)
=> spartan://do.hedy.dev/ spartan
## Pages
=> about.gmi about.gmi (and methods of contact)
=> ./key.asc PGP public key
=> ./key.txt SSH public key
=> //do.hedy.dev/pgp.asc PGP public key
=> //do.hedy.dev/sshkey.txt SSH public key
=> tinylog.gmi tinylog.gmi
=> ./tw.txt twtxt feed
=> //do.hedy.dev/tinylog.gmi tinylog.gmi
=> //do.hedy.dev/tw.txt twtxt feed
=> misc.gmi misc.gmi
## Other Stuff
=> ./water water my plant :)
## Services
=> ./help/py lookup python help() for something
=> //hedy.tilde.cafe/spartan spartan -> gemini proxy
=> //do.hedy.dev/help/py lookup python help() for something
=> //do.hedy.dev/spartan spartan -> gemini proxy
=> //do.hedy.dev/pyjoke get a random programming joke
## Projects
@ -41,7 +38,7 @@ Almost all my repos are mirrored on tildegit.org, sr.ht and sometimes on github.
Here are my projects with gemini homepages:
=> //hedy.tilde.cafe/spsrv/ spsrv
=> //do.hedy.dev/spsrv spsrv
All public projects:
@ -52,7 +49,7 @@ All public projects:
## Useful links to outer space
=> //gemini.circumlunar.space Gemini Protocol
=> //spartan.mozz.us Spartan Protocol
=> //rawtext.club rawtext.club
=> //nytpu.com/feed.gmi nytpu's comitium feed
=> //warmedal.se/~antenna Antenna feed
=> //rawtext.club rawtext.club
=> //spartan.mozz.us Spartan Protocol

View File

@ -18,7 +18,7 @@ Follow the rabbit hole sobre mí... [@hedy@tilde.zone](https://tilde.zone/@hedy)
## Contacts
Preferably <a rel="me" href="mailto:hedy@tilde.cafe">email</a> ([PGP](./key.asc)) or
Preferably <a rel="me" href="mailto:hedy.dev@protonmail.com">email</a> or
<a rel="me" href="https://tilde.zone/@hedy">Mastodon</a> on the Fediverse.
My interests range from dev tooling, math, cryptology to physics, linguistics
@ -28,13 +28,8 @@ happens.
You can also chat with me on IRC, XMPP, or matrix — details on my [about
page](./about/).
## Other details
* I also enjoy tweaking my [configuration and setup](https://github.com/hedyhli/dotfiles) (and believe that it is definitely worth spending **30 minutes** writing a [script](https://hedy.tilde.cafe/how-to-be-productive.jpg) that runs once, for **three milliseconds** \\s).
* Posting shorter, more frequent updates on my journal: [hedy.flounder.online/journal/](https://hedy.flounder.online/journal/).
* Recently, I've made a hand-picked list of cool things on tilde.cafe! Check it out: [~Cafe Spotlight](https://hedy.tilde.cafe/cafe-spotlight/)
* Alternate versions of the content here are available on [gemini://](https://gemini.circumlunar.space) and [spartan://](https://portal.mozz.us/gemini/spartan.mozz.us) via the same hostname.
Alternate versions of the content here are available on
[gemini://](https://gemini.circumlunar.space) and
[spartan://](https://portal.mozz.us/gemini/spartan.mozz.us) via the same
hostname.

View File

@ -43,8 +43,7 @@ Preferred method of contact: **Email**
| Gopher Client | [Lagrange](https://gmi.skyjake.fi/lagrange/) |
| Editor | [Neovim](https://neovim.io/), [Emacs](https://www.gnu.org/software/emacs/), [Helix](https://helix-editor.com/) |
| Shell | [fish](https://fishshell.com/), [eshell](https://www.gnu.org/software/emacs/manual/html_mono/eshell.html) |
| Theme | [Dracula](https://draculatheme.com/), [Tundra (neovim)](https://github.com/sam4llis/nvim-tundra),
[EF Themes (emacs)](https://protesilaos.com/emacs/ef-themes) |
| Theme | [Dracula](https://draculatheme.com/), [Tundra (neovim)](https://github.com/sam4llis/nvim-tundra), [EF Themes (emacs)](https://protesilaos.com/emacs/ef-themes) |
{{</table>}}
For more information on my setup, check out my [dotfiles repository on GitHub](https://github.com/hedyhli/dotfiles) or [on SourceHut](https://sr.ht/~hedy/dotfiles).

View File

@ -14,7 +14,7 @@
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title>{{ if eq .Title .Site.Title }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{.}} on {{ end }}{{ .Site.Title }}{{ end }}</title>
<link>{{ .Permalink }}</link>
<link>{{ .RelPermalink }}</link>
<description>Recent content {{ if ne .Title .Site.Title }}{{ with .Title }}in {{.}} {{ end }}{{ end }}on {{ .Site.Title }}</description>
<ttl>1440</ttl>
<generator>Hugo -- gohugo.io</generator>{{ with .Site.LanguageCode }}
@ -24,16 +24,16 @@
<copyright>{{.}}</copyright>{{end}}{{ if not .Date.IsZero }}
<lastBuildDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</lastBuildDate>{{ end }}
{{- with .OutputFormats.Get "RSS" }}
{{ printf "<atom:link href=%q rel=\"self\" type=%q />" .Permalink .MediaType | safeHTML }}
{{ printf "<atom:link href=%q rel=\"self\" type=%q />" .RelPermalink .MediaType | safeHTML }}
{{- end }}
{{- range where .Site.Pages "Kind" "page" }}
{{- if or (eq .Section "posts") (eq .Section "post") }}
<item>
<title>{{ .Title }}</title>
<link>{{ .Permalink }}</link>
<link>{{ .RelPermalink }}</link>
<pubDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</pubDate>
{{ with .Site.Author.email }}<author>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</author>{{end}}
<guid>{{ .Permalink }}</guid>
<guid>{{ .RelPermalink }}</guid>
<description>{{ .Content | html }}</description>
</item>
{{- end }}

View File

@ -9,9 +9,9 @@
{{- printf "<?xml version=\"1.0\" encoding=\"utf-8\"?>" | safeHTML }}
<feed xmlns="http://www.w3.org/2005/Atom">
<title>hedy's blog</title>
<link href="{{ .Permalink }}"/>
<link href="{{ .RelPermalink }}"/>
<updated>{{ .Date.Format "2006-01-02" | safeHTML }}T12:00:00Z</updated>
<id>{{ .Permalink }}</id>
<id>{{ .RelPermalink }}</id>
<author>
<name>{{ $.Site.Author.name }}</name>
<email>{{ $.Site.Author.email }}</email>
@ -20,8 +20,8 @@
{{- if or (eq .Section "posts") (eq .Section "post") }}
<entry>
<title>{{ .Title }}</title>
{{ printf `<link rel="alternate" href="%s" />` .Permalink | safeHTML }}
<id>{{ .Permalink }}</id>
{{ printf `<link rel="alternate" href="%s" />` .RelPermalink | safeHTML }}
<id>{{ .RelPermalink }}</id>
<updated>{{ .Date.Format "2006-01-02" }}T12:00:00Z</updated>
<author>
<name>{{ $.Site.Author.name }}</name>

View File

@ -20,7 +20,7 @@
{{- $p := . -}}
{{- with .OutputFormats.Get "gemtext" }}
<entry>
{{- $perm := replace (replace .Permalink "/gemini" "" 1) "/index.gmi" ".gmi" 1 }}
{{- $perm := replace (replace .RelPermalink "/gemini" "" 1) "/index.gmi" ".gmi" 1 }}
<title>{{ $p.Title }}</title>
{{ printf `<link rel="alternate" href="%s" />` $perm | safeHTML }}
<id>{{ $perm }}</id>

View File

@ -7,7 +7,7 @@
<ul>
{{- range .Data.Pages }}
<li>
<a href="{{ .Permalink }}">{{ .Title }}</a>
<a href="{{ .RelPermalink }}">{{ .Title }}</a>
</li>
{{- end }}
</ul>

View File

@ -7,7 +7,7 @@
{{ range (where .Site.RegularPages "Section" "posts") }}
{{- if .OutputFormats.Get "gemtext" }}
=> {{replace (replace .Permalink "/gemini" "" 1) "/index.gmi" ".gmi" 1}} {{ .Date.Format "2006-01-02" }}: {{.Title | safeHTML}}{{ end }}{{ end }}
=> {{replace (replace .RelPermalink "/gemini" "" 1) "/index.gmi" ".gmi" 1}} {{ .Date.Format "2006-01-02" }}: {{.Title | safeHTML}}{{ end }}{{ end }}
--
{{- end }}

View File

@ -15,9 +15,9 @@
<!--favicon-->
{{ $favicon_svg := resources.Get "/favicon.svg" | resources.Fingerprint "md5" }}
{{- printf `<link rel="icon" sizes="any" href="%s" type="image/svg+xml" />` $favicon_svg.Permalink | safeHTML }}
{{- printf `<link rel="icon" sizes="any" href="%s" type="image/svg+xml" />` $favicon_svg.RelPermalink | safeHTML }}
{{ $favicon_png := resources.Get "/favicon.png" | resources.Fingerprint "md5" }}
{{- printf `<link rel="icon" sizes="192x192" href="%s" type="image/png" />` $favicon_png.Permalink | safeHTML -}}
{{- printf `<link rel="icon" sizes="192x192" href="%s" type="image/png" />` $favicon_png.RelPermalink | safeHTML -}}
<meta name="color-scheme" content="light dark" />
<meta name="format-detection" content="telephone=no" />
@ -52,6 +52,7 @@
{{ $syntaxdark := resources.Get "syntax/dark.css" | minify -}}
<style>
{{- $syntaxlight.Content | safeCSS }}
@media (prefers-color-scheme: dark) {
{{- $syntaxdark.Content | safeCSS -}}
}

View File

@ -17,7 +17,7 @@
{{ .Pre -}}
<li>
<a href="{{ $url }}"
{{- if hasPrefix $currentPage.Permalink $url }}class="selected"{{ end -}}
{{- if hasPrefix $currentPage.RelPermalink $url }}class="selected"{{ end -}}
title="{{ .Title }}">{{- .Name -}}</a>
</li>
{{ .Post }}

View File

@ -1 +0,0 @@
../shortcodes/pfp-name.html

View File

@ -0,0 +1 @@
<span class="pfp-name">{{ partial "pfp.html" }} <span class="pfp-text">{{ .Site.Author.name }}</span></span>{{- "" -}}

View File

@ -1 +0,0 @@
../shortcodes/pfp.html

View File

@ -0,0 +1,3 @@
{{ $pfp := resources.Get "/dotslash-brush.svg" | resources.Fingerprint "md5" -}}
<img alt="./" class="pfp" src="{{ $pfp.RelPermalink }}">
{{- /* should this set a default size? */ -}}

View File

@ -25,7 +25,7 @@ Comments can be sent to my <a href="https://lists.sr.ht/~hedy/posts">public mail
{{ else -}}
<h3>
{{ end -}}
<a href="{{ .Permalink }}">{{ .Title }}</a>
<a href="{{ .RelPermalink }}">{{ .Title }}</a>
{{ if in $outerRel "posts" -}}
</h2>
{{ else -}}

View File

@ -8,5 +8,5 @@
Tag:
{{- end }}
{{ range $index, $tag := . -}}{{- with $.Site.GetPage (printf "/%s/%s" $taxonomy $tag) -}}
{{- if $index -}}, {{ end -}}<a href="{{ .Permalink }}">{{ $tag | urlize }}</a>{{- end -}}{{- end }}
{{- if $index -}}, {{ end -}}<a href="{{ .RelPermalink }}">{{ $tag | urlize }}</a>{{- end -}}{{- end }}
{{- end -}}

View File

@ -25,7 +25,7 @@ Tag:
Questions/comments:
=> mailto:~hedy/posts@lists.sr.ht Public gemlog mailing list (plain-text only)
=> mailto:hedy@tilde.cafe Or email me directly
=> mailto:{{ .Site.Author.Email }} Or email me directly
=> .. Home
{{- end }}

View File

@ -1,3 +1,3 @@
{{ $pfp := resources.Get "/dotslash-brush.svg" | resources.Fingerprint "md5" -}}
<img alt="./" class="pfp" src="{{ $pfp.Permalink }}">
<img alt="./" class="pfp" src="{{ $pfp.RelPermalink }}">
{{- /* should this set a default size? */ -}}