diff --git a/config/apache/standardebooks.org.conf b/config/apache/standardebooks.org.conf index fedf59ff..5e8644ae 100644 --- a/config/apache/standardebooks.org.conf +++ b/config/apache/standardebooks.org.conf @@ -246,9 +246,11 @@ Define webroot /standardebooks.org/web RewriteRule ^/ebooks/([^\./]+?)$ /ebooks/author.php?url-path=$1 [QSA] RewriteRule ^/ebooks/([^\./]+?)/downloads$ /bulk-downloads/get.php?author=$1 [QSA] + RewriteRule ^/ebooks/([^\./]+?)/feeds$ /feeds/get.php?author=$1 [QSA] RewriteRule ^/subjects/([^\./]+?)$ /ebooks/index.php?tags[]=$1 [QSA] RewriteRule ^/collections/([^\./]+?)$ /ebooks/index.php?collection=$1 [QSA] RewriteRule ^/collections/([^/]+?)/downloads$ /bulk-downloads/get.php?collection=$1 + RewriteRule ^/collections/([^/]+?)/feeds$ /feeds/get.php?collection=$1 # Prevent this rule from firing if we're getting a distribution file RewriteCond %{REQUEST_FILENAME} !^/ebooks/.+?/downloads/.+$ diff --git a/config/apache/standardebooks.test.conf b/config/apache/standardebooks.test.conf index 593ce8eb..80affa53 100644 --- a/config/apache/standardebooks.test.conf +++ b/config/apache/standardebooks.test.conf @@ -228,9 +228,11 @@ Define webroot /standardebooks.org/web RewriteRule ^/ebooks/([^\./]+?)$ /ebooks/author.php?url-path=$1 [QSA] RewriteRule ^/ebooks/([^\./]+?)/downloads$ /bulk-downloads/get.php?author=$1 [QSA] + RewriteRule ^/ebooks/([^\./]+?)/feeds$ /feeds/get.php?author=$1 [QSA] RewriteRule ^/subjects/([^\./]+?)$ /ebooks/index.php?tags[]=$1 [QSA] RewriteRule ^/collections/([^\./]+?)$ /ebooks/index.php?collection=$1 [QSA] RewriteRule ^/collections/([^/]+?)/downloads$ /bulk-downloads/get.php?collection=$1 + RewriteRule ^/collections/([^/]+?)/feeds$ /feeds/get.php?collection=$1 # Prevent this rule from firing if we're getting a distribution file RewriteCond %{REQUEST_FILENAME} !^/ebooks/.+?/downloads/.+$ diff --git a/lib/OpdsNavigationEntry.php b/lib/OpdsNavigationEntry.php index 50f74dc4..a56a36ee 100644 --- a/lib/OpdsNavigationEntry.php +++ b/lib/OpdsNavigationEntry.php @@ -7,6 +7,7 @@ class OpdsNavigationEntry{ public $Updated; public $Description; public $Title; + public $SortTitle; public function __construct(string $title, string $description, string $url, ?DateTime $updated, string $rel, string $type){ $this->Id = SITE_URL . $url; diff --git a/scripts/generate-feeds b/scripts/generate-feeds index 7a825c84..4df034f5 100755 --- a/scripts/generate-feeds +++ b/scripts/generate-feeds @@ -38,10 +38,12 @@ function CreateOpdsCollectionFeed(string $name, string $url, string $description // Create the collections navigation document $collectionNavigationEntries = []; foreach($collections as $collection){ - $collectionNavigationEntries[] = new OpdsNavigationEntry($collection['name'], str_replace('%s', $collection['name'], $description), $url . '/' . $collection['id'], $now, 'subsection', 'navigation'); + $entry = new OpdsNavigationEntry($collection['name'], str_replace('%s', $collection['name'], $description), $url . '/' . $collection['id'], $now, 'subsection', 'navigation'); + $entry->SortTitle = $collection['sortedname']; + $collectionNavigationEntries[] = $entry; } $collectionsFeed = new OpdsNavigationFeed('Standard Ebooks by ' . ucfirst($name), 'Browse Standard Ebooks by ' . $name . '.', $url, $webRoot . $url . '/index.xml', $collectionNavigationEntries, $opdsRoot); - $collectionsFeed->Subtitle = 'Browse Standard Ebooks by collection.'; + $collectionsFeed->Subtitle = 'Browse Standard Ebooks by ' . $name . '.'; SaveFeed($collectionsFeed, $force, null, null, $now); // Now generate each individual collection feed @@ -49,7 +51,7 @@ function CreateOpdsCollectionFeed(string $name, string $url, string $description $id = basename($collectionNavigationEntry->Id); usort($ebooks[$id], 'SortByUpdatedDesc'); $collectionFeed = new OpdsAcquisitionFeed($collectionNavigationEntry->Title . ' Ebooks', $collectionNavigationEntry->Description, $url . '/' . $id, $webRoot . $url . '/' . $id . '.xml', $ebooks[$id], $collectionsFeed); - SaveFeed($collectionFeed, $force, null, null, $now); + SaveFeed($collectionFeed, $force, $collectionNavigationEntry->Title, $collectionNavigationEntry->SortTitle, $now); } } diff --git a/templates/FeedHowTo.php b/templates/FeedHowTo.php index b5da1966..54842d60 100644 --- a/templates/FeedHowTo.php +++ b/templates/FeedHowTo.php @@ -1,21 +1,12 @@

