When editing weeknotes with the website script, create the page from the Hugo archetype and process it
This implements what the Makefile did, but with a more intuitive interface. Remove the weeknotes target from the Makefile.
This commit is contained in:
parent
8ec88e6c80
commit
b9796ab096
4 changed files with 71 additions and 22 deletions
18
scripts/erynwells_me/commands.py
Normal file
18
scripts/erynwells_me/commands.py
Normal file
|
@ -0,0 +1,18 @@
|
|||
#!/usr/bin/env python3.12
|
||||
# Eryn Wells <eryn@erynwells.me>
|
||||
|
||||
import os
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
|
||||
def edit_file(path, editor=None):
|
||||
editor = editor or os.environ.get('VISUAL') or os.environ.get('EDITOR') or 'vi'
|
||||
subprocess.run(
|
||||
f'{editor} "{path}"',
|
||||
stdin=sys.stdin,
|
||||
stdout=sys.stdout,
|
||||
stderr=sys.stderr,
|
||||
env=os.environ,
|
||||
shell=True,
|
||||
)
|
Loading…
Add table
Add a link
Reference in a new issue