personal-website/plugins/publication_list/templates/mako/publication.tmpl

66 lines
1.5 KiB
Cheetah
Raw Normal View History

2021-03-18 22:08:18 +00:00
## -*- coding: utf-8 -*-
<%inherit file="base.tmpl"/>
<%!
import os, mako
%>
<%def name="include_if_exists(name)" buffered="True">
<%
try:
tmpl = self.get_template(name)
except mako.exceptions.TemplateLookupException as e:
pass
else:
tmpl.render_context(context)
%>
</%def>
<%block name="extra_head">
<style>
.publication-abstract {
text-align: justify;
hyphens: auto;
-webkit-hyphens: auto;
-moz-hyphens: auto;
-ms-hyphens:auto;
}
</style>
</%block>
<%block name="content">
<header class="page-header">
<h1>${title | h}</h1>
</header>
<div class="reference">
<p>
${reference}
% if extra_links:
<br/>${extra_links}
% endif
</p>
</div>
% if abstract:
<h2>Abstract</h2>
<div class="publication-abstract">
<p>${abstract | h}</p>
</div>
% endif
${include_if_exists("publicationlist_{}_after_abstract.html".format(label))}
% if pdf:
<h2>Full Text</h2>
<div>
<object data="${pdf}" type="application/pdf" width="100%" style="height:90vh">
<p>Your browser does not support viewing the PDF file inline. Please click the link below to download the file.</p>
</object>
<p>[<a href="${pdf}" download="${label}.pdf">download</a>]</p>
</div>
% endif
${include_if_exists("publicationlist_{}_after_fulltext.html".format(label))}
</%block>