gemini.git

going-flying.com gemini git repository

summary

tree

log

refs

60dceeb416056ccc10a9284a1f3bc1e061196df2 - Matthew Ernisse - 1597543874

update how-built, document stuff, ignore pycache

view tree

view raw

diff --git a/.gitignore b/.gitignore
index d2082c5..ccbea20 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,4 @@
 .DS_Store
+*/__pycache__/
 users/mernisse/atom.xml
 users/mernisse/*.gmi
diff --git a/build/build.py b/build/build.py
index bdb062d..f995203 100755
--- a/build/build.py
+++ b/build/build.py
@@ -13,6 +13,11 @@ URLBASE = 'gemini://going-flying.com/~mernisse/'
 
 
 class GlogMetaReader(object):
+	''' Parse the metadata from the top of a post file.
+	Reads from a leading --- until a blank line.  It expects key: value
+	and normalizes the key to all lower case.  This also creates a
+	link item for the post with a full URI to the expected output.
+	'''
 	meta_re = re.compile(
 		r'^[ ]{0,3}(?P<key>[A-Za-z0-9_-]+):\s*(?P<value>.*)'
 	)
@@ -41,6 +46,11 @@ class GlogMetaReader(object):
 			self.content += line + '\n'
 
 	def parseMeta(self, line):
+		''' Extract the metadata from an input line.  Handles
+		specially parsing a date key into a datetime instance.
+		Note: currently defaults to assuming the US/Eastern
+		timezone.  I should potentially make that configurable.
+		'''
 		if line.strip() == '':
 			self._found = False
 			return
@@ -71,7 +81,9 @@ class GlogMetaReader(object):
 
 
 class GeminiFeed(object):
-	''' Wrapper for FeedGenerator that contains defaults and whatnot.'''
+	''' Wrapper for FeedGenerator that contains way too many hardcoded
+	defaults.
+	'''
 	def __init__(self):
 		self.feed = FeedGenerator()
 		self.feed.id('gemini://going-flying.com/~mernisse/')
diff --git a/files/deploy b/files/deploy
index 3d62e3b..487d4ed 100644
--- a/files/deploy
+++ b/files/deploy
@@ -67,6 +67,8 @@ fi
 echo "updating $BUILD_DIR"
 GIT_WORK_TREE=$BUILD_DIR git checkout -f
 
+$BUILD_DIR/build/build.py "$BUILD_DIR/users/mernisse/"
+
 echo "setting rev to $REV"
 sed -e "s/GIT_REV/${REV}/" "$BUILD_DIR/how-built.gmi" > \
 	"$BUILD_DIR/how-built.gmi.new"
diff --git a/how-built.gmi b/how-built.gmi
index f6e7b6a..45f29fc 100644
--- a/how-built.gmi
+++ b/how-built.gmi
@@ -17,5 +17,34 @@ In the future I plan on building something resembling a blog here as well.  I th
 
 If any of this was interesting or you have any questions about this whole thing feel free to drop me a line at matt@going-flying.com
 
+## Update 15/August/2020
+
+I launched the gemlog the day after I wrote this, and wrote a little bit about it in passing but nothing super specific.  I eventually want to be able to provide access to the git repository behind this whole thing via gemini, but it is a bit tricky given that this is running in a container.  Anyway, you may notice that the deploy hook now runs build.py.  That walks the articles sub directory of whatever path it is given and renders out the proper index and item Gemini markup files as well as generating the atom feed of all of the posts.  Like my web site it regenerates all content idempotently so it can be run over and over again on top of itself without worrying.  Unlike my web site it is extremely simple, weighing in at around 200 lines (including comments and license information) versus the web version's 2000 lines.  The difference is in no small thanks to how much simpler Gemini is to what even a fairly simple web site is expected to be these days.
+
+```
+kitsune@22:06:13 going-flying.com >wc -l build.py build/*.py build/mdx/*.py build/renderers/*.py
+      41 build.py
+     155 build/__init__.py
+     422 build/blog.py
+      67 build/buildconfig.py
+      51 build/mdx/__init__.py
+      88 build/mdx/canonicallinks.py
+      77 build/mdx/manpage.py
+      84 build/mdx/md_emoji.py
+     181 build/mdx/md_imgset.py
+     122 build/mdx/md_summarizer.py
+     291 build/mdx/md_video.py
+     241 build/mdx/md_waybackify.py
+      79 build/mdx/ogimage.py
+      11 build/renderers/__init__.py
+      87 build/renderers/blogindexpage.py
+      88 build/renderers/blogpostpage.py
+     161 build/renderers/page.py
+      61 build/renderers/sitemap.py
+    2307 total
+
+kitsune@22:07:27 going-flying.com >wc -l ../gemini/build/build.py
+     227 ../gemini/build/build.py
+```
 
 Built from GIT_REV