Skip to content

Commit

Permalink
patch to fix finding the extension location
Browse files Browse the repository at this point in the history
  • Loading branch information
eeholmes committed Oct 3, 2022
1 parent a0b7e04 commit 59e90a3
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion _extensions/titlepage/_extension.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
title: titlepage
author: Eli Holmes
version: 3.2.1
version: 3.2.2
contributes:
format:
pdf:
Expand Down
9 changes: 7 additions & 2 deletions _extensions/titlepage/coverpage-theme.lua
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ local function getVal(s)
return pandoc.utils.stringify(s)
end

function script_path()
local str = debug.getinfo(2, "S").source:sub(2)
return str:match("(.*/)")
end

local function has_value (tab, val)
for index, value in ipairs(tab) do
if value == val then
Expand Down Expand Up @@ -219,7 +224,7 @@ Set up the demos
choice = pandoc.utils.stringify(m.coverpage)
if choice == "great-wave" then
if isEmpty(m['coverpage-bg-image']) then
m['coverpage-bg-image'] = "_extensions/nmfs-opensci/titlepage/images/TheGreatWaveoffKanagawa.jpeg"
m['coverpage-bg-image'] = script_path().."images/TheGreatWaveoffKanagawa.jpeg"
end
if isEmpty(m['coverpage-title']) then
m['coverpage-title'] = "quarto_titlepages"
Expand All @@ -236,7 +241,7 @@ Set up the demos
end
if choice == "otter" then
if isEmpty(m['coverpage-bg-image']) then
m['coverpage-bg-image'] = "_extensions/nmfs-opensci/titlepage/images/otter-bar.jpeg"
m['coverpage-bg-image'] = script_path().."images/otter-bar.jpeg"
end
if isEmpty(m['coverpage-title']) then
m['coverpage-title'] = "Otters"
Expand Down
Binary file modified example.pdf
Binary file not shown.
3 changes: 2 additions & 1 deletion example.tex
Original file line number Diff line number Diff line change
Expand Up @@ -443,11 +443,12 @@
\clearpage
\restoregeometry
%%% TITLE PAGE END

\end{titlepage}
\setcounter{page}{1}
\end{frontmatter}

%%%%% end titlepage extension code\ifdefined\Shaded\renewenvironment{Shaded}{\begin{tcolorbox}[interior hidden, boxrule=0pt, borderline west={3pt}{0pt}{shadecolor}, sharp corners, frame hidden, breakable, enhanced]}{\end{tcolorbox}}\fi
%%%%% end titlepage extension code\ifdefined\Shaded\renewenvironment{Shaded}{\begin{tcolorbox}[boxrule=0pt, interior hidden, frame hidden, breakable, borderline west={3pt}{0pt}{shadecolor}, enhanced, sharp corners]}{\end{tcolorbox}}\fi

\renewcommand*\contentsname{Table of contents}
{
Expand Down

0 comments on commit 59e90a3

Please sign in to comment.