mirror of
https://github.com/standardebooks/web.git
synced 2025-07-16 11:26:37 -04:00
Add the @download attribute to ebook download links
This commit is contained in:
parent
f8904c8979
commit
a2a49a376e
3 changed files with 8 additions and 5 deletions
|
@ -94,6 +94,7 @@ Define domain standardebooks.org
|
|||
<Location ~ ^/ebooks/.+?/downloads/.+$>
|
||||
# Serve distributables using the "download" dialog instead of opening in-browser
|
||||
# Note: the trailing e in the Header directive is required
|
||||
# In modern browsers this is handled with the a@download attribute, we keep this here for compatibility
|
||||
SetEnvIf Request_URI ^/ebooks/.+?/downloads/(.+)$ FILENAME=$1
|
||||
Header set Content-Disposition "attachment; filename=%{FILENAME}e"
|
||||
</Location>
|
||||
|
|
|
@ -93,6 +93,7 @@ Define domain standardebooks.test
|
|||
<Location ~ ^/ebooks/.+?/downloads/.+$>
|
||||
# Serve distributables using the "download" dialog instead of opening in-browser
|
||||
# Note: the trailing e in the Header directive is required
|
||||
# In modern browsers this is handled with the a@download attribute, we keep this here for compatibility
|
||||
SetEnvIf Request_URI ^/ebooks/.+?/downloads/(.+)$ FILENAME=$1
|
||||
Header set Content-Disposition "attachment; filename=%{FILENAME}e"
|
||||
</Location>
|
||||
|
|
|
@ -174,12 +174,13 @@ catch(\Exception $ex){
|
|||
<section id="download">
|
||||
<h3>Download for ereaders</h3>
|
||||
<ul>
|
||||
<? /* Leave the @download attribute empty to have the browser use the target filename in the save-as dialog */ ?>
|
||||
<? if($ebook->EpubUrl !== null){ ?>
|
||||
<li property="schema:encoding" typeof="schema:MediaObject">
|
||||
<meta property="schema:description" content="epub"/>
|
||||
<meta property="schema:encodingFormat" content="application/epub+zip"/>
|
||||
<p>
|
||||
<span><a property="schema:contentUrl" href="<?= $ebook->EpubUrl ?>" class="epub">Compatible epub</a></span> <span>—</span> <span>All devices and apps except Kindles and Kobos.</span>
|
||||
<span><a property="schema:contentUrl" href="<?= $ebook->EpubUrl ?>" class="epub" download="">Compatible epub</a></span> <span>—</span> <span>All devices and apps except Kindles and Kobos.</span>
|
||||
</p>
|
||||
</li>
|
||||
<? } ?>
|
||||
|
@ -188,16 +189,16 @@ catch(\Exception $ex){
|
|||
<li property="schema:encoding" typeof="schema:MediaObject">
|
||||
<meta property="schema:encodingFormat" content="application/x-mobipocket-ebook"/>
|
||||
<p>
|
||||
<span><a property="schema:contentUrl" href="<?= $ebook->Azw3Url ?>" class="amazon"><span property="schema:description">azw3</span></a></span> <span>—</span> <span>Kindle devices and apps.<? if($ebook->KindleCoverUrl !== null){ ?> Also download the <a href="<?= $ebook->KindleCoverUrl ?>">Kindle cover thumbnail</a> to see the cover in your Kindle’s library. You may be interested in our <a href="/help/how-to-use-our-ebooks#kindle-faq">Kindle FAQ</a>.<? }else{ ?> Also see our <a href="/how-to-use-our-ebooks#kindle-faq">Kindle FAQ</a>.<? } ?></span>
|
||||
<span><a property="schema:contentUrl" href="<?= $ebook->Azw3Url ?>" class="amazon" download=""><span property="schema:description">azw3</span></a></span> <span>—</span> <span>Kindle devices and apps.<? if($ebook->KindleCoverUrl !== null){ ?> Also download the <a href="<?= $ebook->KindleCoverUrl ?>">Kindle cover thumbnail</a> to see the cover in your Kindle’s library. You may be interested in our <a href="/help/how-to-use-our-ebooks#kindle-faq">Kindle FAQ</a>.<? }else{ ?> Also see our <a href="/how-to-use-our-ebooks#kindle-faq">Kindle FAQ</a>.<? } ?></span>
|
||||
</p>
|
||||
</li>
|
||||
<? } ?>
|
||||
|
||||
<? if($ebook->KepubUrl !== null){ ?>
|
||||
<li property="schema:encoding" typeof="schema:MediaObject">
|
||||
<meta property="schema:encodingFormat" content="application/kepub+zip"/>
|
||||
<meta property="schema:encodingFormat" content="application/kepub+zip"/>
|
||||
<p>
|
||||
<span><a property="schema:contentUrl" href="<?= $ebook->KepubUrl ?>" class="kobo"><span property="schema:description">kepub</span></a></span> <span>—</span> <span>Kobo devices and apps.</span>
|
||||
<span><a property="schema:contentUrl" href="<?= $ebook->KepubUrl ?>" class="kobo" download=""><span property="schema:description">kepub</span></a></span> <span>—</span> <span>Kobo devices and apps.</span>
|
||||
</p>
|
||||
</li>
|
||||
<? } ?>
|
||||
|
@ -206,7 +207,7 @@ catch(\Exception $ex){
|
|||
<li property="schema:encoding" typeof="schema:MediaObject">
|
||||
<meta property="schema:encodingFormat" content="application/epub+zip"/>
|
||||
<p>
|
||||
<span><a property="schema:contentUrl" href="<?= $ebook->AdvancedEpubUrl ?>" class="epub"><span property="schema:description">Advanced epub</span></a></span> <span>—</span> <span>An advanced format that uses the latest technology not yet fully supported by most ereaders.</span>
|
||||
<span><a property="schema:contentUrl" href="<?= $ebook->AdvancedEpubUrl ?>" class="epub" download=""><span property="schema:description">Advanced epub</span></a></span> <span>—</span> <span>An advanced format that uses the latest technology not yet fully supported by most ereaders.</span>
|
||||
</p>
|
||||
</li>
|
||||
<? } ?>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue