#291 - Hierarchy field support

This commit is contained in:
Elio Struyf
2022-06-16 11:41:54 +02:00
parent a0371167bc
commit 09888d5657
4 changed files with 82 additions and 21 deletions
@@ -30,6 +30,13 @@ export const Item: React.FunctionComponent<IItemProps> = ({ fmFilePath, date, ti
}
const tagField = settings.dashboardState.contents.tags;
if (tagField === "tags") {
return pageData.fmTags;
} else if (tagField === "categories") {
return pageData.fmCategories;
}
const tagsValue = pageData[tagField] || [];
if (Array.isArray(tagsValue)) {
@@ -51,7 +51,7 @@ export const TaxonomyLookup: React.FunctionComponent<ITaxonomyLookupProps> = ({
if (taxonomy === "tags" || taxonomy === "categories") {
return (
<button
className={total ? `text-teal-900 hover:text-teal-600` : ``}
className={total ? `text-teal-900 hover:text-teal-600 font-bold` : ``}
title={total ? `Show contents with ${value} in ${taxonomy}` : ``}
onClick={onNavigate}>
{total || `-`}