Update ebooks to explode the ./src/epub folder into ebook endpoints, instead of just exploding the whole epub

This commit is contained in:
Alex Cabal 2020-10-13 14:28:32 -05:00
parent d9ac7312c2
commit 73ba658a05
7 changed files with 20 additions and 19 deletions

View file

@ -306,6 +306,9 @@ do
mv "${workDir}"/single-page.xhtml "${workDir}"/src/epub/text/single-page.xhtml
fi
# Add viewport meta elements to all output
find "${workDir}" \( -type d -name .git -prune \) -o -type f -name "*.xhtml" -print0 | xargs -0 sed --in-place "s|</title>|</title>\n\t\t<meta content=\"width=device-width, initial-scale=1\" name=\"viewport\"/>|"
# Delete the contents of the old webdir
rm --preserve-root --recursive --force "${webDir}"
@ -313,7 +316,9 @@ do
mkdir -p "${webDir}"
# Move contents of the work dir over
mv "${workDir}"/* "${webDir}/"
mv "${workDir}"/downloads "${webDir}/"
rm "${workDir}/src/epub/onix.xml"
mv "${workDir}"/src/epub/* "${webDir}/"
fi
if [ "${images}" = "true" ]; then

View file

@ -22,7 +22,7 @@ foreach($contentFiles as $path){
if($path == '')
continue;
$ebookWwwFilesystemPath = preg_replace('|/src/.+|ius', '', $path) ?? '';
$ebookWwwFilesystemPath = preg_replace('|/content\.opf|ius', '', $path) ?? '';
$ebook = new Ebook($ebookWwwFilesystemPath);
$allEbooks[$ebook->ModifiedTimestamp->format('Y-m-d\TH:i:s\Z') . ' ' . $ebook->Identifier] = $ebook;