Skip to content

Commit

Permalink
fix draft conds
Browse files Browse the repository at this point in the history
  • Loading branch information
agahkarakuzu committed Dec 18, 2024
1 parent bbaae12 commit abebad2
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
15 changes: 8 additions & 7 deletions data/filters/conditional-archives.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
function Meta(meta)
if meta.draft and meta.draft ~= '' then
meta.include_repository_doi = true
meta.include_data_doi = true
meta.include_book_doi = true
meta.include_docker_doi = true
meta.include_software_review = true
meta.include_book_exec = true
else

-- Helper function to check and set field
local function check_and_set_field(field_name, include_name)
local field = meta[field_name]
Expand All @@ -18,13 +26,6 @@ function Meta(meta)
check_and_set_field("docker_doi", "include_docker_doi")
check_and_set_field("software_review_url", "include_software_review")
check_and_set_field("book_exec_url", "include_book_exec")
else
meta.include_repository_doi = false
meta.include_data_doi = false
meta.include_book_doi = false
meta.include_docker_doi = false
meta.include_software_review = false
meta.include_book_exec = false
end
return meta
end
6 changes: 6 additions & 0 deletions data/filters/draft.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ function Meta (meta)
meta.article.volume = '0'
meta.published = 'unpublished'
meta.published_parts = os.date('*t')
meta.article.data_doi = '10.5281/zenodo.xxxxxx'
meta.article.book_doi = '10.5281/zenodo.xxxxxx'
meta.article.docker_doi = '10.xxxxxx/draft'
meta.article.repository_doi = '10.xxxxxx/draft'
meta.article.software_review = 'https://github.com/neurolibre/neurolibre-reviews'
meta.article.book_exec = 'https://preprint.neurolibre.org'
return meta
end
end

0 comments on commit abebad2

Please sign in to comment.