Skip to content

Commit

Permalink
Merge pull request #35 from mnyrop/catalog-metadata
Browse files Browse the repository at this point in the history
init catalog metadata
  • Loading branch information
mnyrop authored Feb 9, 2024
2 parents b6073c2 + e57f9a6 commit 130d1db
Show file tree
Hide file tree
Showing 9 changed files with 2,921 additions and 782 deletions.
23 changes: 12 additions & 11 deletions .eleventy.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,16 @@ module.exports = function(eleventyConfig) {
return moment(date).utc().format('LL');
})

// limit filter
eleventyConfig.addFilter('limit', function (arr, limit) {
return arr.slice(0, limit);
})

// inspect objects as JSON
eleventyConfig.addFilter('jsonify', (data) => {
return JSON.stringify(data, null, "\t")
})

const markdownItOptions = {
html: true,
}
Expand All @@ -43,20 +53,11 @@ module.exports = function(eleventyConfig) {
markdownItAnchorOptions
)

eleventyConfig.setLibrary("md", markdownLib)

// limit filter
eleventyConfig.addFilter('limit', function (arr, limit) {
return arr.slice(0, limit);
})

// inspect objects as JSON
eleventyConfig.addFilter('jsonify', (data) => {
return JSON.stringify(data, null, "\t")
})
eleventyConfig.setLibrary("md", markdownLib)

// layout aliases
eleventyConfig.addLayoutAlias('base', 'layouts/base.html')
eleventyConfig.addLayoutAlias('item', 'layouts/item.html')
eleventyConfig.addLayoutAlias('page', 'layouts/page.html')

// passthrough copy
Expand Down
2,824 changes: 2,094 additions & 730 deletions site/_data/items.json

Large diffs are not rendered by default.

730 changes: 730 additions & 0 deletions site/_data/items_PRIOR.json

Large diffs are not rendered by default.

