]> git.ipfire.org Git - ipfire.org.git/blame - src/templates/blog/post.html
wiki: Only match usernames when a word starts with @
[ipfire.org.git] / src / templates / blog / post.html
CommitLineData
894c5a5a 1{% extends "../base.html" %}
12e5de7e
MT
2
3{% block title %}{{ post.title }}{% end block %}
4
4203b8c0
MT
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() }}" />
34472923 13 <meta property="og:image" content="{{ static_url("img/ipfire-tux.png") }}" />
4203b8c0
MT
14
15 <meta property="og:type" content="article" />
cb2cb985
MT
16 {% if post.published_at %}
17 <meta property="og:article:published_time" content="{{ post.published_at.isoformat() }}" />
18 {% end %}
4203b8c0
MT
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 }}" />
34472923 34 <meta property="twitter:image" content="{{ static_url("img/ipfire-tux.png") }}" />
4203b8c0
MT
35{% end block %}
36
80b26795 37{% block container %}
894c5a5a
MT
38 {% import ipfire.accounts as accounts %}
39
b70fba24 40 <section class="hero {% if "lightningwirelabs.com" in post.tags %}is-lwl{% elif post.is_published() %}is-primary{% else %}is-light{% end %}">
50703fb8
RH
41 <div class="hero-body">
42 <div class="container">
ed83981e 43 <nav class="breadcrumb" aria-label="breadcrumbs">
50703fb8
RH
44 <ul>
45 <li>
2fd7c6de 46 <a href="/">{{ _("Home") }}</a>
50703fb8
RH
47 </li>
48 <li>
2fd7c6de 49 <a href="/blog">{{ _("Blog") }}</a>
50703fb8
RH
50 </li>
51 <li class="is-active">
52 <a href="#" aria-current="page">{{ post.title }}</a>
53 </li>
54 </ul>
55 </nav>
8b285f50 56
ed83981e 57 <h1 class="title">{{ post.title }}</h1>
80b26795 58
ed83981e 59 <h6 class="subtitle">
50703fb8
RH
60 {{ _("by") }}
61
62 {% if isinstance(post.author, accounts.Account) %}
1f153396 63 <a href="/users/{{ post.author.uid }}">{{ post.author.name }}</a>,
50703fb8
RH
64 {% else %}
65 <strong>{{ post.author }}</strong>,
66 {% end %}
80b26795 67
50703fb8
RH
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) }}
80b26795 74 {% end %}
50703fb8 75 {% elif post.published_at %}
0f95b741 76 {{ _("Scheduled to be published %s") % locale.format_date(post.published_at, relative=False) }}
50703fb8 77 {% else %}
0f95b741 78 {{ _("Not published, yet") }}
50703fb8 79 {% end %}
8b285f50 80 </h6>
80b26795 81 </div>
50703fb8
RH
82 </div>
83 </section>
84
f956e337
MT
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 %}
268a972b 96 <a class="has-text-weight-bold" href="/join">
f956e337
MT
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
8b285f50
MT
109 <section class="section">
110 <div class="container">
8afa74b5 111 <div class="columns is-justify-content-space-between">
44ce9657 112 <div class="column is-8">
b8d3f2f5
MT
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 }}">
f99843bc
MT
116 <span class="icon">
117 <i class="fas fa-external-link-alt"></i>
b8d3f2f5 118 </span>
f99843bc 119 <span>{{ _("Go to Lightning Wire Labs") }}</span>
b8d3f2f5
MT
120 </a>
121 {% end %}
8b285f50 122
b8d3f2f5
MT
123 {% if post.release or "donate" in post.tags %}
124 <a class="button is-primary is-fullwidth" href="/donate">
f99843bc
MT
125 <span class="icon">
126 <i class="fas fa-heart"></i>
b8d3f2f5 127 </span>
f99843bc 128 <span>{{ _("Donate") }}</span>
b8d3f2f5
MT
129 </a>
130 {% end %}
8b285f50 131
b8d3f2f5 132 {% if post.release %}
aec63a26 133 <a class="button is-dark is-fullwidth" href="/downloads/{{ post.release.slug }}">
f99843bc
MT
134 <span class="icon">
135 <i class="fas fa-download"></i>
b8d3f2f5 136 </span>
2fd7c6de
RH
137 <span>{{ _("Download") }} <span class="is-hidden-mobile">{{ post.release }}</span></span>
138
b8d3f2f5
MT
139 </a>
140 {% end %}
8afa74b5
MT
141 </div>
142
143 <div class="block">
144 <div class="content">
145 {% raw post.html %}
146 </div>
147 </div>
148 </div>
4d657f4f 149
8afa74b5
MT
150 {# Author Stuff #}
151
152 {% if post.is_editable(current_user) %}
153 <div class="column is-3">
154 <div class="buttons">
11a442f4
MT
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
4d657f4f
MT
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>
8b285f50 170 </div>
b8d3f2f5 171 </div>
8afa74b5 172 {% end %}
50703fb8
RH
173 </div>
174 </div>
8b285f50 175 </section>
672be316
MT
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 %}
12e5de7e 191{% end block %}