Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
tweaking image paths
  • Loading branch information
EsGeh authored and EsGeh committed Dec 4, 2019
1 parent 7e9ab2c commit a1a5d41
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 16 deletions.
15 changes: 14 additions & 1 deletion src/tei2html.py
Expand Up @@ -101,6 +101,18 @@ def check_executables():
type = Path,
help="in case of calling a classical stylesheet with output, redirect here"
)
parser.add_argument(
"-w", "--webdesign",
default = '../webdesign_platform',
type = Path,
help="location to the webdesign (relative to OUTPUT_DIR, or absolute)"
)
parser.add_argument(
"-s", "--static",
default = '../publication_static',
type = Path,
help="static files of publication (relative to OUTPUT_DIR, or absolute)"
)

args = parser.parse_args()

Expand All @@ -122,7 +134,6 @@ def check_executables():
output_dir = args.output_dir

if not input_file.is_file():
import errno
raise( Exception(
f"not a valid input file: {input_file}"
) )
Expand All @@ -141,6 +152,8 @@ def check_executables():
params =
[
f"output_dir={output_dir}",
f"webdesign_url={args.webdesign}",
f"publ_static_url={args.static}",
] +
args.param,
output_file = args.output_file,
Expand Down
9 changes: 4 additions & 5 deletions src/tei2html/utils/common.xsl
Expand Up @@ -52,14 +52,13 @@
<xsl:param name="webdesign_url" as="xs:string"/>
<xsl:param name="publ_static_url" as="xs:string"/>
<xsl:param name="breadcrumbs" as="element(eoa:entry)*"/>
<xsl:variable name="logo_dir" as="xs:string" select="concat($webdesign_url, '/assets/images')"/>
<html lang="{//tei:profileDesc/tei:langUsage/tei:language/@ident}">
<head>
<title>
<xsl:copy-of select="$title"/>
</title>
<link rel="shortcut icon" href="{concat($logo_dir,'/favicon.png')}"/>
<link href="{concat($webdesign_url, '/', 'app.css')}" rel="stylesheet"/>
<link rel="shortcut icon" href="{eoa:conc_path($webdesign_url, 'favicon.png')}"/>
<link href="{eoa:conc_path($webdesign_url, 'app.css')}" rel="stylesheet"/>
<xsl:copy-of select="$meta_tags"/>
</head>
<body>
Expand All @@ -71,7 +70,7 @@
<div class="blocklogo container">
<div class="blocklogo__logo">
<a href="{$platform_link}">
<img class="blocklogo__img" src="{concat($logo_dir,'/logo.png')}" alt="logo" data-object-fit="cover"/>
<img class="blocklogo__img" src="{eoa:conc_path($webdesign_url, 'logo.png')}" alt="logo" data-object-fit="cover"/>
</a>
</div>
</div>
Expand Down Expand Up @@ -174,7 +173,7 @@
<xsl:copy-of select="$footer"/>
-->
</div>
<script type="text/javascript" src="{concat($webdesign_url, '/app.js')}"/>
<script type="text/javascript" src="{eoa:conc_path($webdesign_url, 'app.js')}"/>
<xsl:copy-of select="$script"/>
</body>
</html>
Expand Down
15 changes: 5 additions & 10 deletions src/tei2html/utils/html_rules.xsl
Expand Up @@ -422,15 +422,16 @@
<!-- TODO: check/fix path -->
<xsl:sequence select="eoa:info('figure')"/>
<xsl:variable name="uri"><xsl:call-template name="calc_uri"/></xsl:variable>
<xsl:variable name="img_url" select="eoa:conc_path3('../../..', $publ_static_url,tei:graphic/@url)"/>
<xsl:call-template name="accordion_row">
<xsl:with-param name="link" as="xs:string" select="$uri/eoa:uri"/>
<xsl:with-param name="content" as="element()*">
<xsl:variable name="caption">
<xsl:apply-templates mode="html" select="tei:head/node() | text()"/>
</xsl:variable>
<figure class="publication__image" id="{$uri/eoa:id}">
<a href="{@url}" data-lightbox="" title="$caption">
<img src="{@url}">image could not</img>
<a href="{$img_url}" data-lightbox="" title="{$caption}">
<img src="{$img_url}">image could not</img>
</a>
<xsl:if test="tei:head">
<figcaption>
Expand Down Expand Up @@ -531,14 +532,8 @@

<xsl:template mode="html" match="tei:graphic">
<xsl:sequence select="eoa:info('inline graphic')"/>
<xsl:variable name="full_url" select="
concat(
(if ($publ_static_url != '') then concat($publ_static_url,'/') else ''),
@url
)
"
/>
<img src="{$full_url}">(missing pic)</img>
<xsl:variable name="full_url" select="eoa:conc_path3('../../..', $publ_static_url, @url)"/>
<img class="eoainlineimage" src="{$full_url}" alt="(missing pic)"/>
</xsl:template>

<xsl:template mode="html" match="tei:note[@place = 'bottom']">
Expand Down

0 comments on commit a1a5d41

Please sign in to comment.