aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlonkaars <l.leblansch@gmail.com>2021-03-29 10:29:56 +0200
committerlonkaars <l.leblansch@gmail.com>2021-03-29 10:29:56 +0200
commit7f1dbd0eb19519c36bc3b5d3197a592ff5cd6f10 (patch)
treec7cb5c0c427d499d44fd986c408745cadce71fc5
parent3c418d9229bf4023816fae82e5524ae902c0e982 (diff)
added tag parsing
-rw-r--r--pages/post/[id].tsx2
-rw-r--r--posts/index.md1
2 files changed, 3 insertions, 0 deletions
diff --git a/pages/post/[id].tsx b/pages/post/[id].tsx
index f70b21f..4f3050a 100644
--- a/pages/post/[id].tsx
+++ b/pages/post/[id].tsx
@@ -12,6 +12,7 @@ interface ArticleMeta {
title?: string;
subtitle?: string;
author?: string;
+ tags?: Array<string>;
date?: string;
chapters?: Array<chapter>;
}
@@ -48,6 +49,7 @@ var parseTag = {
"title": (val: string) => val,
"subtitle": (val: string) => val,
"author": (val: string) => val,
+ "tags": (val: string) => val.split(",").map(i => i.trim()),
"date": (val: string) => new Date(val).toDateString(),
}
diff --git a/posts/index.md b/posts/index.md
index c1032f8..f61a35c 100644
--- a/posts/index.md
+++ b/posts/index.md
@@ -2,6 +2,7 @@
[meta]: <subtitle> (Loek heeft dit geschreven)
[meta]: <author> (Loek)
[meta]: <date> (March 27 2021)
+[meta]: <tags> (test, debug)
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Gravida dictum fusce ut placerat orci nulla pellentesque. Laoreet id donec ultrices tincidunt arcu. Tortor aliquam nulla facilisi cras fermentum odio eu feugiat. A scelerisque purus semper eget duis at tellus. A iaculis at erat pellentesque adipiscing commodo elit at imperdiet. Arcu bibendum at varius vel pharetra vel turpis nunc eget. Euismod in pellentesque massa placerat duis. Lorem ipsum dolor sit amet consectetur adipiscing elit. Ultrices in iaculis nunc sed augue lacus. Vestibulum mattis ullamcorper velit sed. Adipiscing diam donec adipiscing