--- ##### # generate 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 # only generated during production environment build ##### gateway-baseurl: http://gateway.institution.org/oai/ admin-email: collectionbuilder.team@gmail.com permalink: /oai.xml --- {%- if jekyll.environment == "production" -%} {%- assign items = site.data[site.metadata] | where_exp: 'item','item.objectid' -%} {%- 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: ";" -%} {{ site.title | xml_escape }} {{ page.gateway-baseurl }}{{ page.url | absolute_url | remove: "https://" | remove: "http://" }} 2.0 {{ page.admin-email }} {{ site.time | date: "%Y-%m-%d" }} no YYYY-MM-DD oai_dc http://www.openarchives.org/OAI/2.0/oai_dc.xsd http://www.openarchives.org/OAI/2.0/oai_dc/ {% for item in items %} oai:{{ site.url | remove: 'https://' | remove: 'http://' }}:{{ site.baseurl | remove: '/' }}/{{ item.objectid }} {{ site.time | date: "%Y-%m-%d" }} {{ item.title | xml_escape }} {% for f in fields %} {%- assign map = f.dc_map | split: "." | last -%}{%- if oai_dc_fields contains map -%} {{ item[f.field] | xml_escape }} {% elsif map == "created" or map == "date" %}{{ item[f.field] }} {%- endif -%} {%- endfor -%} {{ item.objectid }} {{ '/items/' | absolute_url | append: item.objectid | append: '.html' }} {% endfor %} {%- endif -%}