From ae0849143b8e274ab0fcaa5a7ac7b7c727787196 Mon Sep 17 00:00:00 2001 From: Ben Arc Date: Fri, 2 Jul 2021 12:31:05 +0100 Subject: [PATCH] Easier to customise title/tagline Also added description that can replace frontpage blurb --- .env.example | 4 +- lnbits/app.py | 2 + lnbits/core/templates/core/index.html | 89 +++++++++++++------------- lnbits/core/templates/core/wallet.html | 2 +- lnbits/settings.py | 10 ++- lnbits/templates/base.html | 8 ++- 6 files changed, 66 insertions(+), 49 deletions(-) diff --git a/.env.example b/.env.example index 65e81428b..2d9916b06 100644 --- a/.env.example +++ b/.env.example @@ -14,7 +14,9 @@ LNBITS_FORCE_HTTPS=true LNBITS_SERVICE_FEE="0.0" # Change theme -LNBITS_SITE_TITLE=LNbits +LNBITS_SITE_TITLE="LNbits" +LNBITS_SITE_TAGLINE="free and open-source lightning wallet" +LNBITS_SITE_DESCRIPTION="Some description about your service, will display if title is not 'LNbits'" # Choose from mint, flamingo, salvador, autumn, monochrome, classic LNBITS_THEME_OPTIONS="mint, flamingo, classic, autumn, monochrome, salvador" diff --git a/lnbits/app.py b/lnbits/app.py index 40d50d045..f264bf4a8 100644 --- a/lnbits/app.py +++ b/lnbits/app.py @@ -104,6 +104,8 @@ def register_assets(app: QuartTrio): def register_filters(app: QuartTrio): """Jinja filters.""" app.jinja_env.globals["SITE_TITLE"] = app.config["LNBITS_SITE_TITLE"] + app.jinja_env.globals["SITE_TAGLINE"] = app.config["LNBITS_SITE_TAGLINE"] + app.jinja_env.globals["SITE_DESCRIPTION"] = app.config["LNBITS_SITE_DESCRIPTION"] app.jinja_env.globals["LNBITS_THEME_OPTIONS"] = app.config["LNBITS_THEME_OPTIONS"] app.jinja_env.globals["LNBITS_VERSION"] = app.config["LNBITS_COMMIT"] app.jinja_env.globals["EXTENSIONS"] = get_valid_extensions() diff --git a/lnbits/core/templates/core/index.html b/lnbits/core/templates/core/index.html index 14842e925..a7e9c39d1 100644 --- a/lnbits/core/templates/core/index.html +++ b/lnbits/core/templates/core/index.html @@ -37,55 +37,58 @@ -

LNbits

-
Free and open-source lightning wallet
-

- Easy to set up and lightweight, LNbits can run on any - lightning-network funding source, currently supporting LND, - c-lightning, OpenNode, lntxbot, LNPay and even LNbits itself! -

-

- You can run LNbits for yourself, or easily offer a custodian solution - for others. -

-

- Each wallet has its own API keys and there is no limit to the number - of wallets you can make. Being able to partition funds makes LNbits a - useful tool for money management and as a development tool. -

-

- Extensions add extra functionality to LNbits so you can experiment - with a range of cutting-edge technologies on the lightning network. We - have made developing extensions as easy as possible, and as a free and - open-source project, we encourage people to develop and submit their - own. -

-
- View project in GitHub - Donate +

{{SITE_TITLE}}

+
{{SITE_TAGLINE}}
+
+

+ Easy to set up and lightweight, LNbits can run on any + lightning-network funding source, currently supporting LND, + c-lightning, OpenNode, lntxbot, LNPay and even LNbits itself! +

+

+ You can run LNbits for yourself, or easily offer a custodian + solution for others. +

+

+ Each wallet has its own API keys and there is no limit to the number + of wallets you can make. Being able to partition funds makes LNbits + a useful tool for money management and as a development tool. +

+

+ Extensions add extra functionality to LNbits so you can experiment + with a range of cutting-edge technologies on the lightning network. + We have made developing extensions as easy as possible, and as a + free and open-source project, we encourage people to develop and + submit their own. +

+
+ View project in GitHub + Donate +
+

{{SITE_DESCRIPTION}}

-
+
- LNbits wallet: {{ wallet.name }} + {{ SITE_TITLE }} wallet: {{ wallet.name }}
diff --git a/lnbits/settings.py b/lnbits/settings.py index d7428f6cb..248d6e9aa 100644 --- a/lnbits/settings.py +++ b/lnbits/settings.py @@ -31,7 +31,15 @@ LNBITS_DISABLED_EXTENSIONS: List[str] = env.list( ) LNBITS_SITE_TITLE = env.str("LNBITS_SITE_TITLE", default="LNbits") -LNBITS_THEME_OPTIONS: List[str] = env.list("LNBITS_THEME_OPTIONS", default="classic, flamingo, mint, salvador, monochrome, autumn", subcast=str) +LNBITS_SITE_TAGLINE = env.str( + "LNBITS_SITE_TAGLINE", default="free and open-source lightning wallet" +) +LNBITS_SITE_DESCRIPTION = env.str("LNBITS_SITE_DESCRIPTION", default="") +LNBITS_THEME_OPTIONS: List[str] = env.list( + "LNBITS_THEME_OPTIONS", + default="classic, flamingo, mint, salvador, monochrome, autumn", + subcast=str, +) WALLET = wallet_class() DEFAULT_WALLET_NAME = env.str("LNBITS_DEFAULT_WALLET_NAME", default="LNbits wallet") diff --git a/lnbits/templates/base.html b/lnbits/templates/base.html index 9a54a71d3..d4b7e9715 100644 --- a/lnbits/templates/base.html +++ b/lnbits/templates/base.html @@ -155,10 +155,12 @@ > - LNbits, free and open-source lightning - wallet/accounts system + {{ SITE_TITLE }}, {{SITE_TAGLINE}}
- Commit version: {{LNBITS_VERSION}} + + Commit version: {{LNBITS_VERSION}}