Accessing the feeds

-

Our New Releases feeds are accessible by the public. Access to our other, more detailed feeds is available to our Patrons Circle supporters and our corporate sponsors.

-

If you’re a Patrons Circle member, when prompted enter your email address and leave the password field blank to access a feed.

-
-

Access for individuals

- -
-
-

Access for organizations and projects

- -
+

Our New Releases feeds are open to everyone. Our other feeds are a benefit of Patrons Circle membership.

+ +

If you’re a Patrons Circle member, when prompted enter your email address and leave the password field blank to access a feed.

diff --git a/www/css/core.css b/www/css/core.css index 84713744..56d31722 100644 --- a/www/css/core.css +++ b/www/css/core.css @@ -2352,13 +2352,43 @@ h1.is-collection{ margin-bottom: 1rem; } -.download-collection{ +.ebooks-toolbar{ display: flex; - justify-content: center; + justify-content: flex-end; margin-bottom: 4rem; border-bottom: 1px dashed var(--sub-text); padding-bottom: 1rem; font-style: italic; + gap: 1rem; +} + +.ebooks-toolbar a{ + padding: .5rem 1rem; + padding-left: .75rem; + text-decoration: none; +} + +.ebooks-toolbar a.button{ + /*font-family: "Crimson Pro", Georgia, serif;*/ + font-size: .75rem; + display: inline-flex; + gap: .75rem; + align-items: center; + font-weight: bold; +} + +.ebooks-toolbar a.button::before{ + font-family: "Fork Awesome"; + display: inline-block; + font-size: 1rem; +} + +.ebooks-toolbar a.button[href*="/downloads"]::before{ + content: "\f019"; +} + +.ebooks-toolbar a.button[href*="/feeds"]::before{ + content: "\f143"; } abbr.acronym{ @@ -3099,6 +3129,15 @@ ul.feed p{ white-space: normal; margin: 0 10px; } + + + .ebooks-toolbar{ + } + .ebooks-toolbar a.button{ + font-size: 0; + gap: 0; + padding: .5rem .75rem; + } } @media(max-width: 680px){ diff --git a/www/ebooks/author.php b/www/ebooks/author.php index 411fb038..3a3b97c9 100644 --- a/www/ebooks/author.php +++ b/www/ebooks/author.php @@ -23,10 +23,11 @@ catch(Exceptions\InvalidAuthorException $ex){ } ?> 'Ebooks by ' . strip_tags($ebooks[0]->AuthorsHtml), 'highlight' => 'ebooks', 'description' => 'All of the Standard Ebooks ebooks by ' . strip_tags($ebooks[0]->AuthorsHtml)]) ?>
- 1){ ?> class="is-collection">Ebooks by AuthorsHtml ?> - 1){ ?> -

Download all ebooks in this collection

- +

Ebooks by AuthorsHtml ?>

+

+ Download collection + Author feeds +

$ebooks, 'view' => VIEW_GRID]) ?>

We also have bulk ebook downloads available, as well as ebook catalog feeds for use directly in your ereader app or RSS reader.

