aboutsummaryrefslogtreecommitdiff
path: root/build.py
diff options
context:
space:
mode:
authorMelody Horn <melody@boringcactus.com>2021-01-21 20:15:23 -0700
committerMelody Horn <melody@boringcactus.com>2021-01-21 20:15:23 -0700
commit8dd7786d99976f3ae6bed9873a7a7759d59f0912 (patch)
tree14694cb6eaca6650e1283b0d4e7aee05f54990d7 /build.py
parentc99de3f10830e488fb6bee84ef1e69a9fddb6579 (diff)
downloadcactus-ssg-8dd7786d99976f3ae6bed9873a7a7759d59f0912.tar.gz
cactus-ssg-8dd7786d99976f3ae6bed9873a7a7759d59f0912.zip
only strip quotes if they match
Diffstat (limited to 'build.py')
-rw-r--r--build.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/build.py b/build.py
index 1c117bd..e3d0387 100644
--- a/build.py
+++ b/build.py
@@ -99,7 +99,10 @@ def render(site_dir, page: Page):
def parse_front_matter(front_matter: str):
lines = front_matter.split('\n')
fields = [line.split(': ', 1) for line in lines if len(line.strip()) > 0]
- return dict((key, value.strip('"')) for key, value in fields)
+ for i in range(len(fields)):
+ if fields[i][1].startswith('"') and fields[i][1].endswith('"'):
+ fields[i][1] = fields[i][1][1:-1]
+ return dict((key, value) for key, value in fields)
def get_excerpt(body: str):