This repository has been archived by the owner on Feb 12, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
oai.xml
61 lines (61 loc) · 3.44 KB
/
oai.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
---
# create OAI-PMH static repository xml file
# see docs/oai-pmh.md for details
# the gateway-baseurl and admin-email must be set here for the static repository to be valid
gateway-baseurl: http://gateway.institution.org/oai/
admin-email: [email protected]
---
{%- assign items = site.data[site.metadata] -%}
{%- assign fields = site.data.config-metadata | where_exp: 'field','field.dc_map' -%}
{%- assign oai_dc_fields = "creator;subject;description;publisher;contributor;type;format;identifier;source;language;relation;coverage;rights" | split: ";" -%}
<?xml version="1.0" encoding="UTF-8"?>
<Repository xmlns="http://www.openarchives.org/OAI/2.0/static-repository"
xmlns:oai="http://www.openarchives.org/OAI/2.0/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.openarchives.org/OAI/2.0/static-repository
http://www.openarchives.org/OAI/2.0/static-repository.xsd">
<Identify>
<oai:repositoryName>{{ site.title | xml_escape }}</oai:repositoryName>
<oai:baseURL>{{ page.gateway-baseurl }}{{ page.url | absolute_url | remove: "https://" | remove: "http://" }}</oai:baseURL>
<oai:protocolVersion>2.0</oai:protocolVersion>
<oai:adminEmail>{{ page.admin-email }}</oai:adminEmail>
<oai:earliestDatestamp>{{ site.time | date: "%Y-%m-%d" }}</oai:earliestDatestamp>
<oai:deletedRecord>no</oai:deletedRecord>
<oai:granularity>YYYY-MM-DD</oai:granularity>
</Identify>
<ListMetadataFormats>
<oai:metadataFormat>
<oai:metadataPrefix>oai_dc</oai:metadataPrefix>
<oai:schema>http://www.openarchives.org/OAI/2.0/oai_dc.xsd</oai:schema>
<oai:metadataNamespace>http://www.openarchives.org/OAI/2.0/oai_dc/</oai:metadataNamespace>
</oai:metadataFormat>
</ListMetadataFormats>
<ListRecords metadataPrefix="oai_dc">
{% for item in items %}
<oai:record>
<oai:header>
<oai:identifier>oai:{{ site.url | remove: 'https://' | remove: 'http://' }}:{{ site.baseurl | remove: '/' }}/{{ item.objectid }}</oai:identifier>
<oai:datestamp>{{ site.time | date: "%Y-%m-%d" }}</oai:datestamp>
</oai:header>
<oai:metadata>
<oai_dc:dc
xmlns:oai_dc="http://www.openarchives.org/OAI/2.0/oai_dc/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.openarchives.org/OAI/2.0/oai_dc/
http://www.openarchives.org/OAI/2.0/oai_dc.xsd">
<dc:title>{{ item.title | xml_escape }}</dc:title>
{% for f in fields %}
{%- assign map = f.dc_map | split: "." | last -%}{%- if oai_dc_fields contains map -%}
<dc:{{ map }}>{{ item[f.field] | xml_escape }}</dc:{{ map }}>
{% elsif map == "created" or map == "date" %}<dc:date>{{ item[f.field] }}</dc:date>
{%- endif -%}
{%- endfor -%}
<dc:identifier>{{ item.objectid }}</dc:identifier>
<dc:identifier>{{ '/items/' | absolute_url | append: item.objectid | append: '.html' }}</dc:identifier>
</oai_dc:dc>
</oai:metadata>
</oai:record>
{% endfor %}
</ListRecords>
</Repository>