Commit graph

70 commits

Author SHA1 Message Date
erin
66c44cbdbe Uncomment call to chapter navigation footer script 2024-11-14 17:33:21 -06:00
Alex Cabal
d6a2bdcbc8 Make MARC roles an enum and restructure how contributors are fetched from the DB to reduce queries 2024-11-11 12:01:53 -06:00
Alex Cabal
06b82cdaaa Fix broken updated timestamps in OPDS feeds, and fix and add some type hints. 2024-11-08 12:43:47 -06:00
Mike Colagrosso
7253ad41ca Rename flag to --ebook-www-filesystem-path 2024-11-04 13:16:56 -06:00
Mike Colagrosso
e9a8c9f595 Don't call rebuild-cache library from deploy
Should have put this change in #384
2024-11-04 13:16:56 -06:00
Mike Colagrosso
fc4a509b0d Don't call update-ebook-database with verbose flag
`./scripts/update-ebook-database --verbose` should be for low-level debugging only
2024-11-04 13:16:56 -06:00
Mike Colagrosso
254bf8b3d7 Put shell variable in quotes 2024-11-04 13:16:56 -06:00
Mike Colagrosso
ccd73c7cb4 Initial script to insert/update Ebook records 2024-11-04 13:16:56 -06:00
Alex Cabal
4126db9c3e Remove references to unused script 2024-01-15 12:59:53 -06:00
Mike Colagrosso
6a5c05511a Add cover art database
Co-authored-by: Job Curtis <job.curtis@gmail.com>
Co-authored-by: Alex Cabal <alex@standardebooks.org>
2024-01-03 19:14:04 -06:00
Alex Sweet
b2777ee648 Add check for rsvg-convert 2024-01-01 20:21:37 -06:00
erin
fcda045958 Update navigation footer script in Python 2023-12-22 21:28:53 -06:00
Alex Cabal
689cd1c5c1 Tweak ebook deploy script to more reliably generate cover image thumbnails 2023-04-23 19:56:58 -05:00
Alex Cabal
9204262bab Minor style tweaks 2022-11-28 14:23:12 -06:00
Brandon
88e7f63486 Revert "Fix margin collapse issue" and adjust whitespace to compensate
This reverts commit a806fc41a8.
2022-11-28 14:18:27 -06:00
Brandon
13f15e34a1 Fix margin collapse issue 2022-11-28 14:18:27 -06:00
Brandon
537e14122f Wrap book contents in a <main> tag 2022-11-28 14:18:27 -06:00
Brandon
04cf6bce03 Add chapter navigation footer 2022-11-28 14:18:27 -06:00
Alex Cabal
6b5c4d8975 Add --quiet option when calling cavif 2022-09-19 10:39:33 -05:00
Robin Whittleton
71b675331a Fix AVIF images in iOS16 (and 8+ times speedup of AVIF generation)
iOS16 upholds AVIF standards more strictly than other renderers, which means that the current AVIF images on SE are broken. A fix for generation bug has been added to go-avif (https://github.com/Kagami/go-avif/pull/17) but we can do better.

This PR switches out the AVIF generation to cavif (https://github.com/kornelski/cavif-rs) which not only doesn’t suffer from the iOS16 but drops generation time by more than 8 times. For example, here’s a set of three timed runs in both go-avif and cavif on the title card of https://standardebooks.org/ebooks/jonathan-dymond/an-inquiry-into-the-accordancy-of-war-with-the-principles-of-christianity:

```
root@f58fb0beac90:/standardebooks.org/web/scripts# time ./go-avif -e "illustration.jpg" -o "illustration-go-1.avif" --best

real	0m31.191s
user	1m39.113s
sys	0m1.662s
root@f58fb0beac90:/standardebooks.org/web/scripts# time ./go-avif -e "illustration.jpg" -o "illustration-go-2.avif" --best

real	0m33.097s
user	1m49.846s
sys	0m0.831s
root@f58fb0beac90:/standardebooks.org/web/scripts# time ./go-avif -e "illustration.jpg" -o "illustration-go-3.avif" --best

real	0m36.963s
user	2m4.235s
sys	0m0.711s

root@f58fb0beac90:/standardebooks.org/web/scripts# time ./cavif --quality 50 "illustration.jpg" -o "illustration-cavif-1.avif"
illustration-cavif-1.avif: 98KB (96840B color, 0B alpha, 242B HEIF)

real	0m4.017s
user	0m11.600s
sys	0m0.051s
root@f58fb0beac90:/standardebooks.org/web/scripts# time ./cavif --quality 50 "illustration.jpg" -o "illustration-cavif-2.avif"
illustration-cavif-2.avif: 98KB (96840B color, 0B alpha, 242B HEIF)

real	0m4.083s
user	0m11.857s
sys	0m0.091s
root@f58fb0beac90:/standardebooks.org/web/scripts# time ./cavif --quality 50 "illustration.jpg" -o "illustration-cavif-3.avif"
illustration-cavif-3.avif: 98KB (96840B color, 0B alpha, 242B HEIF)

real	0m4.237s
user	0m12.339s
sys	0m0.093s
```

The executable has been generated via cargo, and has the following qualities:

```
root@f58fb0beac90:/standardebooks.org/web/scripts# file cavif
cavif: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=f972071996c58b7a855d04e4c5804f4a3d94f575, for GNU/Linux 3.2.0, with debug_info, not stripped
```

I’m not sure how cavif’s quality 50 matches go-avif’s best flag, but they produce similar file sizes and similar visual quality.

There is a slight different in apparent colour space. If this is an issue there are tweaks, but according to the documentation it makes files larger so should be avoided. Given that the titlecards will matches the covers I see no reason to go down that path.
2022-09-18 22:01:26 +02:00
Alex Cabal
6543658e45 Tweak output in deploy ebook script 2022-07-15 10:54:15 -05:00
Alex Cabal
e857e4e9e6 Rebuild web caches immediately on ebook updates 2022-07-14 15:28:57 -05:00
Alex Cabal
4baea8536d chown/chmod files during deploy within their correct scripts, instead of in the parent deploy script 2022-07-13 11:25:06 -05:00
Alex Cabal
a9aa560dd3 Don't refresh caches when deploying ebooks if there are more items in the build queue 2022-07-13 02:44:44 -05:00
Alex Cabal
4300619383 Normalize contents of webroot variables 2022-07-09 20:09:39 -05:00
Alex Cabal
f9fd6c8a02 Further refinment to OPDS/RSS generation and also add Atom feeds 2022-06-23 21:27:25 -05:00
Alex Cabal
ae79fc1f36 Add --no-feeds argument to deploy script 2022-06-22 15:09:05 -05:00
Alex Cabal
f6df03cfca Flesh out OPDS generation backend to be more robust and to support generic Atom feeds 2022-06-22 15:09:05 -05:00
Alex Cabal
70a80d0e02 Add system to retrieve and manage donations in a local database 2022-06-20 14:05:27 -05:00
Alex Cabal
ac812085db Update deploy-ebook-to-www to prevent it from destroying the new releases XML file if there's an error in an ebook 2021-10-08 20:01:55 -05:00
Alex Cabal
a2f7517e08 Tweak in-book CSS and add details link to single-page book view 2021-07-27 16:04:05 -05:00
Robin Whittleton
c6a0cfcd6f Add a link back to the ebook page to nav bar 2021-07-27 15:45:14 -05:00
Robin Whittleton
d6ea6855df Make the link to the ToC absolute instead of relative 2021-07-27 15:45:14 -05:00
Robin Whittleton
8a13046496 Add basic nav bars to web versions of the books
These are fixed on (portrait) tablet and mobile, static on desktop.
2021-07-27 15:45:14 -05:00
Robin Whittleton
b60d795e82 Fix adding nofollows on sponsored single-page colophons 2021-07-27 15:45:14 -05:00
Alex Cabal
2a1225ca53 Update pages and processes to match 2.0.0 toolset 2021-06-03 19:03:10 -05:00
Alex Cabal
5914f9425b Add rel="nofollow" to sponsored links in the colophon 2021-03-31 17:30:52 -05:00
Alex Cabal
e0f37b626c Replace some hard-coded paths with variables 2021-03-14 11:33:51 -05:00
Alex Cabal
991fd61d72 Fix deploy-ebook-to-www script to correctly check if cover image needs to be built 2021-02-23 17:14:39 -06:00
Alex Cabal
d52bba5aa1 Update ebook deploy script to always generate covers/downloads if they don't yet exist, even with --last-push-hash 2021-01-25 18:15:15 -06:00
Alex Cabal
73ba658a05 Update ebooks to explode the ./src/epub folder into ebook endpoints, instead of just exploding the whole epub 2020-10-13 14:28:32 -05:00
Alex Cabal
d3c1382490 Add --no-build and --no-recompose options to ebook deploy script 2020-10-12 14:09:40 -05:00
Alex Cabal
262e86c625 Enable reading from the ToC and single-page reading 2020-10-11 13:39:32 -05:00
Alex Cabal
dd43efd450 Add --no-epubcheck option to deploy-ebook-to-www script 2020-08-29 14:43:10 -05:00
Alex Cabal
73297adbf7 Add --last-push-hash option to deploy-ebook-to-www script to decide whether to rebuild the cover images/actual ebook 2020-08-27 11:15:19 -05:00
Alex Cabal
557feded5e Update deploy script to remove librsvg dependency, better organize code, and add the --no-images option 2020-08-09 15:51:22 -05:00
Alex Cabal
80f22cb463 Correct size of ebook cover thumbnails and hero images 2020-08-07 15:07:06 -05:00
Alex Cabal
1ab7c8c0fe Add support for AVIF covers, and multiple image source sets in covers 2020-08-06 17:03:39 -05:00
Alex Cabal
cb399a4657 Update permissions set in deploy-ebook-to-www 2020-06-25 20:11:19 -05:00
Alex Cabal
133f93cdce Add subjects OPDS feeds, and switch to a more object-oriented approach to generating the OPDS feeds 2020-06-25 13:07:00 -05:00