Commit graph

2340 commits

Author SHA1 Message Date
Mike Colagrosso
03ed3c2257 Add Ebook::DownloadUrl for web and feed downloads
This commit adds a rewrite rule for ebook downloads of the form:

```
/ebooks/some-author/some-book/downloads/some-filename.epub
```

to `www/ebooks/download.php`. That file handles the logic of whether to
show a thank you page before beginning the download.

Download URLs in RSS, Atom, and OPDS feeds follow the same pattern, but
they have a query string parameter `?source=feed` to always skip the
thank you page.
2025-04-25 14:31:44 -05:00
Alex Cabal
1f41eb1e55 Don't remind editors about stalled or abandoned projects 2025-04-23 22:56:37 -05:00
Alex Cabal
de99d1869f Set placeholder to in progress when creating a project for an existing placeholder 2025-04-22 22:30:42 -05:00
Alex Cabal
c4c65b9181 Add Robert Frost spreadsheet to spreadsheets page 2025-04-20 23:13:15 -05:00
David
90d7ea4183 Update producing guide to point to obscured dashes para in manual 2025-04-18 11:22:07 -05:00
Alex Cabal
5d3419e209 Disable next spring drive and clean up some comments 2025-04-17 21:02:11 -05:00
Alex Cabal
4a999ebcec Reveal blog post 2025-04-15 10:57:56 -05:00
Alex Cabal
b74d7361a1 In deploy-ebook-to-www, only check for tsp if it's installed 2025-04-14 22:25:54 -05:00
Alex Cabal
ac7a9f3725 Update README with new site installation instructions, and use venvs in scripts 2025-04-14 10:47:15 -05:00
Alex Cabal
8c81e5b9d2 Catch exceptions if files don't exist 2025-04-14 10:46:54 -05:00
erin
3a2778cd77 Tweak wording in blog post 2025-04-11 20:48:42 -05:00
erin
f4230aeca4 Fix typos in blog post 2025-04-11 20:48:42 -05:00
Alex Cabal
93b55d2da2 Add Authors index 2025-04-09 21:33:59 -05:00
Alex Cabal
0e92b3acc8 Add text-wrap: pretty to core CSS 2025-04-09 20:42:41 -05:00
Alex Cabal
be256550ec Fix typos in blog post 2025-04-09 18:48:49 -05:00
Alex Cabal
fbfd4321e4 Fix height of tag select box in responsive ebook search form 2025-04-09 14:32:23 -05:00
Alex Cabal
48818ef928 Add blog post 2025-04-09 14:18:18 -05:00
Alex Cabal
2ac2cc3de2 Remove unneeded PHPStan ignore line 2025-04-07 22:51:35 -05:00
Alex Cabal
ee18651732 Fix new patron count in donation progress bar 2025-04-07 16:07:48 -05:00
Alex Cabal
ec4826bb41 Fix margin in donation banner for public domain day blog posts 2025-04-07 11:10:39 -05:00
Alex Cabal
c12e93b4e2 Tweak wording in blog post 2025-04-07 11:10:27 -05:00
Alex Cabal
b70f500847 Decrease minimum token count to 2 in InnoDB fulltext search 2025-04-02 15:46:36 -05:00
Alex Cabal
810087ccf9 Update OpenSearch features to current standards 2025-03-31 13:28:26 -05:00
Alex Cabal
7da87bf9e2 Use enums for HTTP methods in search forms 2025-03-31 12:05:32 -05:00
Alex Cabal
849276736e Move donwload rewrite rule after legacy ebook URL rewrites 2025-03-30 14:35:03 -05:00
Alex Cabal
fbcafb8f1d Improve type hints 2025-03-27 16:46:05 -05:00
Alex Cabal
f21783d1f8 PHPStan updates 2025-03-27 14:13:00 -05:00
Alex Cabal
613d035ebe Round border radius on ebook thumbnail link focus 2025-03-26 21:01:08 -05:00
Alex Cabal
de96695ac7 Add rewrite for The Giant Raft by Jules Verne 2025-03-26 14:50:12 -05:00
Mike Colagrosso
9202717a6b Add a special case for hyphens: Replace with space
See #484 for details. By adding a special case for hyphens, users can
search for these terms:

`beta` to match `Alpha-Beta`
`queen` to match `Haycraft-Queen`

These searches also work as expected:

`Alpha-Beta`
`Alpha`
`Haycraft-Queen`
`Haycraft`

I don't think these queries should work, and they do not:

