Add attributes for demonstation purposes

This commit is contained in:
Luca Bosin
2023-08-18 20:47:03 +02:00
parent d12462222f
commit 6ae22b7a9c
14 changed files with 84 additions and 113 deletions

View File

@ -1,4 +1,5 @@
<script>
import { getFileName } from '$lib/util/links';
import { strf } from '$lib/data/language.js';
function sortItems() {
@ -22,10 +23,12 @@
<li>
<h3>{item.item}</h3>
<p>
<b>Title:</b> {$strf(item.title)}<br />
<b>Description:</b> {#if item.description}{$strf(item.description)}{:else}<i>no description</i>{/if}
<b>Title:</b> {#if item.title}{$strf(item.title)}{:else}<i>no title</i>{/if}<br />
<b>Description:</b> {#if item.description}{$strf(item.description)}{:else}<i>no description</i>{/if}<br />
<b>Links:</b> <a href={`${base}${item.item}`}>Open</a> &bullet; <a href={`${base}${item.item}/download`}>Download</a><br />
<b>Thumbnails:</b> <a href={`${base}${item.item}/t/s`}>Small</a> &bullet; <a href={`${base}${item.item}/t/m`}>Medium</a> &bullet; <a href={`${base}${item.item}/t/l`}>Large</a> &bullet; <a href={`${base}${item.item}/t/full`}>Full</a>
</p>
<img src={`${base}${item.item}/t`} alt={$strf(item.title) || item.item} />
<img src={`${base}${item.item}/t`} alt={(item.title ? $strf(item.title) : null) || (item.description ? $strf(item.description) : null) || getFileName(item.item)} />
</li>
{/each}
</ul>

3
src/lib/types.d.ts vendored
View File

@ -12,7 +12,6 @@ type License = {
}
type Metadata = {
title: Translation | string;
description?: Translation | string;
authors?: string[] | string;
place?: string;
@ -21,11 +20,13 @@ type Metadata = {
}
type AlbumMetadata = Metadata & {
title: Translation | string;
date: string; // ISO 8601, e.g. 2020-12-24, used for sorting
cover?: string;
};
type ItemMetadata = Metadata & {
title?: Translation | string;
item: string;
timestamp?: string; // ISO 8601, e.g. 2020-12-24T12:00:00Z
};