post_header.tmpl 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. ## -*- coding: utf-8 -*-
  2. <%namespace name="helper" file="post_helper.tmpl"/>
  3. <%namespace name="comments" file="comments_helper.tmpl"/>
  4. <%def name="html_title()">
  5. %if title and not post.meta('hidetitle'):
  6. <h1 class="p-name entry-title" itemprop="headline name"><a href="${post.permalink()}" class="u-url">${title|h}</a></h1>
  7. %endif
  8. </%def>
  9. <%def name="html_translations(post)">
  10. % if len(post.translated_to) > 1:
  11. <div class="metadata posttranslations translations">
  12. <h3 class="posttranslations-intro">${messages("Also available in:")}</h3>
  13. % for langname in translations.keys():
  14. % if langname != lang and post.is_translation_available(langname):
  15. <p><a href="${post.permalink(langname)}" rel="alternate" hreflang="${langname}">${messages("LANGUAGE", langname)}</a></p>
  16. % endif
  17. % endfor
  18. </div>
  19. % endif
  20. </%def>
  21. <%def name="html_sourcelink()">
  22. % if show_sourcelink:
  23. <p class="sourceline"><a href="${post.source_link()}" id="sourcelink">${messages("Source")}</a></p>
  24. % endif
  25. </%def>
  26. <%def name="html_post_header()">
  27. <header>
  28. ${html_title()}
  29. <small>
  30. <span class="dateline">Posted: <a href="${post.permalink()}" rel="bookmark"><time class="published dt-published" datetime="${post.date.isoformat()}" itemprop="datePublished" title="${post.formatted_date(date_format)}">${post.formatted_date(date_format)}</time></a></span>
  31. |
  32. More posts about
  33. ${helper.html_tags(post)}
  34. </small>
  35. ${html_translations(post)}
  36. </header>
  37. </%def>