add space before title in landscape

This commit is contained in:
Celogeek 2023-04-28 17:49:16 +02:00
parent 1bc85f4c2d
commit e8613b0cce
Signed by: celogeek
SSH Key Fingerprint: SHA256:njNJLzoLQdbV9PC6ehcruRb0QnEgxABoCYZ+0+aUIYc
2 changed files with 7 additions and 1 deletions

View File

@ -261,6 +261,10 @@ 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,6 +142,7 @@ 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"}, ""},
} }
@ -180,7 +181,8 @@ func getSpine(o *ContentOptions) []tag {
} }
spine := []tag{ spine := []tag{
{"itemref", tagAttrs{"idref": "page_title", "properties": getSpread(true)}, ""}, {"itemref", tagAttrs{"idref": "space_title", "properties": getSpread(false) + " layout-blank"}, ""},
{"itemref", tagAttrs{"idref": "page_title", "properties": getSpread(false)}, ""},
} }
for _, img := range o.Images { for _, img := range o.Images {
if img.DoublePage && isOnTheRight { if img.DoublePage && isOnTheRight {