summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBlaise Thompson <blaise@untzag.com>2021-01-23 17:55:19 -0600
committerBlaise Thompson <blaise@untzag.com>2021-01-23 17:55:19 -0600
commit910c22d071e0f2c0748f172b7318147e8a45201f (patch)
tree3e2b0715842c81f5221a9883da501b240d95bf2d
parent64113bee2f3d5964bbeabfce09324d11f4d3c255 (diff)
tags
-rwxr-xr-xbuild.py20
-rw-r--r--posts/bluesky-for-the-rest-of-us.md2
-rw-r--r--posts/daq.md1
-rw-r--r--posts/gui.md1
-rw-r--r--posts/meta.md1
-rw-r--r--posts/open-hardware.md1
-rw-r--r--posts/plotting.md1
-rw-r--r--posts/releasing-pypi-gitlab.md1
-rw-r--r--templates/index.html6
-rw-r--r--templates/tags.html30
10 files changed, 62 insertions, 2 deletions
diff --git a/build.py b/build.py
index 6505dbb..3b53963 100755
--- a/build.py
+++ b/build.py
@@ -28,9 +28,11 @@ class Post:
date: str
content: str
path: str
+ tags: list
posts = []
+tags = []
for post in os.listdir(__here__ / "posts"):
if len(post) < 3:
continue
@@ -43,10 +45,15 @@ for post in os.listdir(__here__ / "posts"):
kwargs["date"] = md.Meta["date"][0]
kwargs["content"] = content
kwargs["path"] = post[:-3]
+ kwargs["tags"] = md.Meta.get("tags", [""])[0].split()
+ tags += kwargs["tags"]
posts.append(Post(**kwargs))
posts.sort(key=lambda p: p.date, reverse=True)
+tags = list(set(tags))
+tags.sort()
+
# index -------------------------------------------------------------------------------------------
@@ -75,6 +82,19 @@ for post in posts:
f.write(template.render(post=post, title=post.title, date=date))
+# tags --------------------------------------------------------------------------------------------
+
+
+
+template = env.get_template("tags.html")
+if not os.path.isdir(__here__ / "public" / "tags"):
+ os.mkdir(__here__ / "public" / "tags")
+with open(__here__ / "public" / "tags" / "index.html", "w") as f:
+ f.write(template.render(posts=posts, tags=tags, title="tags", date=date))
+
+
+
+
# css ---------------------------------------------------------------------------------------------
diff --git a/posts/bluesky-for-the-rest-of-us.md b/posts/bluesky-for-the-rest-of-us.md
index 02d347a..8a666ab 100644
--- a/posts/bluesky-for-the-rest-of-us.md
+++ b/posts/bluesky-for-the-rest-of-us.md
@@ -1,6 +1,8 @@
title: bluesky-for-the-rest-of-us
date: 2020-11-06
+This is a work-in-progress post.
+
[Bluesky](https://blueskyproject.io/) is an awesome Python package for hardware orchestration.
Really, it's amazing.
It's an abstraction layer allowing scientists to easily define and carry out almost any experiment.
diff --git a/posts/daq.md b/posts/daq.md
index fe05e8c..faa1f31 100644
--- a/posts/daq.md
+++ b/posts/daq.md
@@ -1,5 +1,6 @@
title: data acquisition hardware
date: 2020-04-12
+tags: instrumental
This post is a roundup of data acquisition hardware that I want to keep track of.
This includes both analog-to-digital, digital-to-analog, and multifunction.
diff --git a/posts/gui.md b/posts/gui.md
index 8d08568..e8015bf 100644
--- a/posts/gui.md
+++ b/posts/gui.md
@@ -1,5 +1,6 @@
title: graphical user interface
date: 2020-05-23
+tags: instrumental python
This is a roundup post of links to graphical user interface projects that I find relevant.
diff --git a/posts/meta.md b/posts/meta.md
index 0e5bcb8..65534ca 100644
--- a/posts/meta.md
+++ b/posts/meta.md
@@ -1,5 +1,6 @@
title: meta
date: 2020-04-11
+tags: meta
What is a "blog" to me, and why have I decided to create one?
What technologies enable this blog?
diff --git a/posts/open-hardware.md b/posts/open-hardware.md
index 7fcbc14..0331636 100644
--- a/posts/open-hardware.md
+++ b/posts/open-hardware.md
@@ -1,5 +1,6 @@
title: open hardware
date: 2020-05-23
+tags: instrumental
This post is a roundup of open source hardware projects that I find relevant.
diff --git a/posts/plotting.md b/posts/plotting.md
index 0e5d870..5acdc19 100644
--- a/posts/plotting.md
+++ b/posts/plotting.md
@@ -1,5 +1,6 @@
title: plotting scientific data
date: 2020-05-23
+tags: instrumental python
This post is a roundup of interesting ideas about plotting scientific data.
diff --git a/posts/releasing-pypi-gitlab.md b/posts/releasing-pypi-gitlab.md
index db0cc70..c40372b 100644
--- a/posts/releasing-pypi-gitlab.md
+++ b/posts/releasing-pypi-gitlab.md
@@ -1,5 +1,6 @@
title: releasing: gitlab to pypi
date: 2020-05-17
+tags: python
This post contains my notes for how I release a Python project from GitLab to PyPI.
I love hosting projects on GitLab since I can use the built-in runners to release automatically.
diff --git a/templates/index.html b/templates/index.html
index 7a74e3c..554d418 100644
--- a/templates/index.html
+++ b/templates/index.html
@@ -9,16 +9,18 @@
<p>
Welcome to my personal blog! <br>
This page lists my blog entries in reverse chronological order. <br>
-You may also browse by tag (coming soon). <br>
+You may also <a href="./tags/">browse by tag</a>. <br>
You may be interested in my <a href=./meta/>meta</a> post. <br>
Thanks for stopping by! —Blaise
</p>
-
<p>
{% for post in posts %}
{{ post.date }}
<a href=./{{ post.path }}>{{ post.title }}</a>
+ {% for tag in post.tags %}
+ <a href="./tags/#{{ tag }}" style="color:#b294bb;font-style:italic;">#{{ tag }}</a>
+ {% endfor %}
<br>
{% endfor %}
</p>
diff --git a/templates/tags.html b/templates/tags.html
new file mode 100644
index 0000000..e788ce5
--- /dev/null
+++ b/templates/tags.html
@@ -0,0 +1,30 @@
+{% include "header.html" %}
+
+<h1>
+<a href=http://blaise.zone>blaise</a>-<a href="../">blog</a>/tags
+</h1>
+
+<hr>
+
+{% for tag in tags %}
+
+<h1 id={{ tag }}><a href="#{{ tag }}">{{ tag }}</a></h1>
+
+<p>
+{% for post in posts %}
+ {% if tag in post.tags %}
+ {{ post.date }}
+ <a href=./{{ post.path }}>{{ post.title }}</a>
+ {% for tag_ in post.tags %}
+ {% if tag_ != tag %}
+ <a href="./tags/#{{ tag_ }}" style="color:#b294bb;font-style:italic;">#{{ tag_ }}</a>
+ {% endif %}
+ {% endfor %}
+ <br>
+ {% endif %}
+{% endfor %}
+</p>
+
+{% endfor %}
+
+{% include "footer.html" %}