part is the first page

This commit is contained in:
Celogeek 2022-12-30 14:18:21 +01:00
parent 37478be0d9
commit b7c783aec5
Signed by: celogeek
GPG Key ID: E6B7BDCFC446233A
3 changed files with 5 additions and 5 deletions

View File

@ -156,8 +156,8 @@ func (e *ePub) Write() error {
content := []zipContent{
{"META-INF/container.xml", containerTmpl},
{"OEBPS/content.opf", e.render(contentTmpl, map[string]any{"Info": e, "Images": part.Images})},
{"OEBPS/toc.ncx", e.render(tocTmpl, map[string]any{"Info": e, "Image": part.Images[0]})},
{"OEBPS/nav.xhtml", e.render(navTmpl, map[string]any{"Info": e, "Image": part.Images[0]})},
{"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},
{"OEBPS/Text/part.xhtml", e.render(partTmpl, map[string]any{
"Info": e,

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/{{ .Image.Id }}.xhtml">{{ .Info.Title }}</a></li>
<li><a href="Text/part.xhtml">{{ .Info.Title }}</a></li>
</ol>
</nav>
<nav epub:type="page-list">
<ol>
<li><a href="Text/{{ .Image.Id }}.xhtml">{{ .Info.Title }}</a></li>
<li><a href="Text/part.xhtml">{{ .Info.Title }}</a></li>
</ol>
</nav>
</body>

View File

@ -9,6 +9,6 @@
</head>
<docTitle><text>{{ .Info.Title }}</text></docTitle>
<navMap>
<navPoint id="Text"><navLabel><text>{{ .Info.Title }}</text></navLabel><content src="Text/{{ .Image.Id }}.xhtml"/></navPoint>
<navPoint id="Text"><navLabel><text>{{ .Info.Title }}</text></navLabel><content src="Text/part.xhtml"/></navPoint>
</navMap>
</ncx>