diff --git a/src/components/ArrowSelectorTags.svelte b/src/components/ArrowSelectorTags.svelte new file mode 100644 index 0000000000..33b00a0684 --- /dev/null +++ b/src/components/ArrowSelectorTags.svelte @@ -0,0 +1,69 @@ + + +
+ {#if tags.length > prefLimitValue} + + {#each visibleTags as tag, i} +
/
+ + {tag.trim()} + + {/each} + + {:else} + {#each tags as tag, i} +
/
+ + {tag.trim()} + + {/each} + {/if} +
+ + diff --git a/src/components/PostMeta.astro b/src/components/PostMeta.astro index 488e85eb2a..1a9d755f12 100644 --- a/src/components/PostMeta.astro +++ b/src/components/PostMeta.astro @@ -3,7 +3,8 @@ import { Icon } from "astro-icon/components"; import I18nKey from "../i18n/i18nKey"; import { i18n } from "../i18n/translation"; import { formatDateToYYYYMMDD } from "../utils/date-utils"; -import { getCategoryUrl, getTagUrl } from "../utils/url-utils"; +import { getCategoryUrl } from "../utils/url-utils"; +import ArrowSelectorTags from "./ArrowSelectorTags.svelte"; interface Props { class: string; @@ -68,15 +69,7 @@ const className = Astro.props.class;
- {(tags && tags.length > 0) && tags.map((tag, i) => ( -
/
- - {tag.trim()} - - ))} - {!(tags && tags.length > 0) &&
{i18n(I18nKey.noTags)}
} +
- \ No newline at end of file +