Easier to customise title/tagline

Also added description that can replace frontpage blurb
This commit is contained in:
Ben Arc
2021-07-02 12:31:05 +01:00
parent c1c1332e37
commit ae0849143b
6 changed files with 66 additions and 49 deletions

View File

@@ -14,7 +14,9 @@ LNBITS_FORCE_HTTPS=true
LNBITS_SERVICE_FEE="0.0" LNBITS_SERVICE_FEE="0.0"
# Change theme # 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 # Choose from mint, flamingo, salvador, autumn, monochrome, classic
LNBITS_THEME_OPTIONS="mint, flamingo, classic, autumn, monochrome, salvador" LNBITS_THEME_OPTIONS="mint, flamingo, classic, autumn, monochrome, salvador"

View File

@@ -104,6 +104,8 @@ def register_assets(app: QuartTrio):
def register_filters(app: QuartTrio): def register_filters(app: QuartTrio):
"""Jinja filters.""" """Jinja filters."""
app.jinja_env.globals["SITE_TITLE"] = app.config["LNBITS_SITE_TITLE"] 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_THEME_OPTIONS"] = app.config["LNBITS_THEME_OPTIONS"]
app.jinja_env.globals["LNBITS_VERSION"] = app.config["LNBITS_COMMIT"] app.jinja_env.globals["LNBITS_VERSION"] = app.config["LNBITS_COMMIT"]
app.jinja_env.globals["EXTENSIONS"] = get_valid_extensions() app.jinja_env.globals["EXTENSIONS"] = get_valid_extensions()

View File

@@ -37,28 +37,29 @@
<q-card> <q-card>
<q-card-section> <q-card-section>
<h3 class="q-my-none"><strong>LN</strong>bits</h3> <h3 class="q-my-none">{{SITE_TITLE}}</h3>
<h5 class="q-my-md">Free and open-source lightning wallet</h5> <h5 class="q-my-md">{{SITE_TAGLINE}}</h5>
<div v-if="'{{SITE_TITLE}}' == 'LNbits'">
<p> <p>
Easy to set up and lightweight, LNbits can run on any Easy to set up and lightweight, LNbits can run on any
lightning-network funding source, currently supporting LND, lightning-network funding source, currently supporting LND,
c-lightning, OpenNode, lntxbot, LNPay and even LNbits itself! c-lightning, OpenNode, lntxbot, LNPay and even LNbits itself!
</p> </p>
<p> <p>
You can run LNbits for yourself, or easily offer a custodian solution You can run LNbits for yourself, or easily offer a custodian
for others. solution for others.
</p> </p>
<p> <p>
Each wallet has its own API keys and there is no limit to the number 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 of wallets you can make. Being able to partition funds makes LNbits
useful tool for money management and as a development tool. a useful tool for money management and as a development tool.
</p> </p>
<p> <p>
Extensions add extra functionality to LNbits so you can experiment Extensions add extra functionality to LNbits so you can experiment
with a range of cutting-edge technologies on the lightning network. We with a range of cutting-edge technologies on the lightning network.
have made developing extensions as easy as possible, and as a free and We have made developing extensions as easy as possible, and as a
open-source project, we encourage people to develop and submit their free and open-source project, we encourage people to develop and
own. submit their own.
</p> </p>
<div class="row q-mt-md q-gutter-sm"> <div class="row q-mt-md q-gutter-sm">
<q-btn <q-btn
@@ -80,12 +81,14 @@
>Donate</q-btn >Donate</q-btn
> >
</div> </div>
</div>
<p v-else>{{SITE_DESCRIPTION}}</p>
</q-card-section> </q-card-section>
</q-card> </q-card>
</div> </div>
<!-- Ads --> <!-- Ads -->
<div class="col-12 col-md-3 col-lg-3"> <div class="col-12 col-md-3 col-lg-3" v-if="'{{SITE_TITLE}}' == 'LNbits'">
<div class="row q-col-gutter-lg justify-center"> <div class="row q-col-gutter-lg justify-center">
<div class="col-6 col-sm-4 col-md-8 q-gutter-y-sm"> <div class="col-6 col-sm-4 col-md-8 q-gutter-y-sm">
<q-btn <q-btn

View File

@@ -222,7 +222,7 @@
<q-card> <q-card>
<q-card-section> <q-card-section>
<h6 class="text-subtitle1 q-mt-none q-mb-sm"> <h6 class="text-subtitle1 q-mt-none q-mb-sm">
LNbits wallet: <strong><em>{{ wallet.name }}</em></strong> {{ SITE_TITLE }} wallet: <strong><em>{{ wallet.name }}</em></strong>
</h6> </h6>
</q-card-section> </q-card-section>
<q-card-section class="q-pa-none"> <q-card-section class="q-pa-none">

View File

@@ -31,7 +31,15 @@ LNBITS_DISABLED_EXTENSIONS: List[str] = env.list(
) )
LNBITS_SITE_TITLE = env.str("LNBITS_SITE_TITLE", default="LNbits") 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() WALLET = wallet_class()
DEFAULT_WALLET_NAME = env.str("LNBITS_DEFAULT_WALLET_NAME", default="LNbits wallet") DEFAULT_WALLET_NAME = env.str("LNBITS_DEFAULT_WALLET_NAME", default="LNbits wallet")

View File

@@ -155,10 +155,12 @@
> >
<q-toolbar> <q-toolbar>
<q-toolbar-title class="text-caption"> <q-toolbar-title class="text-caption">
<strong>LN</strong>bits, free and open-source lightning {{ SITE_TITLE }}, {{SITE_TAGLINE}}
wallet/accounts system
<br /> <br />
<small>Commit version: {{LNBITS_VERSION}}</small>
<small v-if="'{{SITE_TITLE}}' == 'LNbits'"
>Commit version: {{LNBITS_VERSION}}</small
>
</q-toolbar-title> </q-toolbar-title>
<q-space></q-space> <q-space></q-space>
<q-btn <q-btn