Added icons to indicate available notes types.

This commit is contained in:
Benjamin A. Shelton 2026-08-07 14:40:12 -06:00
commit 0087584b65
Signed by: zancarius
GPG key ID: 8BD42DBD6C337E01
2 changed files with 23 additions and 0 deletions

View file

@ -7,6 +7,8 @@ import { titleCase } from '../utils/strings';
import { type CollectionEntry } from 'astro:content';
import { Icon } from 'astro-icon/components';
const scriptureStyles: {[index: string]:string} = {
gospels: 'gospels',
pentateuch: 'pentateuch',
@ -24,6 +26,16 @@ const getScriptureStyle = (cat: any): string => {
}
return 'gospels';
};
const postMetaIcons: {[index :string]:{[index: string]:string}} = {
"long-form": {
"src": "justify-left",
"alt": "Long-form Notes",
},
"abbreviated": {
"src": "list-ul",
"alt": "Abbreviated Notes",
}
};
const base = import.meta.env.BASE_URL;
const { notes } = Astro.props;
@ -35,10 +47,17 @@ const { notes } = Astro.props;
<div class="header-image">
<img src={urlfrag(base, note.data.post_image)} class="rounded-md" />
</div>
<div class="flex">
<ul class="tags relative">
{note.data.tags?.filter((tag: string) => (tag != 'notes')).map((tag: string) => (
<li class:list={[getScriptureStyle(note.data.scripture_category)]}>{titleCase(tag)}</li>
))}</ul>
<ul class="tags types relative">
{note.data.types?.map((tp: string) => (
<li><Icon name={postMetaIcons[tp].src} title={postMetaIcons[tp].alt} desc={postMetaIcons[tp].alt} /></li>
))}
</ul>
</div>
<hgroup>
<h2>
<a href={new URL(`${base}notes/${note.id}/`, Astro.url).pathname}>{note.data.title}</a>