Compare commits

..

No commits in common. "master" and "3edaf126dcc553614fa7553fcba33c10054dcab5" have entirely different histories.

62 changed files with 161 additions and 430 deletions

25
.gitignore vendored
View File

@ -1,23 +1,2 @@
# Ignore everything except explicitly allowed with `!` public/**
/* deploy_id
# Track this gitignore because duh
!.gitignore
# Track gitmodules because also duh
!.gitmodules
# Content folder where the actual ...ya know... content lives
!content/
# Management script
!tlwiki
# Themes directory
!themes/
# Static directory
!static/
# README
!README.md

8
.gitmodules vendored
View File

@ -1,6 +1,6 @@
[submodule "themes/risotto"]
path = themes/risotto
url = https://github.com/joeroe/risotto.git
[submodule "static/images/logo"] [submodule "static/images/logo"]
path = static/images/logo path = static/images/logo
url = https://git.thurstylark.com/thurstylark/logo.git url = https://git.thurstylark.com/logo.git
[submodule "themes/tlwiki"]
path = themes/tlwiki
url = https://git.thurstylark.com/thurstylark/tlwiki-hugo-theme.git

View File

@ -1,84 +0,0 @@
# Thurstylark's wiki
## Requirements
- Base
- hugo
- Optional (only required for `tlwiki` management script)
- git
- python3
- rsync
## Usage
### Environment Setup
#### Using `tlwiki` script
1. Create `tlwiki-conf.yaml` using `tlwiki-conf.yaml.ex` as a template
2. Run `./tlwiki updeps` to pull in the latest version of all git submodules
#### Using individual commands
1. Initialize all git submodules
```
git submodule update --init --recursive
```
### Deploy
#### Using `tlwiki` script
1. Ensure the values for `deployID.user`, `deployID.host`, and `deployID.dir` are correct
- For best results, use rsync with a non-interactive authentication method such as ssh key pairs
2. Run `./tlwiki deploy`
#### Using individual commands
1. Run `hugo` to build the site
2. Copy the contents of `public/` to your web server's document root
## Hacking
### Automatically run `./tlwiki deploy` on `git push`
Create a symlink named `.git/hooks/pre-push` with `tlwiki` as its target:
```
ln -s ../../tlwiki .git/hooks/pre-push
```
`tlwiki` will help manage this symlink in the future (See: [#1](https://git.thurstylark.com/thurstylark/tlwiki/issues/1))
### Serve the site locally for testing
```
hugo server
```
More info: https://gohugo.io/commands/hugo_server/
## `tlwiki-config.yaml` Configuration Options
| Path | Type | Default | Description |
|-----------------|--------|---------|----------------------------------------------------------|
| deployID.user | string | <none> | rsync username (`USER` in `USER@HOST:DIR`) |
| deployID.host | string | <none> | rsync hostname (`HOST` in `USER@HOST:DIR`) |
| deployID.dir | string | <none> | rsync target remote directory (`DIR` in `USER@HOST:DIR`) |
| repo.URL | string | <none> | Unused |
| repo.branch | string | <none> | Unused |
| repo.remoteName | string | <none> | Unused |

6
archetypes/default.md Normal file
View File

@ -0,0 +1,6 @@
---
title: "{{ replace .Name "-" " " | title }}"
date: {{ .Date }}
draft: true
---

View File

@ -1,12 +1,10 @@
baseURL = 'https://wiki.thurstylark.com/' baseURL = 'https://wiki.thurstylark.com/'
languageCode = 'en-us' languageCode = 'en-us'
title = "TL Wiki" title = "TL Wiki"
theme = "tlwiki" theme = "risotto"
#sectionPagesMenu = "main" #sectionPagesMenu = "main"
# Enable git info access
enableGitinfo = true
# Sidebar: about/bio # Sidebar: about/bio
[params.about] [params.about]
@ -22,20 +20,15 @@ mode = "dark-mode"
[menu] [menu]
[[menu.main]] [[menu.main]]
identifier = "about" identifier = "git"
name = "About" name = "git repos"
url = "/about/" url = "https://git.thurstylark.com"
weight = 1 weight = 2
[[menu.main]] [[menu.main]]
identifier = "windex" identifier = "windex"
name = "Wiki Index" name = "Wiki Index"
url = "/" url = "/"
weight = 2 weight = 1
[[menu.main]]
identifier = "git"
name = "git repos"
url = "https://git.thurstylark.com"
weight = 3
[taxonomies] [taxonomies]
category = "categories" category = "categories"

View File

@ -2,5 +2,4 @@
title: "About" title: "About"
description: "Contact info, portfolio, etc" description: "Contact info, portfolio, etc"
draft: false draft: false
hide: true
--- ---

View File

@ -1,28 +1,19 @@
--- ---
title: "Contact Info" title: "Contact Info"
description: "How to get in touch with me"
date: 2021-9-25 date: 2021-9-25
draft: false draft: false
--- ---
Listed in order of reliability Listed in order of reliability:
| Service | Address | | Email | thurstylark@gmail.com |
| ---: | --- | | Matrix | @thurstylark:thurstylark.com |
| Email | thurstylark@gmail.com | | IRC libera.chat^1^ | thurstylark |
| | thurstylark@thurstylark.com | | IRC oftc.net^1^ | thurstylark |
| ----- | ----- | | Discord | Thurstylark#0472 |
| Matrix | @thurstylark:thurstylark.com | | Signal | (ask for number via Matrix) |
| ----- | ----- | | Twitter | @thurstylark |
| IRC[^1] | thurstylark@libera.chat |
| | thurstylark@oftc.net |
| ----- | ----- |
| Discord | thurstylark |
| ----- | ----- |
| Signal | (ask for number via Matrix) |
| ----- | ----- |
| Twitter | @thurstylark |
[^1]: ~~Since the formation of libera.chat, my presence on freenode.net is purely to squat on my account and nicks so they may not be misused.~~ Never mind, [Freenode decided to shit the bed even harder](https://www.reddit.com/r/irc/comments/o01tmv/freenode_wipes_old_database_and_starts_over/), so I no longer have a presence there. Please use libera.chat or oftc.net instead. 1: ~~Since the formation of libera.chat, my presence on freenode.net is purely to squat on my account and nicks so they may not be misused.~~ Never mind, [Freenode decided to shit the bed even harder](https://www.reddit.com/r/irc/comments/o01tmv/freenode_wipes_old_database_and_starts_over/), so I no longer have a presence there. Please use libera.chat or oftc.net instead.

View File

@ -1,6 +1,5 @@
--- ---
title: "Portfolio" title: "Portfolio"
description: "The things I do"
date: 2021-9-25 date: 2021-9-25
draft: false draft: false
--- ---

View File

@ -1,6 +1,5 @@
--- ---
title: "Resume" title: "Resume"
description: "How to get me to do stuff for money"
date: 2021-9-25 date: 2021-9-25
draft: false draft: false
--- ---
@ -14,6 +13,4 @@ Thanks for visiting, but I have decided against providing a traditional resume a
For examples of my work, feel free to take a look at my [Portfolio](../portfolio/). Of special note is my [Twitch channel](https://twitch.tv/thurstylark), where you can watch me work out loud, in real-time. These resources will do a much better job of communicating my abilities than any work history document ever could. For examples of my work, feel free to take a look at my [Portfolio](../portfolio/). Of special note is my [Twitch channel](https://twitch.tv/thurstylark), where you can watch me work out loud, in real-time. These resources will do a much better job of communicating my abilities than any work history document ever could.
Another factor worth consideration is my perspective on the post-pandemic labor market. I will eventually write a longer post on this subject, but until then, [this video](https://youtu.be/ieStO3JqWJ0) will have to suffice. If you are unable to accept this interpretation, I will not consider working with you.
If you require additional information that isn't covered by the above resources, please reach out to me using one of the methods listed on the [Contact Info](../contact/) page. If you require additional information that isn't covered by the above resources, please reach out to me using one of the methods listed on the [Contact Info](../contact/) page.

View File

@ -12,9 +12,7 @@ draft: false
|-----------------------------|---------|-----------------------------------------------------------------------------|-------------------------------------------------------| |-----------------------------|---------|-----------------------------------------------------------------------------|-------------------------------------------------------|
| Arch Wiki Search | aw | https://wiki.archlinux.org/index.php?title=Special%3ASearch&search=%s&go=Go | | | Arch Wiki Search | aw | https://wiki.archlinux.org/index.php?title=Special%3ASearch&search=%s&go=Go | |
| Arch Package Search | ap | https://www.archlinux.org/packages/?sort=&q=%s&maintainer=&flagged= | | | Arch Package Search | ap | https://www.archlinux.org/packages/?sort=&q=%s&maintainer=&flagged= | |
| Arch User Repository Search | aur | https://aur.archlinux.org/packages?O=0&K=%s&SeB=nd&SB=n&SO=a | | | Arch User Repository Search | aur | https://aur.archlinux.org/packages/?O=0&K=%s | |
| Arch Linux Bug Lookup | fs | https://bugs.archlinux.org/task/%s | Go directly to bug number | | Arch Linux Bug Lookup | fs | https://bugs.archlinux.org/task/%s | Go directly to bug number |
| Arch Manpage Lookup | man | https://man.archlinux.org/man/%s | Go directly to manpage |
| Arch Manpage Search | mans | https://man.archlinux.org/search?q=%s&lang=en | Search manpage db |
| Dell Service Tag Lookup | dell | http://www.dell.com/support/home/us/en/04/product-support/servicetag/%s | Go directly to the Dell Support page of a service tag | | Dell Service Tag Lookup | dell | http://www.dell.com/support/home/us/en/04/product-support/servicetag/%s | Go directly to the Dell Support page of a service tag |
| ShellCheck Code Search | sc | https://github.com/koalaman/shellcheck/wiki/SC%s | Look up ShellCheck code. (sc<tab><number>) | | ShellCheck Code Search | sc | https://github.com/koalaman/shellcheck/wiki/SC%s | Look up ShellCheck code. (sc<tab><number>) |

View File

@ -1,5 +1,4 @@
--- ---
title: Projects title: Projects
draft: false draft: true
hide: true
--- ---

View File

@ -1,5 +0,0 @@
---
title: Stream
draft: false
hide: false
---

View File

@ -1,57 +0,0 @@
---
title: "Stream Ideas"
description: "Ideas for stream content"
author: "Thurstylark"
date: 2021-11-21
draft: false
hide: false
---
## Continual
- Lurk in chatrooms
- libera.chat
- #archlinux
- ##linux
- Matrix
- #archlinux:archlinux.org
- [Troll the forums](https://bbs.archlinux.org/)
- [Unanswered posts](https://bbs.archlinux.org/search.php?action=show_unanswered)
- Argue on reddit
- [/r/archlinux](https://reddit.com/r/archlinux)
- [Keep AUR packages updated](https://aur.archlinux.org/)
- Find more to adopt (suggestions welcome!)
## Projects
- Teach myself Ansible
- https://www.ansible.com/resources/get-started
- Easy learner targets:
- tlwiki
- weechat+tmux setup
- aurutils repo
- archinstall remote profile
- Create OBS remote webapp
- Teach myself Websockets
- To replace StreamControl app
- Tweak wiki theme
- Change ul bullet characters
- Also figure out why YNH hosting mangles current ul characters?
- Headings
- larger text size based on H level
- more spacing between previous block and header
- Larger content container
- #page grid?
- Colors
- #0088cc Blue highlight
- #333333 Dark Grey
- #cccccc Max white (text?)
- mostly light text on greys with #08c highlights
- Tweak vim config
- tab stop
- use spaces
- clean the fuck up

View File

@ -1,5 +0,0 @@
---
title: Videos
draft: false
hide: false
---

View File

@ -38,24 +38,24 @@ Guess what: When a human with little life experience and a newly-discovered pers
We *all* learn via experience during puberty, and your parents are no exception. We *all* learn via experience during puberty, and your parents are no exception.
### 2. On Labels and Questioning === 2. On Labels and Questioning ===
*A label is not a template for behavior. It's a tool used to communicate your particular brand of awesome to others.* You are you, pick a label that fits. (or don't, whatever) -A label is not a template for behavior. It's a tool used to communicate you particular brand of awesome to others.* You are you, pick a label that fits. (or don't, whatever)
This isn't to say that labels are unimportant, though. At the very least labels provide a useful shorthand for things that are complicated or abstract (see: bisexuality vs pansexuality), so there's definitely an argument for their practicality. The point is that *your you-ness* should inform your label choice, and not the other way around. This isn't to say that labels are unimportant, though. At the very least labels provide a useful shorthand for things that are complicated or abstract (see: bisexuality vs pansexuality), so there's definitely an argument for their practicality. The point is that *your you-ness* should inform your label choice, and not the other way around.
This is why I think identifying as questioning is so cool. You can't get any more honest than openly admitting that you don't know shit and are still figuring it out :D This is why I think identifying as questioning is so cool. You can't get any more honest than openly admitting that you don't know shit and are still figuring it out :D
Alright, out of my soliloquy, and back to your thing :P Alright, out of my soliloquy, and back to your thing :P
### Communicating Your Truth ### Communicating Your Truth
Is it a possibility to come out although I am not sure of my labels yet? Is it a possibility to come out although I am not sure of my labels yet?
As each person on earth is wholely unique, I would argue that there's currently around 7 billion different possible sexualities out there. Who you are, who you like, and the reasoning/motivation for any of these things are fully unique to you alone, which means that you happen to be *literally the only human on the face of the planet* with enough information to determine what label fits you best. As each person on earth is wholely unique, I would argue that there's currently around 7 billion different possible sexualities out there. Who you are, who you like, and the reasoning/motivation for any of these things are fully unique to you alone, which means that you happen to be *literally the only human on the face of the planet* with enough information to determine what label fits you best.
This goes both ways, too. You are the only one who can determine which labels *do* fit, but the same goes for labels that *don't* fit. If heterosexuality no longer fits you, that conclusion is equally entirely valid. This goes both ways, too. You are the only one who can determine which labels *do* fit, but the same goes for labels that *don't* fit. If heterosexuality no longer fits you, that conclusion is equally entirely valid.
On that same coin, choosing to use no labels is just as valid, and so is picking a label but choosing to keep it private. On that same coin, choosing to use no labels is just as valid, and so is picking a label but choosing to keep it private.
should I wait until I stopped questioning? should I wait until I stopped questioning?

View File

@ -14,6 +14,6 @@ End of story. Full stop. Thanks for playing!
Yes, really. Yes, really.
*You* are the only one who can define your sexuality. Sometimes people just know, sometimes they have to try things out before they are sure. Both are valid methods, and their results are genuine. Just because you experimented doesn't make the results any less valid. It doesn't matter if you kissed someone, or slept with someone and enjoyed it. If you say you're straight, then you're straight. -You* are the only one who can define your sexuality. Sometimes people just know, sometimes they have to try things out before they are sure. Both are valid methods, and their results are genuine. Just because you experimented doesn't make the results any less valid. It doesn't matter if you kissed someone, or slept with someone and enjoyed it. If you say you're straight, then you're straight.
Labels aren't a template for behavior. Labels are a tool used to communicate your specific flavor of awesome to others. Likewise, behavior doesn't define your labels either. You do. Labels aren't a template for behavior. Labels are a tool used to communicate your specific flavor of awesome to others. Likewise, behavior doesn't define your labels either. You do.

View File

@ -1,34 +0,0 @@
---
title: "Origin of Thursdaylark"
description: "When thurstylark isn't thurstylark on libera.chat"
author: "Thurstylark"
date: 2023-7-20
draft: false
---
## Huh?
Yeah, well... It's kind of insular, so bear with me...
Years before the implosion of freenode.net, I spent a lot of time in #archlinux. First to get support as I explored the distro, then to also give support as my own experience grew. Many builds were riced, and all was good.
I was generally more active during work hours, as I had found myself on a small dev team, and used Arch for my work machine. From my employer's perspective, this was fine as long as I continued to be interoperable with the rest of my team which were running Debian. To them, it was free as in beer, and I took it upon myself to give back to the community by donating some of my time on the clock to supporting others who used tools that I used for my job (which included Debian along with other projects). Whether I had permission to do so is another conversation entirely ;)
During this time, #archlinux had an activity tracker running, which was fun to glance at every once in a while. It kept stats on things like which words or phrases were most commonly used by which user, and stuff like that. For instance, one could craft a query that would tell them how often the wiki was linked, which, unsurprisingly, was *extremely* often.
One day, someone (I believe it was teraflops) noticed that my stats were somewhat anomalous: I had been consistantly writing the most lines on Thursdays. They immediately then dubbed me as "thursdaylark", and I found this amusing enough to let it stick around.
So, ever since then, I have had weechat set up to automatically change my nick to thursdaylark at midnight on Thursday local time, and then change it back to thurstylark the following midnight. Thus my stats were wrecked, but the legacy stayed around.
For some reason, I still find myself interacting with #archlinux the most on thursdays, and I'm not entirely sure why. Several things about my life, employment, and even sleep patterns have changed dramatically since then, but for some reason, I happen to be more active as thursdaylark instead of as thurstylark.
## Okay... But that was on Freenode...
Sure, but then Freenode was taken over by some trust fund kiddie who summarily shit all over the only thing that made Freenode worthwhile in the first place: the users and the communities they curated for decades prior. The support staff either were ousted or left of their own accord to form a new network from its ashes: libera.chat.
Everyone basically moved directly over, and I was no different. All my configs stayed the same, and just pointed to libera.chat instead.
## But, why?
Meh, I still find it funny

View File

@ -1,34 +0,0 @@
---
title: "Patches Welcome"
description: "Perfection is an asymptotic, but collective goal."
draft: false
---
If I ever claimed to be flawless, slap me with a fish.
----
"Patches Welcome" is a common phrase in the FOSS (Free and Open Sourse Software) community, and it exemplifies my approach to every project that I publish under my name.
# What does it mean?
**"Patches Welcome" is an explicit invitation to help me improve the things that I do.**
A 'patch' traditionally refers to a description of a fix or modification that can be made to a project. For software, this could mean bug fixes, feature additions, tooling changes, or even a major overhaul to the project structure.
In this context, I'm referring not only to my software projects, but (almost) any aspect of any project that I put out for consumption, including streams, videos, websites, and even my own methodologies.
## What does it *not* mean?
**This is *not* an open invitation to harass, troll, or otherwise cause unwelcome disruption to any community space.**
If you have a problem with me, take it up with me. *I will take good-faith criticism under consideration, but I always reserve the right to ignore your bullshit.*
# How to contribute
The best way to get in touch about any specific change will most likely depend on the medium of the content that should be changed. If I left a link to this page, I will usually also leave the preferred contact method nearby, so check there first.
For software projects, my first choice is to use the Issues or Pull Requests feature of the applicable git forge (Github, Gitlab, Gitea, etc). Otherwise, you may email patches, or discus via any other method listed on the [Contact Info](/about/contact/) page. I will usually prefer a publicly-readable medium in most cases.
For anything not covered here, or if you're unsure, feel free to use any method listed on the [Contact Info](/about/contact/) page. If another method is more appropriate, I will be happy to redirect as need be.

View File

@ -1,6 +0,0 @@
---
title: "Thurstylark.com"
date: 2021-10-05T22:00:36-05:00
draft: true
---

View File

@ -1,7 +0,0 @@
---
title: "Gitea"
description: "An upgrade from cgit, but easier to host than GitLab"
date: 2021-10-05T22:05:14-05:00
draft: true
---

View File

@ -1,7 +0,0 @@
---
title: "Matrix Homeserver"
description: "Vive la décentralisation!"
date: 2021-10-05T22:07:45-05:00
draft: true
---

View File

@ -1,7 +0,0 @@
---
title: "Thurstylark Wiki"
description: "A Hugo static site with simple hosting"
date: 2021-10-05T22:02:12-05:00
draft: true
---

13
deploy Executable file
View File

@ -0,0 +1,13 @@
#!/usr/bin/env bash
# To auto-deploy this on git push, add a symlink at .git/hooks/pre-push that points to this script
# Example: ln -s ../../deploy .git/hooks/pre-push
# Get the dir of the running script
SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
# Pull variables in from deploy_id
source "$SCRIPT_DIR/deploy_id"
# Generate and push the output to the server
hugo && rsync -avz --delete public/ ${USER}@${HOST}:${DIR}

View File

@ -0,0 +1,4 @@
{{ define "main" }}
{{ partial "title_and_desc.html" . }}
{{ partial "postlist.html" . }}
{{ end }}

View File

@ -0,0 +1,10 @@
{{ define "main" }}
<header class="content__header">
<h1>{{ .Title | markdownify }}</h1>
</header>
<div class="content__body">
{{ .Content }}
</div>
<footer class="content__footer"></footer>
{{ end }}

5
layouts/index.html Normal file
View File

@ -0,0 +1,5 @@
{{ define "main" }}
{{ partial "title_and_desc.html" . }}
{{ partial "postlist.html" . }}
{{ end }}

View File

@ -0,0 +1,9 @@
{{define "aside" }}
{{ if .Params.description }}<p>{{ .Params.description }}</p>{{ end }}
{{ if or (.Params.author) (.Params.date) }}
<p>
{{ if .Params.author }}By {{ .Params.author }}{{ if .Date }}, {{ end }}{{ end }}
{{ if .Date }}{{ .Date.Format "2006-01-02" }}{{ end }}
</p>
{{ end }}
{{ end }}

View File

@ -0,0 +1 @@
<p class="copyright">{{ .Site.Copyright }}</p>

View File

@ -0,0 +1,11 @@
{{ range .Pages }}
<article class="post">
<header class="post__header">
<h2><a href="{{ .Permalink }}">{{ .Title | markdownify }}</a></h2>
</header>
<section class="post__summary">
{{ .Description }}
</section>
</article>
{{ end }}

View File

@ -0,0 +1,11 @@
{{ range .Sections }}
<article class="post">
<header class="post__header">
<h2><a href="{{ .Permalink }}">{{ .Title | markdownify }}</a></h2>
</header>
<section class="post__summary">
{{ .Description }}
</section>
</article>
{{ end }}

View File

@ -0,0 +1,4 @@
<header class="content__header">
<h1>{{ .Title | markdownify }}</h1>
{{ .Content }}
</header>

View File

@ -0,0 +1,4 @@
<header class="content__header">
<h1>{{ .Title | markdownify }}</h1>
{{ .Description }}
</header>

@ -1 +0,0 @@
Subproject commit 4ded705cb4165055ea41db637cc61ac134723d39

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 MiB

Binary file not shown.

View File

@ -0,0 +1,29 @@
###############################################################################################
##############################################################################################
#############################################################################################
##### ####### #####
##### ####### ####### #####
##### ####### ####### #####
####### #######
####### #######
####### #######
####### #######
####### #######
####### #######
####### #######
####### #######
####### #######
####### #######
####### #######
####### #######
####### #######
####### #######
####### #######
####### #######
####### #######
####### #######
####### ####### #####
####### ####### #####
####### ####################################################
####### #####################################################
####### ######################################################

View File

@ -0,0 +1,15 @@
##################################################
#################################################
## #### ##
## #### #### ##
#### ####
#### ####
#### ####
#### ####
#### ####
#### ####
#### ####
#### ####
#### #### ##
#### ########################
#### #########################

View File

@ -0,0 +1,6 @@
######################
# ## ## #
## ##
## ##
## ## #
## ##########

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 641 KiB

1
themes/risotto Submodule

@ -0,0 +1 @@
Subproject commit 07f1b3ecfd4202a69847d47c89ece4e4d01278c4

@ -1 +0,0 @@
Subproject commit ca98192cfb0cf98df0c860201b4f1c23dfa8868b

97
tlwiki
View File

@ -1,97 +0,0 @@
#!/usr/bin/env python3
import argparse
import yaml
import subprocess
import sys
# Valid commands
modecmds = [
'init',
'deploy',
'updeps',
'clean',
'reset',
'nukepave']
# Argument parsing setup
parser = argparse.ArgumentParser(description='Manage tlwiki source.')
parser.add_argument('mode', choices=modecmds,
help='Operation mode for this script')
parser.add_argument('--config', '-c',
default='tlwiki-conf.yaml',
type=argparse.FileType('r'),
help='Configuration file')
if sys.argv[0] == '.git/hooks/pre-push':
args = parser.parse_args(['deploy'])
else:
args = parser.parse_args()
# load config yaml into config dict
config = yaml.safe_load(args.config)
# General use functions
def cmd_run(*cmdstr):
try:
subprocess.run(cmdstr, check=True)
except subprocess.CalledProcessError:
print('E: Running `' + ' '.join(cmdstr) + '` failed')
exit
# Mode functions
def mode_clean(cfg):
cmd_run('git', 'clean', '-fd')
def mode_reset(cfg):
cmd_run('git', 'reset', '--hard',
cfg['repo']['remoteName'] + '/' + cfg['repo']['branch'])
def mode_init(cfg):
subprocess.run(['hugo', 'new', 'site', '.', '--force'])
def mode_updeps(cfg):
cmd_run('git', 'pull')
cmd_run('git', 'submodule', 'update', '--init', '--recursive')
def mode_deploy(cfg):
cmd_run('hugo')
deployid = cfg['deployID']
cmd_run('rsync', '-avz', '--delete',
'public/',
deployid['user'] + '@' + deployid['host'] + ':' + deployid['dir'])
# Mode switching
if args.mode == 'init':
mode_init(config)
elif args.mode == 'deploy':
mode_init(config)
mode_deploy(config)
elif args.mode == 'updeps':
mode_updeps(config)
elif args.mode == 'clean':
mode_clean(config)
elif args.mode == 'reset':
mode_reset(config)
elif args.mode == 'nukepave':
mode_reset(config)
mode_clean(config)
mode_updeps(config)
mode_init(config)
else:
raise Exception("Invalid mode: " + args.mode)
exit

View File

@ -1,8 +0,0 @@
repo:
URL: user@host.tld:org/repo.git
branch: master
remoteName: origin
deployID:
user: username
host: host.tld
dir: /srv/www/wiki/