mirror of
https://github.com/standardebooks/web.git
synced 2025-07-18 04:16:38 -04:00
Update OpenSearch features to current standards
This commit is contained in:
parent
7da87bf9e2
commit
810087ccf9
14 changed files with 23 additions and 17 deletions
|
@ -26,7 +26,7 @@ print("<?xml version=\"1.0\" encoding=\"utf-8\"?>\n");
|
|||
<name>Standard Ebooks</name>
|
||||
<uri><?= SITE_URL ?></uri>
|
||||
</author>
|
||||
<link href="<?= SITE_URL ?>/ebooks/opensearch" rel="search" type="application/opensearchdescription+xml" />
|
||||
<link href="<?= SITE_URL ?>/opensearch" rel="search" type="application/opensearchdescription+xml" title="Standard Ebooks"/>
|
||||
<? foreach($entries as $entry){ ?>
|
||||
<?= Template::AtomFeedEntry(entry: $entry) ?>
|
||||
<? } ?>
|
||||
|
|
|
@ -46,8 +46,7 @@ if(!$isErrorPage){
|
|||
if(!$isXslt){
|
||||
if(!$isSafari){
|
||||
header('content-type: application/xhtml+xml; charset=utf-8');
|
||||
print('<?xml version="1.0" encoding="utf-8"?>');
|
||||
print("\n");
|
||||
print("<?xml version=\"1.0\" encoding=\"utf-8\"?>\n");
|
||||
}
|
||||
print("<!DOCTYPE html>\n");
|
||||
}
|
||||
|
@ -100,8 +99,7 @@ if(!$isXslt){
|
|||
<link rel="alternate" type="application/atom+xml;profile=opds-catalog;kind=acquisition" title="<?= Formatter::EscapeHtml($feedTitle) ?>" href="/feeds/opds<?= Formatter::EscapeHtml($feedUrl) ?>"/>
|
||||
<link rel="alternate" type="application/rss+xml" title="<?= Formatter::EscapeHtml($feedTitle) ?>" href="/feeds/rss<?= Formatter::EscapeHtml($feedUrl) ?>"/>
|
||||
<? } ?>
|
||||
<link rel="search" href="/ebooks" type="application/xhtml+xml; charset=utf-8"/>
|
||||
<link rel="search" href="/ebooks/opensearch" type="application/opensearchdescription+xml; charset=utf-8"/>
|
||||
<link rel="search" href="<?= SITE_URL ?>/opensearch" type="application/opensearchdescription+xml" title="Standard Ebooks"/><? // Firefox will show this as `Search with Standard Ebooks`. Can't include `charset` in the MIME type because Chrome will refuse it. ?>
|
||||
<? if(!$isErrorPage){ ?>
|
||||
<meta content="#394451" name="theme-color"/>
|
||||
<meta content="<? if($title !== null){ ?><?= Formatter::EscapeHtml($title) ?><? }else{ ?>Standard Ebooks<? } ?>" property="og:title"/>
|
||||
|
|
|
@ -30,7 +30,7 @@ print("<?xml version=\"1.0\" encoding=\"utf-8\"?>\n");
|
|||
<link href="<?= SITE_URL ?>/feeds/opds" rel="start" type="application/atom+xml;profile=opds-catalog;kind=navigation; charset=utf-8"/>
|
||||
<link href="<?= SITE_URL ?><?= Formatter::EscapeXml($parentUrl) ?>" rel="up" type="application/atom+xml;profile=opds-catalog;kind=navigation; charset=utf-8"/>
|
||||
<link href="<?= SITE_URL ?>/feeds/opds/all" rel="http://opds-spec.org/crawlable" type="application/atom+xml;profile=opds-catalog;kind=acquisition; charset=utf-8"/>
|
||||
<link href="<?= SITE_URL ?>/ebooks/opensearch" rel="search" type="application/opensearchdescription+xml; charset=utf-8"/>
|
||||
<link href="<?= SITE_URL ?>/opensearch" rel="search" type="application/opensearchdescription+xml" title="Standard Ebooks"/>
|
||||
<title><?= Formatter::EscapeXml($title) ?></title>
|
||||
<? if($subtitle !== null){ ?>
|
||||
<subtitle><?= Formatter::EscapeXml($subtitle) ?></subtitle>
|
||||
|
|
|
@ -21,7 +21,7 @@ print("<?xml version=\"1.0\" encoding=\"utf-8\"?>\n");
|
|||
<link href="<?= SITE_URL . Formatter::EscapeXml($url) ?>" rel="self" type="application/atom+xml;profile=opds-catalog;kind=navigation; charset=utf-8"/>
|
||||
<link href="<?= SITE_URL ?>/feeds/opds" rel="start" type="application/atom+xml;profile=opds-catalog;kind=navigation; charset=utf-8"/>
|
||||
<link href="<?= SITE_URL ?>/feeds/opds/all" rel="http://opds-spec.org/crawlable" type="application/atom+xml;profile=opds-catalog;kind=acquisition; charset=utf-8"/>
|
||||
<link href="<?= SITE_URL ?>/ebooks/opensearch" rel="search" type="application/opensearchdescription+xml; charset=utf-8"/>
|
||||
<link href="<?= SITE_URL ?>/opensearch" rel="search" type="application/opensearchdescription+xml" title="Standard Ebooks"/>
|
||||
<? if($parentUrl !== null){ ?>
|
||||
<link href="<?= SITE_URL ?><?= Formatter::EscapeXml($parentUrl) ?>" rel="up" type="application/atom+xml;profile=opds-catalog;kind=navigation; charset=utf-8"/>
|
||||
<? } ?>
|
||||
|
|
|
@ -21,7 +21,7 @@ print("<?xml version=\"1.0\" encoding=\"utf-8\"?>\n");
|
|||
<lastBuildDate><?= $updated->format(Enums\DateTimeFormat::Rss->value); ?></lastBuildDate>
|
||||
<docs>http://blogs.law.harvard.edu/tech/rss</docs>
|
||||
<atom:link href="<?= SITE_URL . Formatter::EscapeXml($url) ?>" rel="self" type="application/rss+xml"/>
|
||||
<atom:link href="<?= SITE_URL ?>/ebooks/opensearch" rel="search" type="application/opensearchdescription+xml" />
|
||||
<atom:link href="<?= SITE_URL ?>/opensearch" rel="search" type="application/opensearchdescription+xml" title="Standard Ebooks"/>
|
||||
<image>
|
||||
<url><?= SITE_URL ?>/images/logo-rss.png</url>
|
||||
<title><?= Formatter::EscapeXml($title) ?></title> <? /* must be identical to channel title */ ?>
|
||||
|
|
|
@ -161,6 +161,10 @@ form[action^="/artworks/"]{
|
|||
width: auto;
|
||||
}
|
||||
|
||||
.artworks p.no-results{
|
||||
margin-top: 4rem;
|
||||
}
|
||||
|
||||
.artworks form.browse-artwork button{
|
||||
justify-self: end;
|
||||
grid-column: 1 / span 4;
|
||||
|
|
|
@ -1793,7 +1793,7 @@ main nav.pagination ol li a:hover{
|
|||
}
|
||||
|
||||
p.no-results{
|
||||
margin-top: 4rem;
|
||||
margin-top: 2rem;
|
||||
margin-bottom: 2rem;
|
||||
font-style: italic;
|
||||
text-align: center;
|
||||
|
|
|
@ -11,8 +11,7 @@ catch(Exceptions\EbookNotFoundException){
|
|||
}
|
||||
|
||||
header('content-type: application/xml; charset=utf-8');
|
||||
print('<?xml version="1.0" encoding="utf-8"?>');
|
||||
print("\n");
|
||||
print("<?xml version=\"1.0\" encoding=\"utf-8\"?>\n");
|
||||
?>
|
||||
<collections>
|
||||
<? foreach($ebook->CollectionMemberships as $collectionMembership){ ?>
|
||||
|
|
|
@ -13,8 +13,7 @@ print("<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<?xml-stylesheet href=\"" . S
|
|||
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:media="http://search.yahoo.com/mrss/" xmlns:opensearch="http://a9.com/-/spec/opensearch/1.1/">
|
||||
<id><?= SITE_URL ?>/feeds/atom/all?query=<?= urlencode($query) ?></id>
|
||||
<link href="<?= SITE_URL ?>/feeds/atom/all?query=<?= urlencode($query) ?>" rel="self" type="application/atom+xml"/>
|
||||
<link href="<?= SITE_URL ?>/ebooks/ebooks?query=<?= urlencode($query) ?>" rel="alternate" type="text/html"/>
|
||||
<link href="<?= SITE_URL ?>/ebooks/opensearch" rel="search" type="application/opensearchdescription+xml"/>
|
||||
<link href="<?= SITE_URL ?>/opensearch" rel="search" type="application/opensearchdescription+xml" title="Standard Ebooks"/>
|
||||
<title>Search Results</title>
|
||||
<subtitle>Results for “<?= Formatter::EscapeXml($query) ?>”.</subtitle>
|
||||
<icon><?= SITE_URL ?>/images/logo.png</icon>
|
||||
|
|
|
@ -16,7 +16,7 @@ print("<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<?xml-stylesheet href=\"". SI
|
|||
<link href="<?= SITE_URL ?>/ebooks/ebooks?query=<?= urlencode($query) ?>" rel="alternate" type="text/html"/>
|
||||
<link href="<?= SITE_URL ?>/feeds/opds" rel="start" type="application/atom+xml;profile=opds-catalog;kind=navigation; charset=utf-8"/>
|
||||
<link href="<?= SITE_URL ?>/feeds/opds/all" rel="http://opds-spec.org/crawlable" type="application/atom+xml;profile=opds-catalog;kind=acquisition; charset=utf-8"/>
|
||||
<link href="<?= SITE_URL ?>/ebooks/opensearch" rel="search" type="application/opensearchdescription+xml; charset=utf-8"/>
|
||||
<link href="<?= SITE_URL ?>/opensearch" rel="search" type="application/opensearchdescription+xml" title="Standard Ebooks"/>
|
||||
<title>Search Results</title>
|
||||
<subtitle>Results for “<?= Formatter::EscapeXml($query) ?>”.</subtitle>
|
||||
<icon><?= SITE_URL ?>/images/logo.png</icon>
|
||||
|
|
|
@ -20,7 +20,7 @@ print("<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<?xml-stylesheet href=\"" . S
|
|||
<lastBuildDate><?= NOW->format(Enums\DateTimeFormat::Rss->value) ?></lastBuildDate>
|
||||
<docs>http://blogs.law.harvard.edu/tech/rss</docs>
|
||||
<atom:link href="<?= SITE_URL ?>/feeds/rss/all?query=<?= urlencode($query) ?>" rel="self" type="application/rss+xml"/>
|
||||
<atom:link href="<?= SITE_URL ?>/ebooks/opensearch" rel="search" type="application/opensearchdescription+xml" />
|
||||
<atom:link href="<?= SITE_URL ?>/opensearch" rel="search" type="application/opensearchdescription+xml" title="Standard Ebooks" />
|
||||
<image>
|
||||
<url><?= SITE_URL ?>/images/logo-rss.png</url>
|
||||
<title>Search Results</title> <? /* must be identical to channel title */ ?>
|
||||
|
|
BIN
www/images/favicons/favicon-16x16.ico
Normal file
BIN
www/images/favicons/favicon-16x16.ico
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.1 KiB |
BIN
www/images/favicons/favicon-64x64.png
Normal file
BIN
www/images/favicons/favicon-64x64.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 8.2 KiB |
|
@ -1,6 +1,6 @@
|
|||
<?
|
||||
header('Content-Type: text/xml; charset=utf-8');
|
||||
print('<?xml version="1.0" encoding="utf-8"?>');
|
||||
header('Content-Type: application/opensearchdescription+xml'); // Can't include `charset` because Chrome doesn't like it.
|
||||
print("<?xml version=\"1.0\" encoding=\"utf-8\"?>\n");
|
||||
?>
|
||||
<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/">
|
||||
<ShortName>Standard Ebooks</ShortName>
|
||||
|
@ -10,6 +10,12 @@ print('<?xml version="1.0" encoding="utf-8"?>');
|
|||
<SyndicationRight>open</SyndicationRight>
|
||||
<OutputEncoding>UTF-8</OutputEncoding>
|
||||
<InputEncoding>UTF-8</InputEncoding>
|
||||
<Image width="16" height="16" type="image/x-icon"><?= SITE_URL ?>/favicon-16x16.ico</Image>
|
||||
<Image width="48" height="48" type="image/x-icon"><?= SITE_URL ?>/favicon.ico</Image>
|
||||
<Image width="64" height="64" type="image/png"><?= SITE_URL ?>/favicon-64x64.png</Image>
|
||||
<Url type="application/opensearchdescription+xml" rel="self" template="<?= SITE_URL ?>/opensearch" />
|
||||
<Url type="text/html" template="<?= SITE_URL ?>/ebooks?query={searchTerms}&per-page={count}&page={startPage}"/><? // For compatibility; most OpenSearch parsers don't understand `application/xhtml+xml`. ?>
|
||||
|
||||
<Url type="application/xhtml+xml" template="<?= SITE_URL ?>/ebooks?query={searchTerms}&per-page={count}&page={startPage}"/>
|
||||
<Url type="application/rss+xml" template="<?= SITE_URL ?>/feeds/rss/all?query={searchTerms}&per-page={count}&page={startPage}"/>
|
||||
<Url type="application/atom+xml" template="<?= SITE_URL ?>/feeds/atom/all?query={searchTerms}&per-page={count}&page={startPage}"/>
|
Loading…
Add table
Add a link
Reference in a new issue