Skip to content

Commit

Permalink
Set copyright year to publishing year
Browse files Browse the repository at this point in the history
Falls back to the current year for unpublished articles.

Fixes: #94
  • Loading branch information
tarleb committed Oct 29, 2024
1 parent 551e72a commit a3027dc
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions data/filters/time.lua
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,8 @@ function Meta (meta)

meta.submitted = format_date(meta.submitted_parts)
meta.published = format_date(meta.published_parts)

meta.copyright = meta.copyright or {}
meta.copyright.year = meta.published_parts.year
return meta
end
2 changes: 1 addition & 1 deletion test/expected-draft/paper.jats/paper.jats
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ publishing pipeline</article-title>
<copyright-statement>Authors of papers retain copyright and release the
work under a Creative Commons Attribution 4.0 International License (CC
BY 4.0)</copyright-statement>
<copyright-year>2022</copyright-year>
<copyright-year>1970</copyright-year>
<copyright-holder>The article authors</copyright-holder>
<license license-type="open-access" xlink:href="https://creativecommons.org/licenses/by/4.0/">
<license-p>Authors of papers retain copyright and release the work under
Expand Down
2 changes: 1 addition & 1 deletion test/expected-pub/paper.jats/paper.jats
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ publishing pipeline</article-title>
<copyright-statement>Authors of papers retain copyright and release the
work under a Creative Commons Attribution 4.0 International License (CC
BY 4.0)</copyright-statement>
<copyright-year>2022</copyright-year>
<copyright-year>2020</copyright-year>
<copyright-holder>The article authors</copyright-holder>
<license license-type="open-access" xlink:href="https://creativecommons.org/licenses/by/4.0/">
<license-p>Authors of papers retain copyright and release the work under
Expand Down

0 comments on commit a3027dc

Please sign in to comment.