|
12345678910111213141516171819202122 |
- import type { Request, Response } from 'express';
- import { escapeHtml } from '../util.js';
-
- export function renderCollection(req: Request, res: Response, { collection, container, user }) {
- const nicestName = collection.label || container.name || '';
- res.render('collection', {
- title: `Annotation collection “${nicestName}” of ${user}`,
- collection,
- nicestName,
- user,
- head: `
- <link
- rel="alternate"
- type='application/ld+json; profile="http://www.w3.org/ns/anno.jsonld"'
- href=""
- title="${escapeHtml(nicestName)}"
- />
- `,
- json: JSON.stringify(collection, null, 2),
- annotations: collection.first.items,
- });
- }
|