Compare commits

..

No commits in common. "8ba526f186011fc3c09bfc2fe1c2c16e06cf80c9" and "1bc85f4c2d51f11c7e3ee6cbf9f9e600264c93f9" have entirely different histories.

2 changed files with 5 additions and 14 deletions

View File

@ -261,10 +261,6 @@ func (e *ePub) Write() error {
"PageWidth": e.Image.View.Width, "PageWidth": e.Image.View.Width,
"PageHeight": e.Image.View.Height, "PageHeight": e.Image.View.Height,
})}, })},
{"OEBPS/Text/space_title.xhtml", e.render(epubtemplates.Blank, map[string]any{
"Title": "Blank Page Title",
"ViewPort": fmt.Sprintf("width=%d,height=%d", e.Image.View.Width, e.Image.View.Height),
})},
{"OEBPS/Text/title.xhtml", e.render(epubtemplates.Text, map[string]any{ {"OEBPS/Text/title.xhtml", e.render(epubtemplates.Text, map[string]any{
"Title": title, "Title": title,
"ViewPort": fmt.Sprintf("width=%d,height=%d", e.Image.View.Width, e.Image.View.Height), "ViewPort": fmt.Sprintf("width=%d,height=%d", e.Image.View.Width, e.Image.View.Height),

View File

@ -142,7 +142,6 @@ func getManifest(o *ContentOptions) []tag {
items := []tag{ items := []tag{
{"item", tagAttrs{"id": "toc", "href": "toc.xhtml", "properties": "nav", "media-type": "application/xhtml+xml"}, ""}, {"item", tagAttrs{"id": "toc", "href": "toc.xhtml", "properties": "nav", "media-type": "application/xhtml+xml"}, ""},
{"item", tagAttrs{"id": "css", "href": "Text/style.css", "media-type": "text/css"}, ""}, {"item", tagAttrs{"id": "css", "href": "Text/style.css", "media-type": "text/css"}, ""},
{"item", tagAttrs{"id": "space_title", "href": "Text/space_title.xhtml", "media-type": "application/xhtml+xml"}, ""},
{"item", tagAttrs{"id": "page_title", "href": "Text/title.xhtml", "media-type": "application/xhtml+xml"}, ""}, {"item", tagAttrs{"id": "page_title", "href": "Text/title.xhtml", "media-type": "application/xhtml+xml"}, ""},
{"item", tagAttrs{"id": "img_title", "href": "Images/title.jpg", "media-type": "image/jpeg"}, ""}, {"item", tagAttrs{"id": "img_title", "href": "Images/title.jpg", "media-type": "image/jpeg"}, ""},
} }
@ -166,9 +165,9 @@ func getManifest(o *ContentOptions) []tag {
// spine part of the content // spine part of the content
func getSpine(o *ContentOptions) []tag { func getSpine(o *ContentOptions) []tag {
isOnTheRight := !o.ImageOptions.Manga isOnTheRight := !o.ImageOptions.Manga
getSpread := func(isDoublePage bool) string { getSpread := func(doublePageNoBlank bool) string {
isOnTheRight = !isOnTheRight isOnTheRight = !isOnTheRight
if isDoublePage { if doublePageNoBlank {
// Center the double page then start back to comic mode (mange/normal) // Center the double page then start back to comic mode (mange/normal)
isOnTheRight = !o.ImageOptions.Manga isOnTheRight = !o.ImageOptions.Manga
return "rendition:page-spread-center" return "rendition:page-spread-center"
@ -179,19 +178,15 @@ func getSpine(o *ContentOptions) []tag {
return "rendition:page-spread-left" return "rendition:page-spread-left"
} }
} }
getSpreadBlank := func() string {
return fmt.Sprintf("%s layout-blank", getSpread(false))
}
spine := []tag{ spine := []tag{
{"itemref", tagAttrs{"idref": "space_title", "properties": getSpreadBlank()}, ""}, {"itemref", tagAttrs{"idref": "page_title", "properties": getSpread(true)}, ""},
{"itemref", tagAttrs{"idref": "page_title", "properties": getSpread(false)}, ""},
} }
for _, img := range o.Images { for _, img := range o.Images {
if img.DoublePage && o.ImageOptions.Manga == isOnTheRight { if img.DoublePage && isOnTheRight {
spine = append(spine, tag{ spine = append(spine, tag{
"itemref", "itemref",
tagAttrs{"idref": img.SpaceKey(), "properties": getSpreadBlank()}, tagAttrs{"idref": img.SpaceKey(), "properties": getSpread(false) + " layout-blank"},
"", "",
}) })
} }