Use relative URLs for links between pages
Since the blog is just a folder, and all entries are just files, we don't have to use $global_url when linking between them.
This commit is contained in:
parent
1c4469005b
commit
0c2c0dca7c
1 changed files with 3 additions and 3 deletions
6
bb.sh
6
bb.sh
|
@ -368,7 +368,7 @@ create_html_page() {
|
||||||
# one blog entry
|
# one blog entry
|
||||||
if [[ "$index" == "no" ]]; then
|
if [[ "$index" == "no" ]]; then
|
||||||
echo '<!-- entry begin -->' >> "$filename" # marks the beginning of the whole post
|
echo '<!-- entry begin -->' >> "$filename" # marks the beginning of the whole post
|
||||||
echo '<h3><a class="ablack" href="'$global_url/$file_url'">' >> "$filename"
|
echo '<h3><a class="ablack" href="'$file_url'">' >> "$filename"
|
||||||
# remove possible <p>'s on the title because of markdown conversion
|
# remove possible <p>'s on the title because of markdown conversion
|
||||||
echo "$(echo "$title" | sed 's/<\/*p>//g')" >> "$filename"
|
echo "$(echo "$title" | sed 's/<\/*p>//g')" >> "$filename"
|
||||||
echo '</a></h3>' >> "$filename"
|
echo '</a></h3>' >> "$filename"
|
||||||
|
@ -534,14 +534,14 @@ all_posts() {
|
||||||
echo -n "."
|
echo -n "."
|
||||||
# Title
|
# Title
|
||||||
title="$(awk '/<h3><a class="ablack" href=".+">/, /<\/a><\/h3>/{if (!/<h3><a class="ablack" href=".+">/ && !/<\/a><\/h3>/) print}' $i)"
|
title="$(awk '/<h3><a class="ablack" href=".+">/, /<\/a><\/h3>/{if (!/<h3><a class="ablack" href=".+">/ && !/<\/a><\/h3>/) print}' $i)"
|
||||||
echo -n '<li><a href="'$global_url/$i'">'$title'</a> —' >> "$contentfile"
|
echo -n '<li><a href="'$i'">'$title'</a> —' >> "$contentfile"
|
||||||
# Date
|
# Date
|
||||||
date="$(LC_ALL=$date_locale date -r "$i" +"$date_format")"
|
date="$(LC_ALL=$date_locale date -r "$i" +"$date_format")"
|
||||||
echo " $date</li>" >> "$contentfile"
|
echo " $date</li>" >> "$contentfile"
|
||||||
done
|
done
|
||||||
echo ""
|
echo ""
|
||||||
echo "</ul>" >> "$contentfile"
|
echo "</ul>" >> "$contentfile"
|
||||||
echo '<div id="all_posts"><a href="'$global_url'">'$template_archive_index_page'</a></div>' >> "$contentfile"
|
echo '<div id="all_posts"><a href="'./'">'$template_archive_index_page'</a></div>' >> "$contentfile"
|
||||||
|
|
||||||
create_html_page "$contentfile" "$archive_index.tmp" yes "$global_title — All posts"
|
create_html_page "$contentfile" "$archive_index.tmp" yes "$global_title — All posts"
|
||||||
mv "$archive_index.tmp" "$archive_index"
|
mv "$archive_index.tmp" "$archive_index"
|
||||||
|
|
Loading…
Add table
Reference in a new issue