Skip to content

Citation info on volume pages - #8188

Draft
nschneid wants to merge 10 commits into
masterfrom
volume-cite
Draft

Citation info on volume pages#8188
nschneid wants to merge 10 commits into
masterfrom
volume-cite

Conversation

@nschneid

@nschneid nschneid commented May 9, 2026

Copy link
Copy Markdown
Collaborator

Update the volume page template to mirror the paper page template more closely: include citation info/dialog, "Fix data" dialog

closes #8169

@github-actions

github-actions Bot commented May 9, 2026

Copy link
Copy Markdown

Build successful. Some useful links:

This preview will be removed when the branch is merged.

@mbollmann mbollmann left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In general, if Volume pages will have more or less the same components as Paper pages, we should factor them out into Hugo partials rather than duplicating all the code and markup in two places.

{{ $paper := index hugo.Data.volumes .Params.anthology_id }}
<script src="{{ relURL "js/clipboard.min.js" }}"></script>
<script src="{{ relURL "js/FileSaver.js" }}"></script>
<script>

@mbollmann mbollmann May 9, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we have the same dialog on two kinds of layout pages, we shouldn’t duplicate all the code.

{{ partial "author_link.html" (dict "ctx" $ "person" $person) | chomp }}{{ if ne (add $index 1) $len }}, {{ end }}
{{ end }}
<span class="text-muted">({{ cond (eq (len .) 1) "Editor" "Editors" }})</span>
</p>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why’s there an added </p> without an added <p> somewhere?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There was an unclosed <p> in the existing template.

{{ end }}
</div>

<div class="modal fade" id="metadataModal" tabindex="-1" aria-labelledby="metadataModalLabel" aria-hidden="true">

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same for the dialog, this shouldn’t be duplicated but probably be a Hugo partial.

{{ $expfile := printf "volumes/%s.xml" $anthology_id }}
{{ if (fileExists (printf "/data-export/%s" $expfile)) }}
<a class="btn btn-secondary btn-sm" href="{{ $expfile | relURL }}">MODS XML</a>
<dt class="acl-button-row">Bibkey:</dt>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I’m wondering the same thing (re: duplication) about this list of attributes, is it exactly identical to regular papers now? Though this could maybe also be tackled after #8000.

@nschneid

nschneid commented May 9, 2026

Copy link
Copy Markdown
Collaborator Author

Re: paper template vs. volume template, here are the differences (you can do a diff between the files to see in detail):

  • The paper template has a section with <meta> tags for bibliographic/search engine data. The volume template doesn't yet (it probably should but would be somewhat different).
  • The "Fix data" dialog and accompanying Javascript are slightly different to account for the fact that volumes don't have abstracts, and have editors rather than authors.
  • Instead of listing authors below the title, there is a list of editors. (I have seen this difference in several places. With the CollectionItem refactor, perhaps there should be a property like primary_creators that is an alias for authors if it is a paper and editors if it is a volume?)
  • The paper template lists a single abstract in the top section. The volume template does not, but it has a list of papers with a button to show abstracts for all of them.
  • The paper template has a bunch of logic for revisions/removals/errata etc.
  • The list of attributes is somewhat different: volume template has no authors, no containing volume, no pages, no awards, no attachments, no video. Some fields that are shared are accessed differently (because they are always at the volume level). Only volumes have an ISBN.
  • Only volumes have a button to access a full BibTeX export.

The cite modal dialog is the same AFAICT (haven't tested it because it relies on changes to the Volume class).

I am not sure refactoring to abstract over just these two pages would actually make the site easier to maintain. It would make the code organization more complex and raises the possibility of making a change that applies to both but forgetting to test it for both. (If there is a new template being created for Talks, that would be a good time to see what is shared across the 3 templates and abstract it.)

@nschneid

nschneid commented May 9, 2026

Copy link
Copy Markdown
Collaborator Author

Here is a split screen view of the current templates, WITHOUT the changes here. Volume (left), its front matter (right):

image

@nschneid

nschneid commented May 9, 2026

Copy link
Copy Markdown
Collaborator Author

I wanted to see what library changes would be necessary for this. Having some trouble getting citation.py to recognize Volume and distinguish it from Paper (running into circular imports). In any case, it's clear that tweaks will be needed in the custom citation generation code (which currently special-cases frontmatter), and in the BibTeX generation code (which assumes the bibkey is located in frontmatter). Also, the BibTeX treatment of entire journal issues is not obvious, though I suppose @book is good enough.

Presumably #8000 will make some of this easier.

@nschneid
nschneid marked this pull request as draft May 9, 2026 17:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Volume pages should have their own citation

2 participants