diff --git a/www/ebooks/index.php b/www/ebooks/index.php index 22825407..c3321287 100644 --- a/www/ebooks/index.php +++ b/www/ebooks/index.php @@ -118,7 +118,7 @@ catch(Exceptions\InvalidCollectionException $ex){ } ?> $pageTitle, 'highlight' => 'ebooks', 'description' => $pageDescription]) ?>
- 1){ ?> class="is-collection"> + class="is-collection"> @@ -127,8 +127,11 @@ catch(Exceptions\InvalidCollectionException $ex){ $query, 'tags' => $tags, 'sort' => $sort, 'view' => $view, 'perPage' => $perPage]) ?> - 1){ ?> -

Download all ebooks in this collection

+ +

+ Download collection + Collection feeds +

No ebooks matched your filters. You can try different filters, or browse all of our ebooks.

diff --git a/www/feeds/401.php b/www/feeds/401.php index def1babb..d62b2801 100644 --- a/www/feeds/401.php +++ b/www/feeds/401.php @@ -42,18 +42,9 @@ if($type == 'atom'){ - -

OPDS feeds, or “catalogs,” can be added to ereading apps on phones and tablets to search, browse, and download from our entire catalog, directly in your ereader. Most modern ereading apps support OPDS catalogs.

-

They’re also perfect for scripting, or for libraries or other organizations who wish to download and process our catalog of ebooks.

- -

RSS feeds are the predecessors of Atom feeds. They contain less information than Atom feeds, but might be better supported by some news readers.

- -

Atom feeds can be read by one of the many RSS clients available for download, like Thunderbird. They contain more information than regular RSS feeds. Most RSS clients can read both Atom and RSS feeds.

-

Note that some RSS readers may show these feeds ordered by when an ebook was last updated, even though the feeds are ordered by when an ebook was first released. You should be able to change the sort order in your RSS reader.

-
diff --git a/www/feeds/atom/index.php b/www/feeds/atom/index.php index cca73b7e..1b0df25b 100644 --- a/www/feeds/atom/index.php +++ b/www/feeds/atom/index.php @@ -9,7 +9,7 @@ require_once('Core.php');

Note that some RSS readers may show these feeds ordered by when an ebook was last updated, even though the feeds are ordered by when an ebook was first released. You should be able to change the sort order in your RSS reader.

-

General feeds

+

General Atom feeds

  • New releases (Public)

    @@ -24,7 +24,7 @@ require_once('Core.php');
-

Feeds by topic

+

Atom feeds by topic

  • Feeds by author

    diff --git a/www/feeds/get.php b/www/feeds/get.php new file mode 100644 index 00000000..5dcadbd5 --- /dev/null +++ b/www/feeds/get.php @@ -0,0 +1,75 @@ + $title, 'description' => $description]) ?> +
    +
    +

    Ebook Feeds for

    + + +
    +

    RSS 2.0Atom 1.0OPDS 1.2 Feed

    + +

    Import this feed into your ereader app to get access to these ebooks directly in your ereader.

    + + +

    Get updates in your RSS client whenever a new ebook is released, or parse this feed for easy scripting.

    + + +

    The predecessor of Atom, compatible with most RSS clients.

    + +
      +
    • +

      +

      https://Email) ?>@/feeds///

      +
    • +
    +
    + +
    +
    + diff --git a/www/feeds/index.php b/www/feeds/index.php index c61b66f5..eb487625 100644 --- a/www/feeds/index.php +++ b/www/feeds/index.php @@ -14,8 +14,9 @@ require_once('Core.php');

    OPDS 1.2 feeds

    -

    OPDS feeds, or “catalogs,” can be added to ereading apps on phones and tablets to search, browse, and download from our entire catalog, directly in your ereader. Most modern ereading apps support OPDS catalogs.

    +

    OPDS feeds, or “catalogs,” can be added to ereading apps on phones and tablets to search, browse, and download from our ebook catalog, directly in your ereader. Most modern ereading apps support OPDS catalogs.

    They’re also perfect for scripting, or for libraries or other organizations who wish to download, process, and keep up to date with our catalog of ebooks.

    +

    To connect your ereading app to our catalog, enter the URL below when prompted by your app:

    • The Standard Ebooks OPDS feed

      diff --git a/www/feeds/rss/index.php b/www/feeds/rss/index.php index 2d801d6c..2ac45609 100644 --- a/www/feeds/rss/index.php +++ b/www/feeds/rss/index.php @@ -8,7 +8,7 @@ require_once('Core.php');

      RSS feeds are the predecessors of Atom feeds. They contain less information than Atom feeds, but might be better supported by some news readers.

      -

      General feeds

      +

      General RSS feeds

      • New releases (Public)

        @@ -23,7 +23,7 @@ require_once('Core.php');
      -

      Feeds by topic

      +

      RSS feeds by topic

      • Feeds by author

        diff --git a/www/fonts/fork-awesome-subset.woff2 b/www/fonts/fork-awesome-subset.woff2 index 6f3662f8..d36dfdb7 100644 Binary files a/www/fonts/fork-awesome-subset.woff2 and b/www/fonts/fork-awesome-subset.woff2 differ