mirror of
https://github.com/standardebooks/web.git
synced 2025-07-14 18:42:00 -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);
|
||||
$subjectNavigationEntries = [];
|
||||
foreach($subjects as $subject){
|
||||
// We leave the updated timestamp blank, as it will be filled in when we generate the individaul feeds
|
||||
$subjectNavigationEntries[] = new OpdsNavigationEntry('/opds/subjects/' . Formatter::MakeUrlSafe($subject), 'subsection', 'navigation', null, $subject, 'Browse Standard Ebooks tagged with “' . strtolower($subject) . ',” most-recently-released first.');
|
||||
$summary = number_format(sizeof($ebooksBySubject[$subject])) . ' Standard Ebook';
|
||||
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->Save(WEB_ROOT . '/opds/subjects/index.xml');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue