mirror of
https://github.com/standardebooks/web.git
synced 2025-07-15 10:56:46 -04:00
Change OPDS feed to show number of ebooks in each subject category, and a 'related' link back to the ebook's SE homepage
This commit is contained in:
parent
53f1e7ab29
commit
75e7cce726
2 changed files with 9 additions and 2 deletions
|
@ -43,8 +43,14 @@ foreach($contentFiles as $path){
|
||||||
sort($subjects);
|
sort($subjects);
|
||||||
$subjectNavigationEntries = [];
|
$subjectNavigationEntries = [];
|
||||||
foreach($subjects as $subject){
|
foreach($subjects as $subject){
|
||||||
// We leave the updated timestamp blank, as it will be filled in when we generate the individaul feeds
|
$summary = number_format(sizeof($ebooksBySubject[$subject])) . ' Standard Ebook';
|
||||||
$subjectNavigationEntries[] = new OpdsNavigationEntry('/opds/subjects/' . Formatter::MakeUrlSafe($subject), 'subsection', 'navigation', null, $subject, 'Browse Standard Ebooks tagged with “' . strtolower($subject) . ',” most-recently-released first.');
|
if(sizeof($ebooksBySubject[$subject]) != 1){
|
||||||
|
$summary .= 's';
|
||||||
|
}
|
||||||
|
$summary .= ' tagged with “' . strtolower($subject) . ',” most-recently-released first.';
|
||||||
|
|
||||||
|
// We leave the updated timestamp blank, as it will be filled in when we generate the individual feeds
|
||||||
|
$subjectNavigationEntries[] = new OpdsNavigationEntry('/opds/subjects/' . Formatter::MakeUrlSafe($subject), 'subsection', 'navigation', null, $subject, $summary);
|
||||||
}
|
}
|
||||||
$subjectsFeed = new OpdsNavigationFeed('/opds/subjects', 'Standard Ebooks by Subject', '/opds', $subjectNavigationEntries);
|
$subjectsFeed = new OpdsNavigationFeed('/opds/subjects', 'Standard Ebooks by Subject', '/opds', $subjectNavigationEntries);
|
||||||
$subjectsFeed->Save(WEB_ROOT . '/opds/subjects/index.xml');
|
$subjectsFeed->Save(WEB_ROOT . '/opds/subjects/index.xml');
|
||||||
|
|
|
@ -24,6 +24,7 @@
|
||||||
<? } ?>
|
<? } ?>
|
||||||
<link href="<?= $ebook->Url ?>/dist/cover.jpg" rel="http://opds-spec.org/image" type="image/jpeg"/>
|
<link href="<?= $ebook->Url ?>/dist/cover.jpg" rel="http://opds-spec.org/image" type="image/jpeg"/>
|
||||||
<link href="<?= $ebook->Url ?>/dist/cover-thumbnail.jpg" rel="http://opds-spec.org/image/thumbnail" type="image/jpeg"/>
|
<link href="<?= $ebook->Url ?>/dist/cover-thumbnail.jpg" rel="http://opds-spec.org/image/thumbnail" type="image/jpeg"/>
|
||||||
|
<link href="<?= $ebook->Url ?>" rel="related" type="text/html" title="This ebook’s page at Standard Ebooks"/>
|
||||||
<link href="<?= $ebook->EpubUrl ?>" rel="http://opds-spec.org/acquisition/open-access" type="application/epub+zip" title="Recommended compatible epub"/>
|
<link href="<?= $ebook->EpubUrl ?>" rel="http://opds-spec.org/acquisition/open-access" type="application/epub+zip" title="Recommended compatible epub"/>
|
||||||
<link href="<?= $ebook->Epub3Url ?>" rel="http://opds-spec.org/acquisition/open-access" type="application/epub+zip" title="epub"/>
|
<link href="<?= $ebook->Epub3Url ?>" rel="http://opds-spec.org/acquisition/open-access" type="application/epub+zip" title="epub"/>
|
||||||
<link href="<?= $ebook->KepubUrl ?>" rel="http://opds-spec.org/acquisition/open-access" type="application/kepub+zip" title="Kobo Kepub epub"/>
|
<link href="<?= $ebook->KepubUrl ?>" rel="http://opds-spec.org/acquisition/open-access" type="application/kepub+zip" title="Kobo Kepub epub"/>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue