Skip to content

Commit

Permalink
Localize $TITLE
Browse files Browse the repository at this point in the history
  • Loading branch information
diseaz committed Dec 20, 2010
1 parent b572024 commit 9ceb5d2
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion makeover
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@
# Extract table of contents from index.html and delete preface link.
BOOKDIR=book
TITLE="Git Magic"
case $LANG in
ru)
TITLE="Магия Git"
;;
esac

gawk '
/<div class="toc">/ {
print $0
Expand All @@ -26,7 +32,7 @@ do
if [ $FILE != "$BOOKDIR/index.html" ]
then
# Prepend "Git Magic - " to titles of all pages.
sed '/<title>/ s/<title>/&Git Magic - /' -i $FILE
sed '/<title>/ s/<title>/&'"$TITLE"' - /' -i $FILE
sed 's/pr01\.html/index.html/g' -i $FILE
# Paste ToC into beginning and add div section with class content for CSS.
sed '/<body/{n; r toc.tmp
Expand Down

0 comments on commit 9ceb5d2

Please sign in to comment.