Skip to content

Commit a3027dc

Browse files
committed
Set copyright year to publishing year
Falls back to the current year for unpublished articles. Fixes: #94
1 parent 551e72a commit a3027dc

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

data/filters/time.lua

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,5 +41,8 @@ function Meta (meta)
4141

4242
meta.submitted = format_date(meta.submitted_parts)
4343
meta.published = format_date(meta.published_parts)
44+
45+
meta.copyright = meta.copyright or {}
46+
meta.copyright.year = meta.published_parts.year
4447
return meta
4548
end

test/expected-draft/paper.jats/paper.jats

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ publishing pipeline</article-title>
8888
<copyright-statement>Authors of papers retain copyright and release the
8989
work under a Creative Commons Attribution 4.0 International License (CC
9090
BY 4.0)</copyright-statement>
91-
<copyright-year>2022</copyright-year>
91+
<copyright-year>1970</copyright-year>
9292
<copyright-holder>The article authors</copyright-holder>
9393
<license license-type="open-access" xlink:href="https://creativecommons.org/licenses/by/4.0/">
9494
<license-p>Authors of papers retain copyright and release the work under

test/expected-pub/paper.jats/paper.jats

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ publishing pipeline</article-title>
8888
<copyright-statement>Authors of papers retain copyright and release the
8989
work under a Creative Commons Attribution 4.0 International License (CC
9090
BY 4.0)</copyright-statement>
91-
<copyright-year>2022</copyright-year>
91+
<copyright-year>2020</copyright-year>
9292
<copyright-holder>The article authors</copyright-holder>
9393
<license license-type="open-access" xlink:href="https://creativecommons.org/licenses/by/4.0/">
9494
<license-p>Authors of papers retain copyright and release the work under

0 commit comments

Comments
 (0)