`AlphaBeta`
`HaycraftQueen`

This commit changes `IndexableText`, `IndexableAuthors`, and
`IndexableCollections`, so existing DBs need an update. This will update
all published books:

```
cd /standardebooks.org/ebooks
for BOOK in $(find /standardebooks.org/ebooks -maxdepth 1 -type d)
do
  tsp nice /standardebooks.org/web/scripts/deploy-ebook-to-www --verbose --no-build --no-images --no-recompose --no-epubcheck --no-feeds --no-bulk-downloads "$BOOK"
done
```

And this PHP code will update placeholders:

```
<?
require_once('/standardebooks.org/web/lib/Core.php');

$ebooks = Ebook::GetAll();

foreach($ebooks as $ebook){
        if($ebook->IsPlaceholder()){
                print('Saving ' . $ebook->Identifier . "\n");

                // Need to force `Ebook::GetAllContributors()` to be called before `Ebook::Save()`. Otherwise, authors and translators will be deleted.
                $ebook->Authors;

                $ebook->Save();
        }
}
```
2025-03-25 13:16:25 -05:00
Mike Colagrosso
8a4da08a66 Remove non-alphanumerics (except quotes) from search query
That is, don't replace non-alphanumerics with a space. This matches the
behavior of Formatter::RemoveDiacriticsAndNonalphanumerics(), which
would be used here except that function would also remove quotes.  We
actually discussed not introducing spaces previously, but I made a
mistake and didn't apply the same change to the user's search query:

https://github.com/standardebooks/web/pull/470#discussion_r1929591492

This change fixes queries with compound words like:

`Haycraft-Queen`

and also fixes queries for authors with apostrophes:

`O'Neill`

No changes to existing DBs are necessary because they already have terms
like `haycraftqueen` and `oneill` stored in `IndexableCollections` and
`IndexableAuthors`.
2025-03-25 13:16:25 -05:00
Mike Colagrosso
dab857d127 Cast WordCount to string to fix PHPStan error 2025-03-25 13:10:53 -05:00
Alex Cabal
8a3a05a264 Ban ChatGPT user agents 2025-03-24 13:59:13 -05:00
Alex Cabal
ceccd1431e Fail quietly when updating projects with broken URLs instead of logging 2025-03-15 14:18:48 -05:00
Alex Cabal
ba22538659 Add new schema.org wordCount property to ebook view 2025-03-14 12:10:05 -05:00
Alex Cabal
18b462bb52 Fix typo in blog post 2025-03-12 15:01:22 -05:00
Alex Cabal
1385d4bf9f Reveal blog post 2025-03-12 11:44:10 -05:00
Alex Cabal
dc84ff3fa9 Style tweaks 2025-03-10 14:38:54 -05:00
Mike Colagrosso
af956b2714
Replace EbookUrl with EbookId in Artworks (#482)
* Replace `EbookUrl` with `EbookId` in `Artworks`

* Add a `FullUrl` member to `Ebook`

Add documentation about when to use it versus Url.

The full URL is also being used as an ID in RSS feeds, so use `FullUrl` there.

* Store an `EbookId` in `Artworks`
2025-03-10 14:33:20 -05:00
vr8hub
1b6d69c725 Clarify the files excluded from language check 2025-03-10 13:36:07 -05:00
Alex Cabal
5066252355 Use 'insert ... returning' instead of 'Db::GetLastInsertedId()' 2025-03-10 13:03:31 -05:00
Alex Cabal
4446b6d161 Add breadcrumb to new artwork form 2025-03-07 13:40:37 -06:00
Alex Cabal
9eff02db87 Add metadata section to artist page 2025-03-07 11:11:46 -06:00
Alex Cabal
34fd71e55a Tweak wording on delete artist page and add some more breadcrumbs 2025-03-07 10:37:56 -06:00
Alex Cabal
1136cfb2af Add artists rewrites to live site Apache config 2025-03-07 09:57:07 -06:00
Alex Cabal
e76be32463 Add comment 2025-03-07 09:55:54 -06:00
Mike Colagrosso
a91509726c
Add admin tool to handle duplicate artist names (#480) 2025-03-06 14:28:26 -06:00
Alex Cabal
576fcea0b1 Add blog post 2025-03-04 22:47:20 -06:00
Alex Cabal
124e8343fc Completely type hint template functions and switch to named arguments 2025-03-04 20:32:20 -06:00
Alex Cabal
6108b5e53d Tweak step by step guide spelling modernization tip 2025-03-03 14:49:38 -06:00