Skip to content

Commit

Permalink
Possible solution to set the correct version in the PDF footer when b…
Browse files Browse the repository at this point in the history
…uilding with GH Actions (#836)
  • Loading branch information
thrashwerk authored Jan 14, 2025
1 parent 11abe1f commit f3760e8
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,8 @@ _book/
*.mobi
*.pdf

# templated files
meta.tex

game.db.json
.DS_Store
6 changes: 6 additions & 0 deletions build.books.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

set -e

if [ -v GITHUB_REF_NAME ]; then
sed "s/%%FOOTER_VERSION%%/${GITHUB_REF_NAME}/" meta.tmpl.tex > meta.tex
else
sed "s/%%FOOTER_VERSION%%/UNDEFINED VERSION/" meta.tmpl.tex > meta.tex
fi

docker run --rm -v `pwd`:/data uppalabharath/pandoc-latex-cjk:latest --from=gfm+rebase_relative_paths -o learn-go-with-tests.pdf \
-H meta.tex --pdf-engine=xelatex --variable urlcolor=blue --toc --toc-depth=1 \
-B pdf-cover.tex \
Expand Down
2 changes: 1 addition & 1 deletion meta.tex → meta.tmpl.tex
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@

\pagestyle{fancy}
\fancyhf{}
\cfoot{v 10.0.0}
\cfoot{%%FOOTER_VERSION%%}

0 comments on commit f3760e8

Please sign in to comment.