Added icons to indicate available notes types.
This commit is contained in:
parent
0a6778aeb7
commit
0087584b65
2 changed files with 23 additions and 0 deletions
|
|
@ -7,6 +7,8 @@ import { titleCase } from '../utils/strings';
|
||||||
|
|
||||||
import { type CollectionEntry } from 'astro:content';
|
import { type CollectionEntry } from 'astro:content';
|
||||||
|
|
||||||
|
import { Icon } from 'astro-icon/components';
|
||||||
|
|
||||||
const scriptureStyles: {[index: string]:string} = {
|
const scriptureStyles: {[index: string]:string} = {
|
||||||
gospels: 'gospels',
|
gospels: 'gospels',
|
||||||
pentateuch: 'pentateuch',
|
pentateuch: 'pentateuch',
|
||||||
|
|
@ -24,6 +26,16 @@ const getScriptureStyle = (cat: any): string => {
|
||||||
}
|
}
|
||||||
return 'gospels';
|
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 base = import.meta.env.BASE_URL;
|
||||||
const { notes } = Astro.props;
|
const { notes } = Astro.props;
|
||||||
|
|
@ -35,10 +47,17 @@ const { notes } = Astro.props;
|
||||||
<div class="header-image">
|
<div class="header-image">
|
||||||
<img src={urlfrag(base, note.data.post_image)} class="rounded-md" />
|
<img src={urlfrag(base, note.data.post_image)} class="rounded-md" />
|
||||||
</div>
|
</div>
|
||||||
|
<div class="flex">
|
||||||
<ul class="tags relative">
|
<ul class="tags relative">
|
||||||
{note.data.tags?.filter((tag: string) => (tag != 'notes')).map((tag: string) => (
|
{note.data.tags?.filter((tag: string) => (tag != 'notes')).map((tag: string) => (
|
||||||
<li class:list={[getScriptureStyle(note.data.scripture_category)]}>{titleCase(tag)}</li>
|
<li class:list={[getScriptureStyle(note.data.scripture_category)]}>{titleCase(tag)}</li>
|
||||||
))}</ul>
|
))}</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>
|
<hgroup>
|
||||||
<h2>
|
<h2>
|
||||||
<a href={new URL(`${base}notes/${note.id}/`, Astro.url).pathname}>{note.data.title}</a>
|
<a href={new URL(`${base}notes/${note.id}/`, Astro.url).pathname}>{note.data.title}</a>
|
||||||
|
|
|
||||||
|
|
@ -232,6 +232,10 @@ dialog.scripture {
|
||||||
@apply block text-xl text-gray-400 pl-4 pr-4 pt-2 text-right relative bottom-0;
|
@apply block text-xl text-gray-400 pl-4 pr-4 pt-2 text-right relative bottom-0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#notes-list ul.types li {
|
||||||
|
@apply inline-block bg-neutral-900 p-2;
|
||||||
|
}
|
||||||
|
|
||||||
article#notes-page {
|
article#notes-page {
|
||||||
@apply pt-4 text-xl duration-500 transition-colors;
|
@apply pt-4 text-xl duration-500 transition-colors;
|
||||||
@apply dark:text-gray-200;
|
@apply dark:text-gray-200;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue