Rename .epub3 output to _advanced.epub

This commit is contained in:
Alex Cabal 2020-09-09 22:22:00 -05:00
parent 7faf078389
commit eed3355916
7 changed files with 18 additions and 20 deletions

View file

@ -71,7 +71,6 @@ Define domain standardebooks.org
# Log downloads
SetEnvIf Request_URI "\.epub$" logdownload
SetEnvIf Request_URI "\.kepub.epub$" logdownload
SetEnvIf Request_URI "\.epub3$" logdownload
SetEnvIf Request_URI "\.azw3$" logdownload
CustomLog /var/log/local/downloads.log "%h [%{%Y-%m-%d %H:%M:%S %Z}t] \"%r\" %>s %b" env=logdownload
DirectorySlash Off
@ -90,7 +89,7 @@ Define domain standardebooks.org
CGIPassAuth on
</Directory>
AddType application/epub+zip .epub .epub3
AddType application/epub+zip .epub
AddType application/x-mobi8-ebook .azw3
<Location ~ ^/ebooks/.+?/dist/.+$>

View file

@ -70,7 +70,6 @@ Define domain standardebooks.test
# Log downloads
SetEnvIf Request_URI "\.epub$" logdownload
SetEnvIf Request_URI "\.kepub.epub$" logdownload
SetEnvIf Request_URI "\.epub3$" logdownload
SetEnvIf Request_URI "\.azw3$" logdownload
CustomLog /var/log/local/downloads.log "%h [%{%Y-%m-%d %H:%M:%S %Z}t] \"%r\" %>s %b" env=logdownload
DirectorySlash Off
@ -89,7 +88,7 @@ Define domain standardebooks.test
CGIPassAuth on
</Directory>
AddType application/epub+zip .epub .epub3
AddType application/epub+zip .epub
AddType application/x-mobi8-ebook .azw3
<Location ~ ^/ebooks/.+?/dist/.+$>

View file

@ -13,7 +13,7 @@ class Ebook{
public $Url;
public $KindleCoverUrl;
public $EpubUrl;
public $Epub3Url;
public $AdvancedEpubUrl;
public $KepubUrl;
public $Azw3Url;
public $HasDownloads;
@ -97,16 +97,16 @@ class Ebook{
$this->KindleCoverUrl = $this->Url . '/dist/' . basename($tempPath[0]);
}
// Generate the epub URL.
// Generate the compatible epub URL.
$tempPath = glob($this->WwwFilesystemPath . '/dist/*.epub');
if(sizeof($tempPath) > 0){
$this->EpubUrl = $this->Url . '/dist/' . basename($tempPath[0]);
}
// Generate the epub3 URL
$tempPath = glob($this->WwwFilesystemPath . '/dist/*.epub3');
// Generate the epub URL
$tempPath = glob($this->WwwFilesystemPath . '/dist/*_advanced.epub');
if(sizeof($tempPath) > 0){
$this->Epub3Url = $this->Url . '/dist/' . basename($tempPath[0]);
$this->AdvancedEpubUrl = $this->Url . '/dist/' . basename($tempPath[0]);
}
// Generate the Kepub URL
@ -121,7 +121,7 @@ class Ebook{
$this->Azw3Url = $this->Url . '/dist/' . basename($tempPath[0]);
}
$this->HasDownloads = $this->EpubUrl || $this->Epub3Url || $this->KepubUrl || $this->Azw3Url;
$this->HasDownloads = $this->EpubUrl || $this->AdvancedEpubUrl || $this->KepubUrl || $this->Azw3Url;
$tempPath = glob($this->WwwFilesystemPath . '/dist/cover.jpg');
if(sizeof($tempPath) > 0){
@ -489,11 +489,11 @@ class Ebook{
$output->encoding[] = $encodingObject;
}
if($this->Epub3Url){
if($this->AdvancedEpubUrl){
$encodingObject = new stdClass();
$encodingObject->{'@type'} = 'MediaObject';
$encodingObject->encodingFormat = 'epub3';
$encodingObject->contentUrl = SITE_URL . $this->Epub3Url;
$encodingObject->encodingFormat = 'epub';
$encodingObject->contentUrl = SITE_URL . $this->AdvancedEpubUrl;
$output->encoding[] = $encodingObject;
}

View file

@ -26,7 +26,7 @@
<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 ebooks 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->Epub3Url ?>" rel="http://opds-spec.org/acquisition/open-access" type="application/epub+zip" title="epub"/>
<link href="<?= $ebook->AdvancedEpubUrl ?>" 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->Azw3Url ?>" rel="http://opds-spec.org/acquisition/open-access" type="application/x-mobipocket-ebook" title="Amazon Kindle azw3"/>
</entry>

View file

@ -402,10 +402,10 @@ proceed to seal up my confession, I bring the life of that unhappy Henry Jekyll
<p>If there are no errors, well see five files in the brand-new <code class="path">~/dist/</code> folder in our home directory:</p>
<ul>
<li>
<p><code class="path">the-strange-case-of-dr-jekyll-and-mr-hyde.epub3</code> is a pure epub3 file—basically just a zipped up version of our source. Unfortunately most ebook readers dont fully support all of epub3s capabilities yet, so were more interested in…</p>
<p><code class="path">the-strange-case-of-dr-jekyll-and-mr-hyde_advanced.epub</code> is the zipped up version of our source. Unfortunately most ebook readers dont fully support all of epub3s capabilities yet, or the advanced CSS selectors and XHTML structure we use, so were more interested in…</p>
</li>
<li>
<p><code class="path">the-strange-case-of-dr-jekyll-and-mr-hyde.epub</code>, the epub2 version of our ebook. If you dont have a Kindle, this is the file youll be using to proofread.</p>
<p><code class="path">the-strange-case-of-dr-jekyll-and-mr-hyde.epub</code>, the compatible epub version of our ebook. This file is the raw source, plus various compatiblity fixes applied during our build process. If you dont have a Kindle, this is the file youll be using to proofread.</p>
</li>
<li>
<p><code class="path">the-strange-case-of-dr-jekyll-and-mr-hyde.kepub.epub</code> is the Kobo version of our ebook. You can copy this to a Kobo using a USB cable.</p>

View file

@ -116,7 +116,7 @@ catch(\Exception $ex){
</div>
<ul>
<? if($ebook->EpubUrl !== null){ ?>
<li><p><span><a href="<?= $ebook->EpubUrl ?>" class="epub">epub</a> </span><span></span> <span>All devices and apps except Amazon Kindle and Kobo.</span></p>
<li><p><span><a href="<?= $ebook->EpubUrl ?>" class="epub">Compatible epub</a> </span><span></span> <span>All devices and apps except Amazon Kindle and Kobo.</span></p>
</li>
<? } ?>
@ -130,8 +130,8 @@ catch(\Exception $ex){
</li>
<? } ?>
<? if($ebook->Epub3Url !== null){ ?>
<li><p><span><a href="<?= $ebook->Epub3Url ?>" class="epub">epub3</a></span> <span></span> <span>Advanced format not yet fully compatible with most ereaders.</span></p>
<? if($ebook->AdvancedEpubUrl !== null){ ?>
<li><p><span><a href="<?= $ebook->AdvancedEpubUrl ?>" class="epub">Advanced epub</a></span> <span></span> <span>An advanced format not yet fully compatible with most ereaders.</span></p>
</li>
<? } ?>
</ul>

View file

@ -18,7 +18,7 @@ require_once('Core.php');
<p><b>All other ereaders</b>: download the <b>epub</b> file. This epub2-compatible file will work in all ereaders except Kindles. While this file will also work on Kobo, itll look pretty bad; please download our special kepub file for Kobo devices and software.</p>
</li>
<li>
<p>For advanced ereaders like <a href="https://chrome.google.com/webstore/detail/readium/fepbnnnkkadjhjahcafoaglimekefifl">Readium</a>, and for readers who like bleeding-edge technology: download the <b>pure epub3</b> file. Pure epub3 isnt compatible with most ereaders yet, so only download this file if you know what youre doing.</p>
<p>For advanced ereaders like <a href="https://chrome.google.com/webstore/detail/readium/fepbnnnkkadjhjahcafoaglimekefifl">Readium</a>, and for readers who like bleeding-edge technology: download the <b>advanced epub</b> file. The advanced epub file isnt compatible with most ereaders yet, so only download this file if you know what youre doing.</p>
</li>
</ul>
</section>