{% comment -%} The life and times of Dr John Dee Copyright (C) 2021 Jordan Cole This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with this program. If not, see . {% endcomment -%} {% assign source_record = include.source_key | collection_entry: "sources" -%} {% assign source_permalink = include.source_key | collection_entry_url: "sources" -%} {% if source_record -%} {% if include.volume -%} {% assign itemtype = "PublicationVolume" -%} {% else -%} {% assign itemtype = "CreativeWork" -%} {% endif -%} {% assign edition = source_record.editions | find: "edition_key", include.edition_key -%} {% assign license_key = edition.license_key | default: source_record.work.license_key -%} {% if license_key -%} {% endif -%} {% if include.volume_key -%} {% for volume_hash in edition.volumes -%} {% assign edition_volume_key = volume_hash | first -%} {% if edition_volume_key == include.volume_key -%} {% assign edition_volume_data = volume_hash | last -%} {% assign volume_number = edition_volume_data.volumeNumber -%} {% endif -%} {% endfor -%} {% if volume_number -%} {% endif -%} {% endif -%} {% assign name = edition.name | default: source_record.work.name -%} {% endif -%}