| | |
| | | import { pathToRoot, slugTag } from "../util/path" |
| | | import { FullSlug, resolveRelative } from "../util/path" |
| | | import { QuartzComponent, QuartzComponentConstructor, QuartzComponentProps } from "./types" |
| | | import { classNames } from "../util/lang" |
| | | |
| | | const TagList: QuartzComponent = ({ fileData, displayClass }: QuartzComponentProps) => { |
| | | const tags = fileData.frontmatter?.tags |
| | | const baseDir = pathToRoot(fileData.slug!) |
| | | if (tags && tags.length > 0) { |
| | | return ( |
| | | <ul class={classNames(displayClass, "tags")}> |
| | | {tags.map((tag) => { |
| | | const linkDest = baseDir + `/tags/${slugTag(tag)}` |
| | | const linkDest = resolveRelative(fileData.slug!, `tags/${tag}` as FullSlug) |
| | | return ( |
| | | <li> |
| | | <a href={linkDest} class="internal tag-link"> |