summaryrefslogtreecommitdiff
path: root/themes/ccc/templates/post_header.tmpl
blob: f13ec488c7000bfebffe13b6477b45f9596047c2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
## -*- coding: utf-8 -*-
<%namespace name="helper" file="post_helper.tmpl"/>
<%namespace name="comments" file="comments_helper.tmpl"/>

<%def name="html_title()">
%if title and not post.meta('hidetitle'):
    <h1 class="p-name entry-title" itemprop="headline name"><a href="${post.permalink()}" class="u-url">${post.title()|h}</a></h1>
%endif
</%def>

<%def name="html_translations(post)">
    % if len(post.translated_to) > 1:
        % for langname in sorted(translations):
            % if langname != lang and post.is_translation_available(langname):
            <div class="posttranslation d-lg-none">
                <a href="${post.permalink(langname)}" hreflang="${langname}" rel="alternate">${messages("Also available in:", langname)} ${messages("LANGUAGE", langname)}</a>
            </div>
            % endif
        % endfor
    % endif
</%def>

<%def name="html_sourcelink()">
    % if show_sourcelink:
        <p class="sourceline"><a href="${post.source_link()}" class="sourcelink">${messages("Source")}</a></p>
    % endif
</%def>

<%def name="html_post_header()">
    <header>
        ${html_title()}
        <div class="metadata">
            <p class="byline author vcard p-author h-card"><span class="byline-name fn p-name" itemprop="author">
                % if author_pages_generated:
                    <a class="u-url" href="${_link('author', post.author())}">${post.author()|h}</a>
                % else:
                    ${post.author()|h}
                % endif
            </span></p>
            <p class="dateline">
            <a href="${post.permalink()}" rel="bookmark">
            <time class="published dt-published" datetime="${post.formatted_date('webiso')}" itemprop="datePublished" title="${post.formatted_date(date_format)|h}">${post.formatted_date(date_format)|h}</time>
            % if post.updated and post.updated != post.date:
                <span class="updated"> (${messages("updated")}
                    <time class="updated dt-updated" datetime="${post.formatted_updated('webiso')}" itemprop="dateUpdated" title="${post.formatted_updated(date_format)|h}">${post.formatted_updated(date_format)|h}</time>)</span>
            % endif
            </a>
            </p>
            % if not post.meta('nocomments') and site_has_comments:
                <p class="commentline">${comments.comment_link(post.permalink(), post._base_path)}
            % endif
            ${html_sourcelink()}
            % if post.meta('link'):
                    <p class="linkline"><a href="${post.meta('link')}">${messages("Original site")}</a></p>
            % endif
        </div>
        ${html_translations(post)}
    </header>
</%def>