Skip to content

Commit 883d22c

Browse files
committed
merge
2 parents 46396c5 + 1d45135 commit 883d22c

File tree

14 files changed

+2908
-622
lines changed

14 files changed

+2908
-622
lines changed

CHANGELOG.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,20 @@ project adheres to [Semantic Versioning](http://semver.org/).
99
## [0.2.0] - Unreleased
1010
### Changed
1111
- Support Lume 3.
12+
## [0.1.3] - 2024-12-31
13+
### Added
14+
- Footnotes support.
15+
16+
### Changed
17+
- Use *A esmorga* as demo book.
18+
19+
### Fixed
20+
- H1 margin top.
21+
22+
## [0.1.2] - 2024-12-25
23+
### Fixed
24+
- CSS compatibility for old browsers
25+
- Page title
1226

1327
## [0.1.1] - 2024-12-24
1428
### Fixed
@@ -17,6 +31,11 @@ project adheres to [Semantic Versioning](http://semver.org/).
1731
## [0.1.0] - 2024-12-24
1832
First version
1933

34+
<<<<<<< HEAD
2035
[0.2.0]: https://github.com/lumeland/theme-ebook/compare/v0.1.1...HEAD
36+
=======
37+
[0.1.3]: https://github.com/lumeland/theme-ebook/compare/v0.1.2...v0.1.3
38+
[0.1.2]: https://github.com/lumeland/theme-ebook/compare/v0.1.1...v0.1.2
39+
>>>>>>> 1d4513562d3b71bdec1cf0d46d31ff8c6d36710b
2140
[0.1.1]: https://github.com/lumeland/theme-ebook/compare/v0.1.0...v0.1.1
2241
[0.1.0]: https://github.com/lumeland/theme-ebook/releases/tag/v0.1.0

plugins.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import postcss from "lume/plugins/postcss.ts";
1+
import lightningcss from "lume/plugins/lightningcss.ts";
22
import basePath from "lume/plugins/base_path.ts";
33
import metas from "lume/plugins/metas.ts";
44
import prism from "lume/plugins/prism.ts";
@@ -9,6 +9,7 @@ import {
99
Options as GoogleFontsOptions,
1010
} from "lume/plugins/google_fonts.ts";
1111
import toc from "https://deno.land/x/[email protected]/toc.ts";
12+
import footnotes from "https://deno.land/x/[email protected]/footnotes.ts";
1213
import { merge } from "lume/core/utils/object.ts";
1314

1415
import "lume/types.ts";
@@ -38,7 +39,7 @@ export default function (userOptions?: Options) {
3839

3940
return (site: Lume.Site) => {
4041
site
41-
.use(postcss())
42+
.use(lightningcss())
4243
.use(basePath())
4344
.use(metas())
4445
.use(sitemap(options.sitemap))
@@ -49,6 +50,7 @@ export default function (userOptions?: Options) {
4950
level: 1,
5051
}))
5152
.add("scripts")
53+
.use(footnotes())
5254
.data("layout", "layouts/book.vto")
5355
.add("img")
5456
.add([".css"])

src/_data.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
lang: gl
22

3-
title: Follas novas
4-
description: Versos en Gallego
5-
author: Rosalía de Castro
3+
title: A esmorga
4+
description: Relato tráxico dunha destrutiva peripecia polos arrabaldos de Auria.
5+
author: Eduardo Blanco Amor
66
cover: /img/cover.jpg
77

88
metas:

src/_includes/css/book.css

Lines changed: 54 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,9 @@
2727
}
2828
h1 {
2929
font-size: 2.5em;
30-
margin-top: var(--column-height);
30+
margin-top: calc(var(--column-height) / 5);
31+
break-before: always;
32+
break-inside: avoid;
3133
}
3234
h2 {
3335
font-size: 1.75em;
@@ -220,3 +222,54 @@
220222
}
221223
}
222224
}
225+
226+
.footnotes {
227+
font-size: 0.85em;
228+
229+
& > dl {
230+
margin: 0;
231+
232+
& > div {
233+
padding: 0.5em;
234+
235+
&:target {
236+
outline: 1px dashed var(--color-spot);
237+
}
238+
239+
& + div {
240+
margin-top: 0.5em;
241+
}
242+
}
243+
}
244+
245+
& dt {
246+
float: left;
247+
margin-right: 1em;
248+
font-weight: bold;
249+
250+
& a {
251+
text-decoration: none;
252+
color: var(--color-text);
253+
254+
&:hover {
255+
text-decoration: underline;
256+
}
257+
}
258+
}
259+
260+
& dd {
261+
margin: 0;
262+
padding-left: 2em;
263+
264+
& p {
265+
margin: 0.25em 0;
266+
}
267+
268+
& > :first-child {
269+
margin-top: 0;
270+
}
271+
& > :last-child {
272+
margin-bottom: 0;
273+
}
274+
}
275+
}

src/_includes/layouts/book.vto

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
content="black-translucent"
1313
>
1414

15-
<title> by {{ author }}</title>
15+
<title>{{ title }} by {{ author }}</title>
1616
<link rel="stylesheet" href="/styles.css">
1717
<script type="module" src="/scripts/invoker.js"></script>
1818
<script type="module" src="/scripts/main.js"></script>
@@ -118,6 +118,19 @@
118118
119119
{{ content }}
120120
121+
{{ if it.footnotes.length }}
122+
<aside role="note" class="page footnotes">
123+
<dl>
124+
{{ for note of footnotes }}
125+
<div id="{{ note.id }}" class="footnote">
126+
<dt><a href="#{{ note.refId }}">{{ note.label }}</a></dt>
127+
<dd>{{ note.content }}</dd>
128+
</div>
129+
{{ /for }}
130+
</dl>
131+
</aside>
132+
{{ /if }}
133+
121134
{{ set nextPage = search.nextPage(url, "", "url") }}
122135
123136
{{ if nextPage }}

0 commit comments

Comments
 (0)