readjust cover

This commit is contained in:
Celogeek 2022-12-27 23:00:42 +01:00
parent fd80342a19
commit 30f4d20c6a
Signed by: celogeek
GPG Key ID: E6B7BDCFC446233A
4 changed files with 7 additions and 12 deletions

View File

@ -301,18 +301,13 @@ func (e *EPub) Write() error {
{"META-INF/container.xml", gohtml.Format(TEMPLATE_CONTAINER)},
{"OEBPS/content.opf", e.Render(TEMPLATE_CONTENT, map[string]any{"Info": e, "Images": part.Images})},
{"OEBPS/toc.ncx", e.Render(TEMPLATE_TOC, map[string]any{"Info": e, "Images": part.Images})},
{"OEBPS/nav.xhtml", e.Render(TEMPLATE_NAV, map[string]any{"Info": e, "Images": part.Images})},
{"OEBPS/nav.xhtml", e.Render(TEMPLATE_NAV, map[string]any{"Info": e, "Image": part.Images[0]})},
{"OEBPS/Text/style.css", TEMPLATE_STYLE},
{"OEBPS/Text/part.xhtml", e.Render(TEMPLATE_PART, map[string]any{
"Info": e,
"Part": i + 1,
"Total": totalParts,
})},
{"OEBPS/Text/cover.xhtml", e.Render(TEMPLATE_TEXT, map[string]any{
"Id": "cover",
"Width": part.Cover.Width,
"Height": part.Cover.Height,
})},
{"OEBPS/Images/cover.jpg", part.Cover.Data},
}

View File

@ -22,8 +22,7 @@
<manifest>
<item id="ncx" href="toc.ncx" media-type="application/x-dtbncx+xml"/>
<item id="nav" href="nav.xhtml" properties="nav" media-type="application/xhtml+xml"/>
<item id="page_cover" href="Text/cover.xhtml" media-type="application/xhtml+xml"/>
<item id="img_cover" href="Images/cover.jpg" media-type="image/jpeg" properties="cover-image"/>
<item id="cover" href="Images/cover.jpg" media-type="image/jpeg" properties="cover-image"/>
<item id="page_part" href="Text/part.xhtml" media-type="application/xhtml+xml"/>
{{ range .Images }}
<item id="page_{{ .Id }}" href="Text/{{ .Id }}.xhtml" media-type="application/xhtml+xml"/>
@ -31,7 +30,6 @@
{{ end }}
</manifest>
<spine page-progression-direction="ltr" toc="ncx">
<itemref idref="page_cover" linear="yes" properties="page-spread-left"/>
<itemref idref="page_part" linear="yes" properties="page-spread-right"/>
{{ range $idx, $ := .Images }}
{{ if mod $idx 2 }}

View File

@ -8,12 +8,12 @@
<body>
<nav xmlns:epub="http://www.idpf.org/2007/ops" epub:type="toc" id="toc">
<ol>
<li><a href="Text/cover.xhtml">{{ .Info.Title }}</a></li>
<li><a href="Text/{{ .Image.Id }}.xhtml">{{ .Info.Title }}</a></li>
</ol>
</nav>
<nav epub:type="page-list">
<ol>
<li><a href="Text/cover.xhtml">{{ .Info.Title }}</a></li>
<li><a href="Text/{{ .Image.Id }}.xhtml">{{ .Info.Title }}</a></li>
</ol>
</nav>
</body>

View File

@ -7,7 +7,8 @@
<meta name="viewport" content="width={{ .Info.ViewWidth }}, height={{ .Info.ViewHeight }}"/>
</head>
<body style="">
<h1 style="text-align:center;top:0%;padding-top:50%;font-size:4em">
<div style="text-align:center;top:0.0%;">
<h1>
<p>
{{ .Info.Title }}
</p>
@ -15,5 +16,6 @@
Part {{ .Part }} / {{ .Total }}
</p>
</h1>
</div>
</body>
</html>