diff options
author | lonkaars <l.leblansch@gmail.com> | 2021-03-29 10:29:56 +0200 |
---|---|---|
committer | lonkaars <l.leblansch@gmail.com> | 2021-03-29 10:29:56 +0200 |
commit | 7f1dbd0eb19519c36bc3b5d3197a592ff5cd6f10 (patch) | |
tree | c7cb5c0c427d499d44fd986c408745cadce71fc5 /pages/post | |
parent | 3c418d9229bf4023816fae82e5524ae902c0e982 (diff) |
added tag parsing
Diffstat (limited to 'pages/post')
-rw-r--r-- | pages/post/[id].tsx | 2 |
1 files changed, 2 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(), } |