6 changes: 4 additions & 2 deletions site/_includes/components/viewers/osd-iiif.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<div id="map" class="w-100 p-3 z-0 h-96 md:min-h-[36rem] bg-neutral"></div>
{% capture manifest_url %}https://aperitiiif-presentation-api-store.s3.us-east-1.amazonaws.com/bibliopolitica/{{ item.id }}/manifest.json{% endcapture %}
<div id="map" class="w-100 p-3 z-0 h-full bg-neutral"></div>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/build/openseadragon/openseadragon.min.js"></script>
<script type="text/javascript">
function fullscreenchanged(event) {
Expand All @@ -10,7 +11,7 @@
}
document.addEventListener("fullscreenchange", fullscreenchanged);
document.addEventListener("DOMContentLoaded", function () {
var manifestUrl = "{{ item.manifest_url }}";
var manifestUrl = "{{ manifest_url }}";
fetch(manifestUrl)
.then(response => {
if (!response.ok) {
Expand All @@ -29,6 +30,7 @@
prefixUrl: "{{ '/assets/vendor/osd/icons/' | url }}",
tileSources: tileSources,
placeholderFillStyle: "#FFFFFF",
showReferenceStrip: true,
showHomeControl: false
});
// viewer.innerTracker.scrollHandler = false;
Expand Down
74 changes: 74 additions & 0 deletions site/_includes/layouts/item.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
---
layout: base
---

<div class="flex p-5 pb-3 items-center">
<div class="basis-3/4">
<h1 class="text-3xl md:text-4xl font-bold">{{ item.label }}</h1>
</div>
<div class="basis-1/4 h-12 text-primary text-right flex justify-end">
<a href="{{ pagination.href.previous | default: pagination.href.last | url }}" class="-mr-1 text-neutral-950 hover:text-accent" data-tip="Previous item">{% include "svg/arrow-left.svg" %}</a>
<a href="{{ pagination.href.next | default: pagination.href.first | url }}" class="text-neutral-950 hover:text-accent" data-tip="Next item">{% include "svg/arrow-right.svg" %}</a>
</div>
</div>

<article id="item-content-area" class="px-5 pb-5 md:flex">
<div class="md:basis-3/5 bg-neutral">
{% include "components/viewers/osd-iiif.html" %}
</div>
<ul class="p-6 space-y-2 border md:basis-2/5 md:text-lg md:flex md:flex-col md:justify-end">
<li><b>Alternate Title(s):</b> {{ item["Alternate title"] | join: '; ' | default: 'N/A' }}</li>
<li><b>Corporate Creator(s):</b> {{ item["Corporate Creator"] | join: '; ' | default: 'N/A' }}</li>
<li><b>Person Creator(s):</b> {{ item["Person Creator"] | join: '; ' | default: 'N/A' }}</li>
<li><b>Place(s) of Publication or Production:</b> {{ item["Place of Publication or Production"] | join: '; ' | default: 'N/A' }}</li>
<li><b>Publisher Name(s):</b> {{ item["Publisher Name"] | join: '; ' | default: 'N/A' }}</li>
<li><b>Date of Publication or Production:</b> {{ item["Date of Publication or Production"] | default: 'N/A' }}</li>
<li><b>Extent:</b> {{ item["Extent"] | default: 'N/A' }}</li>
<li><b>Dimensions:</b> {{ item["Dimensions"] | default: 'N/A' }}</li>
<li><b>Language(s):</b> {{ item["Language"] | join: '; ' | default: 'N/A' }}</li>
<li><b>Notes:</b>
<ul>
{% for note in item["Notes"] %}
<li>{{ note }}</li>
{% endfor %}
</ul>
</li>
<li><b>Narrative Summary:</b> {{ item["Narrative Summary"] | default: 'N/A' }}</li>
<li><b>Keyword(s):</b>
{% for keyword in item["Keyword"] %}
<a class="link hover:text-accent">{{ keyword }}</a>{% unless forloop.last %}; {% endunless %}
{% endfor %}
</li>
<li><b>Subject(s):</b>
{% for subject in item["Subject"] %}
<a class="link hover:text-accent">{{ subject }}</a>{% unless forloop.last %}; {% endunless %}
{% endfor %}
</li>
<li><b>Genre(s):</b>
{% for genre in item["Genre"] %}
<a class="link hover:text-accent">{{ genre }}</a>{% unless forloop.last %}; {% endunless %}
{% endfor %}
</li>
<li><b>Format(s):</b>
{% for format in item["Format"] %}
<a class="link hover:text-accent">{{ format }}</a>{% unless forloop.last %}; {% endunless %}
{% endfor %}
</li>
<li><b>Rights Statement:</b> {{ item["Rights Statement"] | default: 'N/A' }}</li>
<li><b>Library Call Number:</b> {{ item["Library Call Number"] | default: 'N/A' }}</li>
<li><b>Link(s):</b>
{% for link in item["Link"] %}
<a class="link hover:text-accent" href="{{ link }}">{{ link }}</a>{% unless forloop.last %}; {% endunless %}
{% endfor %}
</li>
<li><b>Identifier(s):</b> {{ item["Identifier"] | join: '; ' | default: 'N/A' }}</li>
<li><b>IIIF Resource:</b>
<a class="link hover:text-accent" href="{{ item.manifest_url }}" target="_none">JSON Manifest</a>
</li>
</ul>
</article>

<!-- <div class=" grid grid-cols-2 mt-5 px-5 font-normal">
<a href="{{ pagination.href.previous | default: pagination.href.last | url }}" class="join-item btn btn-outline">PREVIOUS: {{ pagination.page.previous.label | default: pagination.page.last.label }}</a>
<a href="{{ pagination.href.next | default: pagination.href.first | url }}" class="join-item btn btn-outline">NEXT: {{ pagination.page.next.label | default: pagination.page.first.label }} &rarr;</a>
</div> -->
3 changes: 2 additions & 1 deletion site/_includes/partials/exhibit-card.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<a class="card w-96 bg-base-100 shadow-xl max-h-96" href="{{ '/item/'| append: item.id | url }}">
<figure class="">
<img src="{{ item.full_url }}" alt="" class="" />
{% capture img_url %}https://d1b7k5w7yjwpfg.cloudfront.net/iiif/2/bibliopolitica_{{ item.id }}_{{ item.id }}_001/full/800,/0/default.jpg{% endcapture %}
<img src="{{ img_url }}" alt="" class="" />
</figure>
<div class="card-body items-center text-center">
<h2 class="card-title text-gray-400">{{ item.label }}</h2>
Expand Down
3 changes: 2 additions & 1 deletion site/_includes/partials/item-card.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<a class="inline-block" href="{{ '/item/'| append: item.id | url }}">
<img src="{{ item.full_url }}" class="" alt="">
{% capture img_url %}https://d1b7k5w7yjwpfg.cloudfront.net/iiif/2/bibliopolitica_{{ item.id }}_{{ item.id }}_001/full/800,/0/default.jpg{% endcapture %}
<img src="{{ img_url }}" class="" alt="">
<div class="my-2 text-base leading-[1.4]">
{{ item.label }}
</div>
Expand Down
3 changes: 2 additions & 1 deletion site/pages/browse/items.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,11 @@ permalink: "/browse/items/index.html"
<main class="flex-auto md:px-10">
<div class="grid grid-cols-3 md:grid-cols-4 lg:grid-cols-5 gap-10 gap-y-5 items-center">
{%- for item in items -%}
{% capture img_url %}https://d1b7k5w7yjwpfg.cloudfront.net/iiif/2/bibliopolitica_{{ item.id }}_{{ item.id }}_001/full/800,/0/default.jpg{% endcapture %}
<div class="mb-8">
<a href="{{ '/item/' | append: item.id | url }}">
<img
src="{{ item.full_url | url }}"
src="{{ img_url }}"
alt=""
class="max-w-full h-auto"
>
Expand Down
37 changes: 1 addition & 36 deletions site/pages/items.md
Original file line number Diff line number Diff line change
@@ -1,43 +1,8 @@
---
layout: base
layout: item
pagination:
data: items
size: 1
alias: item
permalink: "/item/{{ item.id }}.html"
---

<div class="flex p-5 pb-3 items-center">
<div class="basis-3/4">
<h1 class="text-3xl md:text-4xl font-bold">{{ item.label }}</h1>
</div>
<div class="basis-1/4 h-12 text-primary text-right flex justify-end">
<a href="{{ pagination.href.previous | default: pagination.href.last | url }}" class="-mr-1 text-neutral-950 hover:text-accent" data-tip="Previous item">{% include "svg/arrow-left.svg" %}</a>
<a href="{{ pagination.href.next | default: pagination.href.first | url }}" class="text-neutral-950 hover:text-accent" data-tip="Next item">{% include "svg/arrow-right.svg" %}</a>
</div>
</div>
<article id="item-content-area" class="px-5 pb-5 md:flex">
<div class="md:basis-3/5 bg-neutral">
{% include "components/viewers/osd-iiif.html" %}
</div>
<ul class="p-6 space-y-2 border md:basis-2/5 md:text-lg md:flex md:flex-col md:justify-end">
<li><b>Label:</b> {{ item.label }}</li>
<li><b>Person or Creator:</b> Arce, José Antonio, 1948-2018</li>
<li><b>Dimensions:</b> 8.5 x 11 inches</li>
<li><b>Language:</b> English</li>
<li><b>Date of Production:</b> Approximately 1972-2001</li>
<li><b>Format:</b>
<a class="link">volume</a>;
<a class="link">integrating resource</a>;
<a class="link">typescript</a>
</li>
<li><b>IIIF Resource:</b>
<a class="link" href="{{ item.manifest_url }}" target="_none">JSON Manifest</a>
</li>
</ul>
</article>

<!-- <div class=" grid grid-cols-2 mt-5 px-5 font-normal">
<a href="{{ pagination.href.previous | default: pagination.href.last | url }}" class="join-item btn btn-outline">PREVIOUS: {{ pagination.page.previous.label | default: pagination.page.last.label }}</a>
<a href="{{ pagination.href.next | default: pagination.href.first | url }}" class="join-item btn btn-outline">NEXT: {{ pagination.page.next.label | default: pagination.page.first.label }} &rarr;</a>
</div> -->

0 comments on commit 130d1db

Please sign in to comment.