]> git.ipfire.org Git - ipfire.org.git/blob - src/templates/blog/post.html
wiki: Only match usernames when a word starts with @
[ipfire.org.git] / src / templates / blog / post.html
1 {% extends "../base.html" %}
2
3 {% block title %}{{ post.title }}{% end block %}
4
5 {% block meta %}
6 {% import ipfire.accounts as accounts %}
7
8 <!-- Facebook OpenGraph -->
9 <meta property="og:site_name" content="IPFire Blog" />
10 <meta property="og:title" content="{{ post.title }} - The IPFire Blog" />
11 <meta property="og:description" content="{{ post.excerpt }}" />
12 <meta property="og:url" content="{{ request.full_url() }}" />
13 <meta property="og:image" content="{{ static_url("img/ipfire-tux.png") }}" />
14
15 <meta property="og:type" content="article" />
16 {% if post.published_at %}
17 <meta property="og:article:published_time" content="{{ post.published_at.isoformat() }}" />
18 {% end %}
19 <meta property="og:article:modified_time" content="{{ post.updated_at.isoformat() }}" />
20 {% if isinstance(post.author, accounts.Account) %}
21 <meta property="og:article:author:first_name" content="{{ post.author.first_name }}" />
22 <meta property="og:article:author:last_name" content="{{ post.author.last_name }}" />
23 <meta property="og:article:author:username" content="{{ post.author.uid }}" />
24 {% end %}
25 {% for tag in post.tags %}
26 <meta property="og:article:tag" content="{{ tag }}" />
27 {% end %}
28
29 <!-- Twitter -->
30 <meta property="twitter:site" content="@ipfire" />
31 <meta property="twitter:card" content="summary_large_image" />
32 <meta property="twitter:title" content="{{ post.title }} - The IPFire Blog" />
33 <meta property="twitter:description" content="{{ post.excerpt }}" />
34 <meta property="twitter:image" content="{{ static_url("img/ipfire-tux.png") }}" />
35 {% end block %}
36
37 {% block container %}
38 {% import ipfire.accounts as accounts %}
39
40 <section class="hero {% if "lightningwirelabs.com" in post.tags %}is-lwl{% elif post.is_published() %}is-primary{% else %}is-light{% end %}">
41 <div class="hero-body">
42 <div class="container">
43 <nav class="breadcrumb" aria-label="breadcrumbs">
44 <ul>
45 <li>
46 <a href="/">{{ _("Home") }}</a>
47 </li>
48 <li>
49 <a href="/blog">{{ _("Blog") }}</a>
50 </li>
51 <li class="is-active">
52 <a href="#" aria-current="page">{{ post.title }}</a>
53 </li>
54 </ul>
55 </nav>
56
57 <h1 class="title">{{ post.title }}</h1>
58
59 <h6 class="subtitle">
60 {{ _("by") }}
61
62 {% if isinstance(post.author, accounts.Account) %}
63 <a href="/users/{{ post.author.uid }}">{{ post.author.name }}</a>,
64 {% else %}
65 <strong>{{ post.author }}</strong>,
66 {% end %}
67
68 {% if post.is_published() %}
69 {% if post.updated_at and post.updated_at > post.published_at %}
70 {{ locale.format_date(post.published_at, shorter=True, relative=False) }},
71 {{ _("Updated %s") % locale.format_date(post.updated_at, shorter=True) }}
72 {% else %}
73 {{ locale.format_date(post.published_at, shorter=True, relative=False) }}
74 {% end %}
75 {% elif post.published_at %}
76 {{ _("Scheduled to be published %s") % locale.format_date(post.published_at, relative=False) }}
77 {% else %}
78 {{ _("Not published, yet") }}
79 {% end %}
80 </h6>
81 </div>
82 </div>
83 </section>
84
85 {# Encourage people to sign up & subscribe... #}
86 {% if not current_user or not current_user.consents_to_promotional_emails %}
87 <section class="has-background-light">
88 <div class="container">
89 <p class="has-text-centered px-2 py-1">
90 {{ _("Do you like what you are reading?") }}
91 {{ _("Subscribe to our newsletter and don't miss out on the latest...") }}
92
93 &nbsp;
94
95 {% if not current_user %}
96 <a class="has-text-weight-bold" href="/join">
97 {{ _("Join Now") }}
98 </a>
99 {% else %}
100 <a class="has-text-weight-bold" href="/subscribe">
101 {{ _("Subscribe Now") }}
102 </a>
103 {% end %}
104 </p>
105 </div>
106 </section>
107 {% end %}
108
109 <section class="section">
110 <div class="container">
111 <div class="columns is-justify-content-space-between">
112 <div class="column is-8">
113 <div class="buttons are-medium">
114 {% if "lightningwirelabs.com" in post.tags and post.link %}
115 <a class="button is-lwl is-fullwidth" href="{{ post.link }}">
116 <span class="icon">
117 <i class="fas fa-external-link-alt"></i>
118 </span>
119 <span>{{ _("Go to Lightning Wire Labs") }}</span>
120 </a>
121 {% end %}
122
123 {% if post.release or "donate" in post.tags %}
124 <a class="button is-primary is-fullwidth" href="/donate">
125 <span class="icon">
126 <i class="fas fa-heart"></i>
127 </span>
128 <span>{{ _("Donate") }}</span>
129 </a>
130 {% end %}
131
132 {% if post.release %}
133 <a class="button is-dark is-fullwidth" href="/downloads/{{ post.release.slug }}">
134 <span class="icon">
135 <i class="fas fa-download"></i>
136 </span>
137 <span>{{ _("Download") }} <span class="is-hidden-mobile">{{ post.release }}</span></span>
138
139 </a>
140 {% end %}
141 </div>
142
143 <div class="block">
144 <div class="content">
145 {% raw post.html %}
146 </div>
147 </div>
148 </div>
149
150 {# Author Stuff #}
151
152 {% if post.is_editable(current_user) %}
153 <div class="column is-3">
154 <div class="buttons">
155 {% if not post.is_published() %}
156 <a class="button is-primary is-fullwidth" href="/blog/{{ post.slug }}/publish">
157 <span class="icon">
158 <i class="fa-solid fa-users"></i>
159 </span>
160 <span>{{ _("Publish") }}</span>
161 </a>
162 {% end %}
163
164 <a class="button is-light is-fullwidth" href="/blog/{{ post.slug }}/edit">
165 <span class="icon">
166 <i class="fas fa-edit"></i>
167 </span>
168 <span>{{ _("Edit") }}</span>
169 </a>
170 </div>
171 </div>
172 {% end %}
173 </div>
174 </div>
175 </section>
176
177 {# Analytics #}
178 {% if post.is_published() %}
179 {% if current_user and current_user.is_admin() %}
180 <section class="hero is-dark">
181 <div class="hero-body">
182 <div class="container">
183 <h4 class="title is-4">{{ _("Analytics") }}</h4>
184
185 {% module AnalyticsSummary() %}
186 </div>
187 </div>
188 </section>
189 {% end %}
190 {% end %}
191 {% end block %}