From bcfa1d86f870d537219f7b50ab35c69e7fe59e08 Mon Sep 17 00:00:00 2001
From: Enjeck Cleopatra <patrathewhiz@gmail.com>
Date: Thu, 24 Mar 2022 18:28:08 +0100
Subject: [PATCH] Redesign news index and blogposts

---
 assets/css/styles.css                         |  2 +-
 .../news/2017-beta-released-security-audit.md |  2 -
 content/news/2018-1.0-released-new-funding.md |  2 -
 content/news/2018-briar-1.1-released.md       |  2 -
 ...2019-briar-1.2-released-remote-contacts.md |  2 -
 content/news/2021-briar-1.3-released.md       |  2 -
 content/news/2021-briar-1.4-released.md       |  2 -
 .../2022-briar-removed-from-google-play.md    |  2 -
 themes/briar/layouts/_default/section.html    | 12 ++-
 themes/briar/layouts/_default/single.html     |  8 ++
 themes/briar/layouts/partials/head.html       |  7 +-
 themes/briar/layouts/partials/header.html     | 83 ++++++++++---------
 12 files changed, 66 insertions(+), 60 deletions(-)

diff --git a/assets/css/styles.css b/assets/css/styles.css
index 0296bbe..cb0b724 100644
--- a/assets/css/styles.css
+++ b/assets/css/styles.css
@@ -53,7 +53,7 @@ figcaption {
 }
 
 table {
-    width: 100%
+    width: 100%;
     border-collapse: collapse;
     border-spacing: 0;
 }
diff --git a/content/news/2017-beta-released-security-audit.md b/content/news/2017-beta-released-security-audit.md
index 939d1b9..942876c 100644
--- a/content/news/2017-beta-released-security-audit.md
+++ b/content/news/2017-beta-released-security-audit.md
@@ -8,8 +8,6 @@ title: 'Briar - Darknet Messenger Releases Beta, Passes Security Audit'
 Press Release
 -------------
 
