mirror of
https://github.com/celogeek/go-comic-converter.git
synced 2025-05-24 15:52:38 +02:00
add part information in title and series meta
This commit is contained in:
parent
2a2cb3341d
commit
d6c761ec6c
@ -166,9 +166,20 @@ func (e *ePub) Write() error {
|
||||
}
|
||||
defer wz.Close()
|
||||
|
||||
title := e.Title
|
||||
if totalParts > 1 {
|
||||
title = fmt.Sprintf("%s [%d/%d]", title, i+1, totalParts)
|
||||
}
|
||||
content := []zipContent{
|
||||
{"META-INF/container.xml", containerTmpl},
|
||||
{"OEBPS/content.opf", e.render(contentTmpl, map[string]any{"Info": e, "Cover": part.Cover, "Images": part.Images})},
|
||||
{"OEBPS/content.opf", e.render(contentTmpl, map[string]any{
|
||||
"Info": e,
|
||||
"Cover": part.Cover,
|
||||
"Images": part.Images,
|
||||
"Title": title,
|
||||
"Part": i + 1,
|
||||
"Total": totalParts,
|
||||
})},
|
||||
{"OEBPS/toc.ncx", e.render(tocTmpl, map[string]any{"Info": e})},
|
||||
{"OEBPS/nav.xhtml", e.render(navTmpl, map[string]any{"Info": e})},
|
||||
{"OEBPS/Text/style.css", styleTmpl},
|
||||
|
@ -2,7 +2,7 @@
|
||||
<package version="3.0" unique-identifier="BookID" xmlns="http://www.idpf.org/2007/opf">
|
||||
{{ $info := .Info }}
|
||||
<metadata xmlns:opf="http://www.idpf.org/2007/opf" xmlns:dc="http://purl.org/dc/elements/1.1/">
|
||||
<dc:title>{{ $info.Title }}</dc:title>
|
||||
<dc:title>{{ .Title }}</dc:title>
|
||||
<dc:language>en-US</dc:language>
|
||||
<dc:identifier id="BookID">urn:uuid:{{ $info.UID }}</dc:identifier>
|
||||
<dc:contributor id="contributor">{{ $info.Publisher }}</dc:contributor>
|
||||
@ -18,6 +18,10 @@
|
||||
<meta name="orientation-lock" content="portrait"/>
|
||||
{{ if eq $info.AddPanelView true }}
|
||||
<meta name="region-mag" content="true"/>
|
||||
{{ end }}
|
||||
{{ if gt .Total 1 }}
|
||||
<meta name="calibre:series" content="{{ $info.Title }}"/>
|
||||
<meta name="calibre:series_index" content="{{ .Part }}"/>
|
||||
{{ end }}
|
||||
</metadata>
|
||||
<manifest>
|
||||
|
Loading…
x
Reference in New Issue
Block a user