💾 Archived View for lists.flounder.online › patches › threads › 20210323080251.2129-1-johann@qwertqw… captured on 2022-04-28 at 19:24:30. Gemini links have been rewritten to link to archived content

View Raw

More Information

-=-=-=-=-=-=-

[PATCH mygit v1 1/2] get site name directly from CONFIG

[PATCH mygit v1 1/2] get site name directly from CONFIG

From: johann@qwertqwefsday.eu

Date: Tue, 23 Mar 2021 09:02:51 +0100

Message-Id: 20210323080251.2129-1-johann@qwertqwefsday.eu

To: <~aw/patches@lists.sr.ht>

Cc: "Johann150" <johann@qwertqwefsday.eu>

Reply

Export

--------------------------------------

From: Johann150 <johann@qwertqwefsday.eu>

This reverts commit 04082ef80ab084046f6faf228dfdcc365b49333a.

---

src/main.rs | 6 +-----

templates/index.html | 2 +-

2 files changed, 2 insertions(+), 6 deletions(-)

diff --git a/src/main.rs b/src/main.rs

index be316b0..c78f8f1 100644

--- a/src/main.rs

+++ b/src/main.rs

@@ -100,7 +100,6 @@ fn args() -> Config {

#[template(path = "index.html")] // using the template in this path, relative

struct IndexTemplate {

repos: Vec<Repository>,

- site_name: String,

}

async fn index(_req: Request<()>) -> tide::Result {

@@ -118,10 +117,7 @@ async fn index(_req: Request<()>) -> tide::Result {

})

.map_err(|e| tide::log::warn!("can not read repositories: {}", e))

.unwrap_or_default();

- let index_template = IndexTemplate {

- repos,

- site_name: CONFIG.site_name.to_owned(),

- };

+ let index_template = IndexTemplate { repos };

Ok(index_template.into())

}

diff --git a/templates/index.html b/templates/index.html

index 7744fe6..f0ed91e 100644

--- a/templates/index.html

+++ b/templates/index.html

@@ -1,7 +1,7 @@

{% extends "base.html" %}

{% block content %}

-<div class="page-title"><h1>{{site_name}}</h1></div>

+ <div class="page-title"><h1>{{crate::CONFIG.site_name}}</h1></div>

<div>

<table>

{% for repo in repos %}

--

2.20.1