-##### July 21 2017
-
 After extensive private beta tests, the first public beta of Briar was
 [released
 today](https://play.google.com/store/apps/details?id=org.briarproject.briar.beta).
diff --git a/content/news/2018-1.0-released-new-funding.md b/content/news/2018-1.0-released-new-funding.md
index 313b2ff..86d6b7a 100644
--- a/content/news/2018-1.0-released-new-funding.md
+++ b/content/news/2018-1.0-released-new-funding.md
@@ -7,8 +7,6 @@ title: 'Briar - Secure P2P Messenger Releases First Version, Receives New Fundin
 
 ### Press Release
 
-##### May 9 2018
-
 The peer-to-peer messenger Briar released its first stable version
 today. It is available for Android devices from [Google
 Play](https://play.google.com/store/apps/details?id=org.briarproject.briar.android)
diff --git a/content/news/2018-briar-1.1-released.md b/content/news/2018-briar-1.1-released.md
index ad65c9e..08e302a 100644
--- a/content/news/2018-briar-1.1-released.md
+++ b/content/news/2018-briar-1.1-released.md
@@ -7,8 +7,6 @@ title: 'Briar 1.1 released with dark theme, new emoji and more'
 
 ### Press Release
 
-##### September 14 2018
-
 The Briar Project released version 1.1 of its Android app today. This
 release adds new features following the app's [first public
 release](/news/2018-1.0-released-new-funding/) in May.
diff --git a/content/news/2019-briar-1.2-released-remote-contacts.md b/content/news/2019-briar-1.2-released-remote-contacts.md
index d8fbe67..d5b7a65 100644
--- a/content/news/2019-briar-1.2-released-remote-contacts.md
+++ b/content/news/2019-briar-1.2-released-remote-contacts.md
@@ -7,8 +7,6 @@ title: 'Briar 1.2 released, contacts can now be added by exchanging links'
 
 ### Press Release
 
-##### November 6 2019
-
 The Briar Project released version 1.2 of its Android app today.
 This release allows users to add each other securely by exchanging links.
 Previously users needed to meet in person or ask a mutual contact to introduce them.
diff --git a/content/news/2021-briar-1.3-released.md b/content/news/2021-briar-1.3-released.md
index 0cbd127..a8fed18 100644
--- a/content/news/2021-briar-1.3-released.md
+++ b/content/news/2021-briar-1.3-released.md
@@ -8,8 +8,6 @@ title: 'Briar 1.3 released - image attachments, profile images and disappearing
 
 ### Press release
 
-##### June 7 2021
-
 {{< figure src="/img/internet-shutdown.jpg" link="/img/internet-shutdown.jpg"
 class="fullwidth" alt="Using Briar during internet shutdown"
 >}}
diff --git a/content/news/2021-briar-1.4-released.md b/content/news/2021-briar-1.4-released.md
index 25ed95a..b40d5d6 100644
--- a/content/news/2021-briar-1.4-released.md
+++ b/content/news/2021-briar-1.4-released.md
@@ -7,8 +7,6 @@ title: 'Briar 1.4 released - offline app sharing, message transfer via SD cards
 
 ### Press release
 
-##### November 15 2021
-
 The Briar Project released version 1.4 of its Android app today. This release adds a couple of new features, highlighted below.
 
 First of all, users can now share the app offline. Prior to this release, the only way to get the app was to to download it from the internet, which requires an internet connection. Now, it is possible to share the app offline to others who don't have it installed. When this option is selected from within the app, it opens a local hotspot and provides a website where others can download the Briar app without an internet connection. This feature might be useful during internet shutdowns or natural disasters. A single device with Briar installed can share the app to bootstrap Briar connectivity in a community. 
diff --git a/content/news/2022-briar-removed-from-google-play.md b/content/news/2022-briar-removed-from-google-play.md
index ef401b8..8793b2d 100644
--- a/content/news/2022-briar-removed-from-google-play.md
+++ b/content/news/2022-briar-removed-from-google-play.md
@@ -7,8 +7,6 @@ title: 'Briar is available on Google Play again'
 
 ### Status update
 
-##### February 28 2022
-
 **Update (February 28, 13:20 UTC): Briar is available on Google Play again.**
 
 Briar was briefly removed from Google Play because we didn't provide Google's review team with a username and password for testing the app. We provided Google with a username and password for testing and the app is now available again.
diff --git a/themes/briar/layouts/_default/section.html b/themes/briar/layouts/_default/section.html
index c62f56c..1115cf4 100644
--- a/themes/briar/layouts/_default/section.html
+++ b/themes/briar/layouts/_default/section.html
@@ -6,11 +6,19 @@
       <h3 itemprop="headline" class="blog-post-title">
         <a href="{{.Permalink}}">{{.Title}}</a>
       </h3>
-      <p class="blog-post-meta">{{.Date.Format "2006-01-02"}}
+      <p class="blog-post-meta">
+        {{.Date.Format "January 2, 2006"}} by
         {{ if (isset .Params "author") }}
-          by {{ markdownify .Params.author }}
+          {{ markdownify .Params.author }}
+        {{ else }}
+          The Briar Team
         {{ end }}
       </p>
+      <div>
+        {{ .Summary | safeHTML |  truncate 250 }}
+        <a href='{{ .Permalink }}'><nobr>Read more →</nobr></a>
+      </div>
+      <hr/>
     {{ end }}
   {{ end }}
 {{ end }}
diff --git a/themes/briar/layouts/_default/single.html b/themes/briar/layouts/_default/single.html
index e22c3a1..d32a1bb 100644
--- a/themes/briar/layouts/_default/single.html
+++ b/themes/briar/layouts/_default/single.html
@@ -1,4 +1,12 @@
 {{ define "main" }}
 <h2>{{ .Title }}</h2>
+<p>
+    {{.Date.Format "January 2, 2006"}} by
+    {{ if (isset .Params "author") }}
+      {{ markdownify .Params.author }}
+    {{ else }}
+      The Briar Team
+    {{ end }}
+</p>
 {{ .Content }}
 {{ end }}
diff --git a/themes/briar/layouts/partials/head.html b/themes/briar/layouts/partials/head.html
index 96a6fa9..9cee32f 100644
--- a/themes/briar/layouts/partials/head.html
+++ b/themes/briar/layouts/partials/head.html
@@ -1,6 +1,6 @@
 <head>
   <meta charset="utf-8" />
-  {{ .Hugo.Generator }}
+  {{ hugo.Generator }}
   {{ with resources.Get "css/styles.css" | minify }}
   <style media="screen">{{ .Content | safeCSS }}</style>
   {{ end }}
@@ -16,7 +16,8 @@
 
   <link href="/news/index.xml" rel="alternate" type="application/rss+xml" title="Briar News" />
   <link href="/index.xml" rel="alternate" type="application/rss+xml" title="Briar - All changes" />
-  {{ if .RSSLink }}
-  <link href="{{ .RSSLink }}" rel="alternate" type="application/rss+xml" title="{{ with .Title }}{{ . }} - {{ end }} {{ .Site.Title }}" />
+  {{ if .OutputFormats.Get "RSS" }}
+  <link rel="alternate" type="application/rss+xml" title="{{ with .Title }}{{ . }} - {{ end }} {{ .Site.Title }}"
+    href='{{ with .OutputFormats.Get "RSS" }}{{ .RelPermalink }}{{ end }}' />
   {{ end }}
 </head>
diff --git a/themes/briar/layouts/partials/header.html b/themes/briar/layouts/partials/header.html
index 6758e38..3a26f2f 100644
--- a/themes/briar/layouts/partials/header.html
+++ b/themes/briar/layouts/partials/header.html
@@ -1,40 +1,43 @@
-    <div id="header_container">
-      <div id="header">
-        <a href="/"><div id="logo"><img src="/img/briar_logo_large.png" alt="Briar" class="logo"/></div></a>
-        <div id="nav">
-          <div id="signup">
-            <div class="twitter">
-              <a href="https://code.briarproject.org/briar" rel="noopener noreferrer"><img class="twitterbutton" src="/img/gitlab.png" alt="Small GitLab logo"/></a>
-            </div>
-            <div class="twitter">
-              <a href="https://twitter.com/BriarApp" rel="noopener noreferrer"><img class="twitterbutton" src="/img/twitter.png" alt="Small Twitter logo"/></a>
-            </div>
-            <form id="signupform" action="https://sourceforge.net/projects/briar/lists/briar-announce" rel="noopener noreferrer" method="get" onSubmit="submitForm()">
-              <input placeholder="Email address" type="email" name="email" tabindex="2"/>
-              <button name="submit" type="submit" id="signup-submit">Keep me updated</button>
-            </form>
-            <div id="signupconf">Thanks! We'll keep you updated.</div>
-            <script>
-            <!--
-            function submitForm(){
-                document.getElementById('signupform').style.display = 'none';
-                document.getElementById('signupconf').style.display = 'block';
-                return true;
-            }
-            //-->
-            </script>
-          </div> <!-- signup -->
-          <label for="menu-toggle"><img src="/img/menu.png" alt="Drop-down menu"></label>
-          <input type="checkbox" id="menu-toggle"/>
-          <ul id="menu">
-          {{ $currentPage := . }}
-          {{ range .Site.Menus.main }}
-          <li>
-          <a {{ if eq $currentPage.URL .URL }}id="is-active"{{end}}
-             href="{{ .URL }}">{{ .Name }}</a>
-          </li>
-          {{ end }}
-          </ul>
-        </div> <!-- nav -->
-      </div> <!-- header -->
-    </div> <!-- header_container -->
+<div id="header_container">
+  <div id="header">
+    <a href="/"><div id="logo"><img src="/img/briar_logo_large.png" alt="Briar" class="logo"/></div></a>
+    <div id="nav">
+      <div id="signup">
+        <div class="twitter">
+          <a href="https://code.briarproject.org/briar" rel="noopener noreferrer"><img class="twitterbutton" src="/img/gitlab.png" alt="Small GitLab logo"/></a>
+        </div>
+        <div class="twitter">
+          <a href="https://twitter.com/BriarApp" rel="noopener noreferrer"><img class="twitterbutton" src="/img/twitter.png" alt="Small Twitter logo"/></a>
+        </div>
+        <form id="signupform" action="https://sourceforge.net/projects/briar/lists/briar-announce" rel="noopener noreferrer" method="get" onSubmit="submitForm()">
+          <input placeholder="Email address" type="email" name="email" tabindex="2"/>
+          <button name="submit" type="submit" id="signup-submit">Keep me updated</button>
+        </form>
+        <div id="signupconf">Thanks! We'll keep you updated.</div>
+        <script>
+        //<!--
+        function submitForm(){
+            document.getElementById('signupform').style.display = 'none';
+            document.getElementById('signupconf').style.display = 'block';
+            return true;
+        }
+        //-->
+        </script>
+      </div> <!-- signup -->
+      <label for="menu-toggle"><img src="/img/menu.png" alt="Drop-down menu"></label>
+      <input type="checkbox" id="menu-toggle"/>
+      <ul id="menu">
+        {{ $currentPage := . }} 
+        {{ range .Site.Menus.main }} 
+        {{ $menu_item_url
+        := .URL | relLangURL }} 
+        {{ $page_url:= $currentPage.RelPermalink | relLangURL }}
+        <li>
+          <a {{ if eq $menu_item_url $page_url }}id="is-active" {{end}} 
+          href="{{ .URL }}">{{ .Name }}</a>
+        </li>
+        {{ end }}
+      </ul>
+    </div> <!-- nav -->
+  </div> <!-- header -->
+</div> <!-- header_container -->
\ No newline at end of file
-- 
GitLab