Skip to content

Commit

Permalink
Do not set version when reproducible attribute is set
Browse files Browse the repository at this point in the history
  • Loading branch information
ggrossetie committed Sep 3, 2022
1 parent c326fcf commit 2555afa
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions lib/metadata.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
const pkg = require('../package.json')

const addMetadata = async (pdfDoc, doc) => {
let modificationDate
let creationDate
let modificationDate, creationDate, creator
if (doc.hasAttribute('reproducible')) {
const date = new Date()
date.setTime(0)
modificationDate = date
creationDate = date
creator = 'Asciidoctor Web PDF'
} else {
try {
modificationDate = new Date(doc.getAttribute('docdatetime'))
Expand All @@ -19,10 +19,10 @@ const addMetadata = async (pdfDoc, doc) => {
} catch (e) {
creationDate = new Date()
}
creator = `Asciidoctor Web PDF ${pkg.version}`
}
const authors = doc.getAttribute('authors', '')
const publisher = doc.getAttribute('publisher', '')
const creator = `Asciidoctor Web PDF ${pkg.version}`
pdfDoc.setTitle(doc.getDocumentTitle({ use_fallback: true }))
pdfDoc.setAuthor(authors)
pdfDoc.setSubject(doc.getAttribute('subject', ''))
Expand Down
2 changes: 1 addition & 1 deletion test/docker-smoke-test.md5sum
Original file line number Diff line number Diff line change
@@ -1 +1 @@
67b7ee0303907fdd271dd80df8aab3a8 test/output/docker-smoke-test.pdf
d704d54146b1571faa9379e2b232ecd1 test/output/docker-smoke-test.pdf

0 comments on commit 2555afa

Please sign in to comment.