change content.opf template based on the presence of translator metadata
This commit is contained in:
parent
354a1a81a3
commit
5ac6f7ba64
8
g2e.awk
8
g2e.awk
|
@ -13,6 +13,8 @@ BEGIN{
|
||||||
|
|
||||||
"date -u +%FT%TZ" | getline meta["date"]
|
"date -u +%FT%TZ" | getline meta["date"]
|
||||||
|
|
||||||
|
content_header_template = "content-header.opf"
|
||||||
|
|
||||||
# read metadata file fields
|
# read metadata file fields
|
||||||
while( getline < metadatafile ){
|
while( getline < metadatafile ){
|
||||||
key = $1; sub(":","",key)
|
key = $1; sub(":","",key)
|
||||||
|
@ -23,6 +25,10 @@ BEGIN{
|
||||||
sub(/^.+\//,"",value) # get basename
|
sub(/^.+\//,"",value) # get basename
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(key=="translator"){
|
||||||
|
content_header_template = "content-header-translator.opf"
|
||||||
|
}
|
||||||
|
|
||||||
meta[key] = value
|
meta[key] = value
|
||||||
|
|
||||||
# set index file as an argument to be read
|
# set index file as an argument to be read
|
||||||
|
@ -59,7 +65,7 @@ BEGIN{
|
||||||
}
|
}
|
||||||
|
|
||||||
# start writing metadata files
|
# start writing metadata files
|
||||||
content = write_template("content-header.opf", meta )
|
content = write_template(content_header_template, meta )
|
||||||
toc = write_template( "toc-header.ncx", meta )
|
toc = write_template( "toc-header.ncx", meta )
|
||||||
spinetoc = " <spine toc=\"ncx\">\n"
|
spinetoc = " <spine toc=\"ncx\">\n"
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,7 +8,6 @@
|
||||||
<dc:creator id="creator">{author}</dc:creator>
|
<dc:creator id="creator">{author}</dc:creator>
|
||||||
<dc:description>{description}</dc:description>
|
<dc:description>{description}</dc:description>
|
||||||
<dc:date>{publishDate}</dc:date>
|
<dc:date>{publishDate}</dc:date>
|
||||||
<dc:contributor id="translator">{translator}</dc:contributor>
|
|
||||||
<meta property="dcterms:modified">{date}</meta>
|
<meta property="dcterms:modified">{date}</meta>
|
||||||
<meta content="{cover}" name="cover"/>
|
<meta content="{cover}" name="cover"/>
|
||||||
</metadata>
|
</metadata>
|
||||||
|
|
Loading…
Reference in New Issue