mirror of
https://github.com/standardebooks/web.git
synced 2025-07-12 09:32:24 -04:00
Add rel="nofollow" to sponsored links in the colophon
This commit is contained in:
parent
162e8b0129
commit
5914f9425b
1 changed files with 6 additions and 0 deletions
|
@ -281,6 +281,9 @@ do
|
||||||
# Recompose the epub into a single file, but put it outside of the epub src for now so we don't stomp on it with the following sections.
|
# Recompose the epub into a single file, but put it outside of the epub src for now so we don't stomp on it with the following sections.
|
||||||
# We do this first because the tweaks below shouldn't apply to the single-page file
|
# We do this first because the tweaks below shouldn't apply to the single-page file
|
||||||
se recompose-epub --xhtml --output "${workDir}"/single-page.xhtml --extra-css-file="${webRoot}/www/css/web.css" "${workDir}"
|
se recompose-epub --xhtml --output "${workDir}"/single-page.xhtml --extra-css-file="${webRoot}/www/css/web.css" "${workDir}"
|
||||||
|
|
||||||
|
# Adjust sponsored links in the colophon
|
||||||
|
sed --in-place 's|<p><a href="http|<p><a rel="nofollow" href="http|g' "${workDir}"/single-page.xhtml
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Make some compatibilty adjustments for the individual XHTML files
|
# Make some compatibilty adjustments for the individual XHTML files
|
||||||
|
@ -301,6 +304,9 @@ do
|
||||||
workTitle=$(grep --only-matching --extended-regexp "<dc:title id=\"title\">(.+?)</dc:title>" "${workDir}"/src/epub/content.opf | sed --regexp-extended "s/<[^>]+?>//g")
|
workTitle=$(grep --only-matching --extended-regexp "<dc:title id=\"title\">(.+?)</dc:title>" "${workDir}"/src/epub/content.opf | sed --regexp-extended "s/<[^>]+?>//g")
|
||||||
find "${workDir}"/src/epub \( -type d -name .git -prune \) -o -type f -name "*.xhtml" -print0 | xargs -0 sed --in-place --regexp-extended "s|<title>|<title>${workTitle} - |g"
|
find "${workDir}"/src/epub \( -type d -name .git -prune \) -o -type f -name "*.xhtml" -print0 | xargs -0 sed --in-place --regexp-extended "s|<title>|<title>${workTitle} - |g"
|
||||||
|
|
||||||
|
# Adjust sponsored links in the colophon
|
||||||
|
sed --in-place 's|<p><a href="http|<p><a rel="nofollow" href="http|g' "${workDir}"/src/epub/text/colophon.xhtml
|
||||||
|
|
||||||
# Done adding compatibility!
|
# Done adding compatibility!
|
||||||
|
|
||||||
if [ "${recompose}" = "true" ]; then
|
if [ "${recompose}" = "true" ]; then
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue