Compare commits
No commits in common. "c924bf184fc06073c247e5bd0a4b82b41c6a4696" and "3f94261fa9819091f999b01aeab8f271fd4436c8" have entirely different histories.
c924bf184f
...
3f94261fa9
1
.gitignore
vendored
1
.gitignore
vendored
@ -4,4 +4,3 @@ resources/
|
|||||||
hugo_build.lock
|
hugo_build.lock
|
||||||
.DS_Store
|
.DS_Store
|
||||||
.vercel
|
.vercel
|
||||||
gemini/capsule/log
|
|
@ -13,13 +13,4 @@ pipeline:
|
|||||||
- apk add s3cmd curl
|
- apk add s3cmd curl
|
||||||
- s3cmd --configure --access_key=$S3_ACCESS_KEY --secret_key=$S3_SECRET_ACCESS_KEY --host=https://eu-central-1.linodeobjects.com --host-bucket="%(bucket)s.eu-central-1.linodeobjects.com" --dump-config > /root/.s3cfg
|
- s3cmd --configure --access_key=$S3_ACCESS_KEY --secret_key=$S3_SECRET_ACCESS_KEY --host=https://eu-central-1.linodeobjects.com --host-bucket="%(bucket)s.eu-central-1.linodeobjects.com" --dump-config > /root/.s3cfg
|
||||||
- s3cmd -c /root/.s3cfg sync public/* s3://wilw.dev
|
- s3cmd -c /root/.s3cfg sync public/* s3://wilw.dev
|
||||||
- 'curl -X POST -H "AccessKey: $BUNNY_KEY" https://api.bunny.net/pullzone/907104/purgeCache'
|
- 'curl -X POST -H "AccessKey: $BUNNY_KEY" https://api.bunny.net/pullzone/907104/purgeCache'
|
||||||
deploy_gemini:
|
|
||||||
image: python:3.10
|
|
||||||
secrets: [ CAPSULE_TOWN_KEY ]
|
|
||||||
commands:
|
|
||||||
- cd gemini
|
|
||||||
- pip install python-frontmatter
|
|
||||||
- python process_capsule.py
|
|
||||||
- 'curl -X PUT -H "Content-Type: application/json" -H "api-key: $CAPSULE_TOWN_KEY" -d "{\"capsuleArchive\": \"$(tar -czf /tmp/c.tar.gz -C capsule . && cat /tmp/c.tar.gz | base64)\"}" https://api.capsule.town/capsule'
|
|
||||||
|
|
@ -1,29 +0,0 @@
|
|||||||
▄ ▄ ▄▄▄ ▄▄▄ ▄ ▄
|
|
||||||
█ █ ▄ █ █ █ █ █ █ ▄ █ █
|
|
||||||
█ ██ ██ █ █ █ █ ██ ██ █
|
|
||||||
█ █ █ █ █ █
|
|
||||||
█ █ █ █▄▄▄█ █
|
|
||||||
█ ▄ █ █ █ ▄ █
|
|
||||||
█▄▄█ █▄▄█▄▄▄█▄▄▄▄▄▄▄█▄▄█ █▄▄█
|
|
||||||
|
|
||||||
# 👋 Welcome to my Gemini capsule!
|
|
||||||
|
|
||||||
Hi, I'm Will. I'm a tech lead and enthusiast based in Wales, in the UK.
|
|
||||||
|
|
||||||
This capsule contains my gemlog, and I will be adding more to this over time.
|
|
||||||
|
|
||||||
=> gemini://wilw.capsule.town/log Gemlog
|
|
||||||
|
|
||||||
# 💁♂️ About this capsule
|
|
||||||
|
|
||||||
This capsule is hosted on Capsule Town. The gemlog is automatically generated from my weblog.
|
|
||||||
|
|
||||||
=> gemini://capsule.town Find out more about Capsule Town
|
|
||||||
|
|
||||||
# 🪧 Contact me
|
|
||||||
|
|
||||||
=> https://fosstodon.org/@wilw Mastodon
|
|
||||||
=> https://pixelfed.social/@wilw Pixelfed
|
|
||||||
=> https://t.me/wilw88 Telegram
|
|
||||||
|
|
||||||
=> https://wilw.dev View my website
|
|
@ -1,45 +0,0 @@
|
|||||||
import os
|
|
||||||
import frontmatter
|
|
||||||
|
|
||||||
# Create new directories
|
|
||||||
needed_directories = ['capsule/log']
|
|
||||||
for dir in needed_directories:
|
|
||||||
if not os.path.exists(dir):
|
|
||||||
os.makedirs(dir)
|
|
||||||
|
|
||||||
# Process blog posts
|
|
||||||
logs = []
|
|
||||||
for file in os.listdir('../content/blog'):
|
|
||||||
if not file.startswith('_'):
|
|
||||||
post = frontmatter.load(f'../content/blog/{file}')
|
|
||||||
print(post['title'])
|
|
||||||
new_content = '''
|
|
||||||
=> gemini://wilw.capsule.town 🏡 Home
|
|
||||||
=> gemini://wilw.capsule.town/log Back to gemlog
|
|
||||||
|
|
||||||
# {}
|
|
||||||
|
|
||||||
{}
|
|
||||||
|
|
||||||
=> mailto:blog@wilw.dev Reply via email
|
|
||||||
=> gemini://wilw.capsule.town/log Back to gemlog
|
|
||||||
'''.format(post['title'], post.content)
|
|
||||||
new_file_name = file.split('.')[0] + '.gmi'
|
|
||||||
logs.append({'file': new_file_name, 'title': post['title']})
|
|
||||||
gem_file = open(f'capsule/log/{new_file_name}', 'w')
|
|
||||||
gem_file.write(new_content)
|
|
||||||
|
|
||||||
logs.sort(key = lambda entry: entry['file'], reverse = True)
|
|
||||||
log_index_content = '''
|
|
||||||
=> gemini://wilw.capsule.town 🏡 Home
|
|
||||||
|
|
||||||
# Gemlog
|
|
||||||
|
|
||||||
{}
|
|
||||||
'''.format(
|
|
||||||
'\n'.join(['=> {} {}'.format(l['file'], l['title']) for l in logs])
|
|
||||||
)
|
|
||||||
|
|
||||||
gem_index_file = open(f'capsule/log/index.gmi', 'w')
|
|
||||||
gem_index_file.write(log_index_content)
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user