mirror of https://github.com/garritfra/garrit.xyz
Garrit Franke
2 years ago
6 changed files with 81 additions and 7 deletions
@ -0,0 +1,19 @@ |
|||||||
|
import React from "react"; |
||||||
|
|
||||||
|
export default () => ( |
||||||
|
<svg |
||||||
|
class="page__tag-icon" |
||||||
|
xmlns="http://www.w3.org/2000/svg" |
||||||
|
width="16" |
||||||
|
height="16" |
||||||
|
viewBox="0 0 24 24" |
||||||
|
fill="none" |
||||||
|
stroke="currentColor" |
||||||
|
stroke-width="2" |
||||||
|
stroke-linecap="round" |
||||||
|
stroke-linejoin="round" |
||||||
|
> |
||||||
|
<path d="M20.59 13.41l-7.17 7.17a2 2 0 0 1-2.83 0L2 12V2h10l8.59 8.59a2 2 0 0 1 0 2.82z"></path> |
||||||
|
<line x1="7" y1="7" x2="7" y2="7"></line> |
||||||
|
</svg> |
||||||
|
); |
@ -0,0 +1,13 @@ |
|||||||
|
export const parseTags = (strings) => { |
||||||
|
const postTags = keys |
||||||
|
.map((key, index) => { |
||||||
|
const value = values[index]; |
||||||
|
// Parse yaml metadata & markdownbody in document
|
||||||
|
|
||||||
|
const document = matter(value.default); |
||||||
|
const rawTags = document.data?.tags || ""; |
||||||
|
return rawTags.split(",").map((tag) => tag.trim()); |
||||||
|
}) |
||||||
|
.flat() |
||||||
|
.filter((value) => value !== ""); |
||||||
|
}; |
@ -1,4 +1,5 @@ |
|||||||
@import "colors"; |
@import "colors"; |
||||||
@import "fonts"; |
@import "fonts"; |
||||||
@import "typography"; |
@import "typography"; |
||||||
|
@import "utility"; |
||||||
@import "base"; |
@import "base"; |
||||||
|
Loading…
Reference in new issue