2026-06-05 14:31:12 -06:00
|
|
|
---
|
|
|
|
|
import '../styles/global.css';
|
|
|
|
|
|
|
|
|
|
import { urlfrag } from '../utils/path';
|
|
|
|
|
import { dateFormat } from '../utils/date';
|
|
|
|
|
import { titleCase } from '../utils/strings';
|
|
|
|
|
|
|
|
|
|
import { type CollectionEntry } from 'astro:content';
|
|
|
|
|
|
2026-08-07 14:40:12 -06:00
|
|
|
import { Icon } from 'astro-icon/components';
|
|
|
|
|
|
2026-06-05 14:31:12 -06:00
|
|
|
const scriptureStyles: {[index: string]:string} = {
|
2026-06-21 19:17:53 -06:00
|
|
|
gospels: 'gospels',
|
|
|
|
|
pentateuch: 'pentateuch',
|
|
|
|
|
historic: 'historic',
|
|
|
|
|
acts: 'acts',
|
|
|
|
|
wisdom: 'wisdom',
|
|
|
|
|
pauline: 'pauline',
|
|
|
|
|
prophets: 'prophets',
|
|
|
|
|
revelation: 'revelation',
|
|
|
|
|
devotional: 'devotional',
|
2026-11-21 15:19:35 -07:00
|
|
|
study: 'study',
|
2026-06-05 14:31:12 -06:00
|
|
|
};
|
|
|
|
|
const getScriptureStyle = (cat: any): string => {
|
|
|
|
|
if (cat in scriptureStyles) {
|
|
|
|
|
return scriptureStyles[cat];
|
|
|
|
|
}
|
2026-06-21 19:17:53 -06:00
|
|
|
return 'gospels';
|
2026-06-05 14:31:12 -06:00
|
|
|
};
|
2026-08-07 14:40:12 -06:00
|
|
|
const postMetaIcons: {[index :string]:{[index: string]:string}} = {
|
|
|
|
|
"long-form": {
|
|
|
|
|
"src": "justify-left",
|
|
|
|
|
"alt": "Long-form Notes",
|
|
|
|
|
},
|
|
|
|
|
"abbreviated": {
|
|
|
|
|
"src": "list-ul",
|
|
|
|
|
"alt": "Abbreviated Notes",
|
|
|
|
|
}
|
|
|
|
|
};
|
2026-06-05 14:31:12 -06:00
|
|
|
|
|
|
|
|
const base = import.meta.env.BASE_URL;
|
|
|
|
|
const { notes } = Astro.props;
|
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
<div id="notes-list">
|
|
|
|
|
<ul>{notes.map((note: CollectionEntry<'notes'>) => (
|
|
|
|
|
<li>
|
2026-07-06 16:15:18 -06:00
|
|
|
<div class="header-image">
|
2026-06-05 14:31:12 -06:00
|
|
|
<img src={urlfrag(base, note.data.post_image)} class="rounded-md" />
|
|
|
|
|
</div>
|
2026-08-07 14:40:12 -06:00
|
|
|
<div class="flex">
|
2026-06-05 14:31:12 -06:00
|
|
|
<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>
|
2026-08-07 14:40:12 -06:00
|
|
|
<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>
|
2026-06-05 14:31:12 -06:00
|
|
|
<hgroup>
|
|
|
|
|
<h2>
|
|
|
|
|
<a href={new URL(`${base}notes/${note.id}/`, Astro.url).pathname}>{note.data.title}</a>
|
|
|
|
|
</h2>
|
|
|
|
|
<h3>{note.data.sub_heading}</h3>
|
|
|
|
|
</hgroup>
|
|
|
|
|
<time>{dateFormat(note.data.date)}</time>
|
|
|
|
|
</li>
|
|
|
|
|
))}</ul>
|
|
|
|
|
</div>
|