Add global site name setting to render name on public pages.

This commit is contained in:
Kailash Nadh 2022-11-10 21:19:53 +05:30
parent eac1240437
commit 438568eeb0
28 changed files with 36 additions and 5 deletions

View file

@ -49,6 +49,7 @@ const (
// constants contains static, constant config values required by the app. // constants contains static, constant config values required by the app.
type constants struct { type constants struct {
SiteName string `koanf:"site_name"`
RootURL string `koanf:"root_url"` RootURL string `koanf:"root_url"`
LogoURL string `koanf:"logo_url"` LogoURL string `koanf:"logo_url"`
FaviconURL string `koanf:"favicon_url"` FaviconURL string `koanf:"favicon_url"`
@ -693,6 +694,7 @@ func initHTTPServer(app *App) *echo.Echo {
} }
srv.Renderer = &tplRenderer{ srv.Renderer = &tplRenderer{
templates: tpl, templates: tpl,
SiteName: app.constants.SiteName,
RootURL: app.constants.RootURL, RootURL: app.constants.RootURL,
LogoURL: app.constants.LogoURL, LogoURL: app.constants.LogoURL,
FaviconURL: app.constants.FaviconURL, FaviconURL: app.constants.FaviconURL,

View file

@ -26,6 +26,7 @@ const (
// tplRenderer wraps a template.tplRenderer for echo. // tplRenderer wraps a template.tplRenderer for echo.
type tplRenderer struct { type tplRenderer struct {
templates *template.Template templates *template.Template
SiteName string
RootURL string RootURL string
LogoURL string LogoURL string
FaviconURL string FaviconURL string
@ -35,6 +36,7 @@ type tplRenderer struct {
// tplData is the data container that is injected // tplData is the data container that is injected
// into public templates for accessing data. // into public templates for accessing data.
type tplData struct { type tplData struct {
SiteName string
RootURL string RootURL string
LogoURL string LogoURL string
FaviconURL string FaviconURL string
@ -85,6 +87,7 @@ var (
// Render executes and renders a template for echo. // Render executes and renders a template for echo.
func (t *tplRenderer) Render(w io.Writer, name string, data interface{}, c echo.Context) error { func (t *tplRenderer) Render(w io.Writer, name string, data interface{}, c echo.Context) error {
return t.templates.ExecuteTemplate(w, name, tplData{ return t.templates.ExecuteTemplate(w, name, tplData{
SiteName: t.SiteName,
RootURL: t.RootURL, RootURL: t.RootURL,
LogoURL: t.LogoURL, LogoURL: t.LogoURL,
FaviconURL: t.FaviconURL, FaviconURL: t.FaviconURL,

View file

@ -1,9 +1,14 @@
<template> <template>
<div class="items"> <div class="items">
<b-field :label="$t('settings.general.siteName')" label-position="on-border">
<b-input v-model="data['app.site_name']" name="app.root_url"
:label="$t('settings.general.siteName')" :maxlength="300" required />
</b-field>
<b-field :label="$t('settings.general.rootURL')" label-position="on-border" <b-field :label="$t('settings.general.rootURL')" label-position="on-border"
:message="$t('settings.general.rootURLHelp')"> :message="$t('settings.general.rootURLHelp')">
<b-input v-model="data['app.root_url']" name="app.root_url" <b-input v-model="data['app.root_url']" name="app.root_url"
placeholder='https://listmonk.yoursite.com' :maxlength="300" /> placeholder='https://listmonk.yoursite.com' :maxlength="300" required />
</b-field> </b-field>
<div class="columns"> <div class="columns">

View file

@ -383,6 +383,7 @@
"settings.general.rootURLHelp": "URL públic de la instal·lació (sense barra inclinada).", "settings.general.rootURLHelp": "URL públic de la instal·lació (sense barra inclinada).",
"settings.general.sendOptinConfirm": "Envia opt-in de confirmació", "settings.general.sendOptinConfirm": "Envia opt-in de confirmació",
"settings.general.sendOptinConfirmHelp": "Envia un correu electrònic de confirmació de l'opt-in quan els subscriptors s'inscriguin mitjançant el formulari públic o quan l'administrador els afegeixi.", "settings.general.sendOptinConfirmHelp": "Envia un correu electrònic de confirmació de l'opt-in quan els subscriptors s'inscriguin mitjançant el formulari públic o quan l'administrador els afegeixi.",
"settings.general.siteName": "Site name",
"settings.invalidMessengerName": "Nom de canal no vàlid", "settings.invalidMessengerName": "Nom de canal no vàlid",
"settings.mailserver.authProtocol": "Protocol d'autenticació", "settings.mailserver.authProtocol": "Protocol d'autenticació",
"settings.mailserver.host": "Host", "settings.mailserver.host": "Host",

View file

@ -384,6 +384,7 @@
"settings.general.rootURLHelp": "Veřejná adresa URL instalace (bez koncového lomítka).", "settings.general.rootURLHelp": "Veřejná adresa URL instalace (bez koncového lomítka).",
"settings.general.sendOptinConfirm": "Odeslat souhlas s odběrem", "settings.general.sendOptinConfirm": "Odeslat souhlas s odběrem",
"settings.general.sendOptinConfirmHelp": "Odeslat e-mail se souhlasem po přihlášení nebo přidání nových odběratelů na admin formuláři.", "settings.general.sendOptinConfirmHelp": "Odeslat e-mail se souhlasem po přihlášení nebo přidání nových odběratelů na admin formuláři.",
"settings.general.siteName": "Site name",
"settings.invalidMessengerName": "Neplatné jméno kurýra.", "settings.invalidMessengerName": "Neplatné jméno kurýra.",
"settings.mailserver.authProtocol": "Ověřovací protokol", "settings.mailserver.authProtocol": "Ověřovací protokol",
"settings.mailserver.host": "Hostitel", "settings.mailserver.host": "Hostitel",

View file

@ -384,6 +384,7 @@
"settings.general.rootURLHelp": "Öffentliche URL der Installation (ohne Slash am Ende).", "settings.general.rootURLHelp": "Öffentliche URL der Installation (ohne Slash am Ende).",
"settings.general.sendOptinConfirm": "Sende Opt-In Bestätigung", "settings.general.sendOptinConfirm": "Sende Opt-In Bestätigung",
"settings.general.sendOptinConfirmHelp": "When new subscribers signup or are added via the admin form, send an opt-in confirmation e-mail.", "settings.general.sendOptinConfirmHelp": "When new subscribers signup or are added via the admin form, send an opt-in confirmation e-mail.",
"settings.general.siteName": "Site name",
"settings.invalidMessengerName": "Der Name des Messengers ist ungültig", "settings.invalidMessengerName": "Der Name des Messengers ist ungültig",
"settings.mailserver.authProtocol": "Autentifizierungsprotokoll", "settings.mailserver.authProtocol": "Autentifizierungsprotokoll",
"settings.mailserver.host": "Server", "settings.mailserver.host": "Server",

View file

@ -383,6 +383,7 @@
"settings.general.rootURLHelp": "Public URL of the installation (no trailing slash).", "settings.general.rootURLHelp": "Public URL of the installation (no trailing slash).",
"settings.general.sendOptinConfirm": "Send opt-in confirmation", "settings.general.sendOptinConfirm": "Send opt-in confirmation",
"settings.general.sendOptinConfirmHelp": "Send an opt-in confirmation e-mail when subscribers signup via the public form or when they are added by the admin.", "settings.general.sendOptinConfirmHelp": "Send an opt-in confirmation e-mail when subscribers signup via the public form or when they are added by the admin.",
"settings.general.siteName": "Site name",
"settings.invalidMessengerName": "Invalid messenger name.", "settings.invalidMessengerName": "Invalid messenger name.",
"settings.mailserver.authProtocol": "Auth protocol", "settings.mailserver.authProtocol": "Auth protocol",
"settings.mailserver.host": "Host", "settings.mailserver.host": "Host",

View file

@ -384,6 +384,7 @@
"settings.general.rootURLHelp": "URL pública de la instalación (sin incluir la barra final)", "settings.general.rootURLHelp": "URL pública de la instalación (sin incluir la barra final)",
"settings.general.sendOptinConfirm": "Enviar confirmación de inscripción", "settings.general.sendOptinConfirm": "Enviar confirmación de inscripción",
"settings.general.sendOptinConfirmHelp": "Cuando haya una nueva subscripción mediante el formulario o la interfaz de administración, enviar un correo de confirmación al usuario.", "settings.general.sendOptinConfirmHelp": "Cuando haya una nueva subscripción mediante el formulario o la interfaz de administración, enviar un correo de confirmación al usuario.",
"settings.general.siteName": "Site name",
"settings.invalidMessengerName": "Nombre inválido de mensajero.", "settings.invalidMessengerName": "Nombre inválido de mensajero.",
"settings.mailserver.authProtocol": "Protocolo de autenticación", "settings.mailserver.authProtocol": "Protocolo de autenticación",
"settings.mailserver.host": "Host/Servidor", "settings.mailserver.host": "Host/Servidor",

View file

@ -384,6 +384,7 @@
"settings.general.rootURLHelp": "Public URL of the installation (no trailing slash).", "settings.general.rootURLHelp": "Public URL of the installation (no trailing slash).",
"settings.general.sendOptinConfirm": "Send opt-in confirmation", "settings.general.sendOptinConfirm": "Send opt-in confirmation",
"settings.general.sendOptinConfirmHelp": "Send an opt-in confirmation e-mail when subscribers signup via the public form or when they are added by the admin.", "settings.general.sendOptinConfirmHelp": "Send an opt-in confirmation e-mail when subscribers signup via the public form or when they are added by the admin.",
"settings.general.siteName": "Site name",
"settings.invalidMessengerName": "Invalid messenger name.", "settings.invalidMessengerName": "Invalid messenger name.",
"settings.mailserver.authProtocol": "Auth protocol", "settings.mailserver.authProtocol": "Auth protocol",
"settings.mailserver.host": "Host", "settings.mailserver.host": "Host",

View file

@ -384,6 +384,7 @@
"settings.general.rootURLHelp": "URL publique de l'installation (sans slash final)", "settings.general.rootURLHelp": "URL publique de l'installation (sans slash final)",
"settings.general.sendOptinConfirm": "Envoyez une confirmation d'adhésion", "settings.general.sendOptinConfirm": "Envoyez une confirmation d'adhésion",
"settings.general.sendOptinConfirmHelp": "Envoyer un e-mail de confirmation d'adhésion quand de nouvelles personnes s'abonnent ou sont ajoutées par l'administrateur.", "settings.general.sendOptinConfirmHelp": "Envoyer un e-mail de confirmation d'adhésion quand de nouvelles personnes s'abonnent ou sont ajoutées par l'administrateur.",
"settings.general.siteName": "Site name",
"settings.invalidMessengerName": "Nom de messagerie invalide", "settings.invalidMessengerName": "Nom de messagerie invalide",
"settings.mailserver.authProtocol": "Protocole d'authentification", "settings.mailserver.authProtocol": "Protocole d'authentification",
"settings.mailserver.host": "Hôte", "settings.mailserver.host": "Hôte",

View file

@ -384,6 +384,7 @@
"settings.general.rootURLHelp": "Public URL of the installation (no trailing slash).", "settings.general.rootURLHelp": "Public URL of the installation (no trailing slash).",
"settings.general.sendOptinConfirm": "Jelentkezési visszaigazolás küldése ", "settings.general.sendOptinConfirm": "Jelentkezési visszaigazolás küldése ",
"settings.general.sendOptinConfirmHelp": "Feliratkozást megerősítő e-mail küldése, amikor az előfizetők a nyilvános űrlapon keresztül regisztrálnak, vagy amikor az adminisztrátor hozzáadja őket.", "settings.general.sendOptinConfirmHelp": "Feliratkozást megerősítő e-mail küldése, amikor az előfizetők a nyilvános űrlapon keresztül regisztrálnak, vagy amikor az adminisztrátor hozzáadja őket.",
"settings.general.siteName": "Site name",
"settings.invalidMessengerName": "Érvénytelen üzenetküldő név.", "settings.invalidMessengerName": "Érvénytelen üzenetküldő név.",
"settings.mailserver.authProtocol": "Auth protokoll", "settings.mailserver.authProtocol": "Auth protokoll",
"settings.mailserver.host": "Host", "settings.mailserver.host": "Host",

View file

@ -384,6 +384,7 @@
"settings.general.rootURLHelp": "URL pubblico dell'installazione (senza barra obliqua finale).", "settings.general.rootURLHelp": "URL pubblico dell'installazione (senza barra obliqua finale).",
"settings.general.sendOptinConfirm": "Send opt-in confirmation", "settings.general.sendOptinConfirm": "Send opt-in confirmation",
"settings.general.sendOptinConfirmHelp": "When new subscribers signup or are added via the admin form, send an opt-in confirmation e-mail.", "settings.general.sendOptinConfirmHelp": "When new subscribers signup or are added via the admin form, send an opt-in confirmation e-mail.",
"settings.general.siteName": "Site name",
"settings.invalidMessengerName": "Nome di messaggeria non valido.", "settings.invalidMessengerName": "Nome di messaggeria non valido.",
"settings.mailserver.authProtocol": "Protocollo di autenticazione", "settings.mailserver.authProtocol": "Protocollo di autenticazione",
"settings.mailserver.host": "Host", "settings.mailserver.host": "Host",

View file

@ -384,6 +384,7 @@
"settings.general.rootURLHelp": "インストール先の公開URL (末尾のスラッシュは不必要).", "settings.general.rootURLHelp": "インストール先の公開URL (末尾のスラッシュは不必要).",
"settings.general.sendOptinConfirm": "オプトインの確認を送信", "settings.general.sendOptinConfirm": "オプトインの確認を送信",
"settings.general.sendOptinConfirmHelp": "加入者が公開フォームからサインアップしたとき、又は管理者によって追加されたときに、オプトイン確認メールを送信。", "settings.general.sendOptinConfirmHelp": "加入者が公開フォームからサインアップしたとき、又は管理者によって追加されたときに、オプトイン確認メールを送信。",
"settings.general.siteName": "Site name",
"settings.invalidMessengerName": "無効なメッセンジャー名.", "settings.invalidMessengerName": "無効なメッセンジャー名.",
"settings.mailserver.authProtocol": "認証プロトコル", "settings.mailserver.authProtocol": "認証プロトコル",
"settings.mailserver.host": "ホスト", "settings.mailserver.host": "ホスト",

View file

@ -384,6 +384,7 @@
"settings.general.rootURLHelp": "ഇൻസ്റ്റാളേഷന്റെ പൊതു യൂ. ആർ. എൽ (അവസാനത്തെ സ്ലാഷ് ആവശ്യമില്ല).", "settings.general.rootURLHelp": "ഇൻസ്റ്റാളേഷന്റെ പൊതു യൂ. ആർ. എൽ (അവസാനത്തെ സ്ലാഷ് ആവശ്യമില്ല).",
"settings.general.sendOptinConfirm": "Send opt-in confirmation", "settings.general.sendOptinConfirm": "Send opt-in confirmation",
"settings.general.sendOptinConfirmHelp": "When new subscribers signup or are added via the admin form, send an opt-in confirmation e-mail.", "settings.general.sendOptinConfirmHelp": "When new subscribers signup or are added via the admin form, send an opt-in confirmation e-mail.",
"settings.general.siteName": "Site name",
"settings.invalidMessengerName": "സന്ദേശവാഹകന്റെ പേര് അസാധുവാണ്", "settings.invalidMessengerName": "സന്ദേശവാഹകന്റെ പേര് അസാധുവാണ്",
"settings.mailserver.authProtocol": "പ്രാമാണീകരണ പ്രോട്ടോക്കോൾ", "settings.mailserver.authProtocol": "പ്രാമാണീകരണ പ്രോട്ടോക്കോൾ",
"settings.mailserver.host": "ഹോസ്റ്റ്", "settings.mailserver.host": "ഹോസ്റ്റ്",

View file

@ -384,6 +384,7 @@
"settings.general.rootURLHelp": "Publieke URL van de installatie (geen trailing slash).", "settings.general.rootURLHelp": "Publieke URL van de installatie (geen trailing slash).",
"settings.general.sendOptinConfirm": "Verzend opt-in bevestiging", "settings.general.sendOptinConfirm": "Verzend opt-in bevestiging",
"settings.general.sendOptinConfirmHelp": "Verzend een opt-in bevestigingsmail als abonnees inschrijven via het publieke formulier of als ze door een administrator worden toegevoegd.", "settings.general.sendOptinConfirmHelp": "Verzend een opt-in bevestigingsmail als abonnees inschrijven via het publieke formulier of als ze door een administrator worden toegevoegd.",
"settings.general.siteName": "Site name",
"settings.invalidMessengerName": "Ongeldige messenger naam.", "settings.invalidMessengerName": "Ongeldige messenger naam.",
"settings.mailserver.authProtocol": "Authenticatieprotocol", "settings.mailserver.authProtocol": "Authenticatieprotocol",
"settings.mailserver.host": "Host", "settings.mailserver.host": "Host",

View file

@ -384,6 +384,7 @@
"settings.general.rootURLHelp": "Publiczny URL instalacji (bez slasha na końcu)", "settings.general.rootURLHelp": "Publiczny URL instalacji (bez slasha na końcu)",
"settings.general.sendOptinConfirm": "Wyślij potwierdzenie opt-in", "settings.general.sendOptinConfirm": "Wyślij potwierdzenie opt-in",
"settings.general.sendOptinConfirmHelp": "Gdy nowi subskrybenci się zapiszą albo zostaną dodanie przez formularz admina wysyłaj maila opt-in z żądaniem potwierdzenia.", "settings.general.sendOptinConfirmHelp": "Gdy nowi subskrybenci się zapiszą albo zostaną dodanie przez formularz admina wysyłaj maila opt-in z żądaniem potwierdzenia.",
"settings.general.siteName": "Site name",
"settings.invalidMessengerName": "Nieprawidłowa nazwa komunikatora.", "settings.invalidMessengerName": "Nieprawidłowa nazwa komunikatora.",
"settings.mailserver.authProtocol": "Protokół autoryzacji", "settings.mailserver.authProtocol": "Protokół autoryzacji",
"settings.mailserver.host": "Host", "settings.mailserver.host": "Host",

View file

@ -384,6 +384,7 @@
"settings.general.rootURLHelp": "URL público da instalação (sem barra final).", "settings.general.rootURLHelp": "URL público da instalação (sem barra final).",
"settings.general.sendOptinConfirm": "Enviar confirmação opt-in", "settings.general.sendOptinConfirm": "Enviar confirmação opt-in",
"settings.general.sendOptinConfirmHelp": "Quando novo assinante se cadastrar ou for adicionado pelo admin, enviar e-mail de confirmação opt-in.", "settings.general.sendOptinConfirmHelp": "Quando novo assinante se cadastrar ou for adicionado pelo admin, enviar e-mail de confirmação opt-in.",
"settings.general.siteName": "Site name",
"settings.invalidMessengerName": "Nome de mensageiro inválido.", "settings.invalidMessengerName": "Nome de mensageiro inválido.",
"settings.mailserver.authProtocol": "Protocolo Autenticação", "settings.mailserver.authProtocol": "Protocolo Autenticação",
"settings.mailserver.host": "Host", "settings.mailserver.host": "Host",

View file

@ -384,6 +384,7 @@
"settings.general.rootURLHelp": "URL público da instalação (sem barra final).", "settings.general.rootURLHelp": "URL público da instalação (sem barra final).",
"settings.general.sendOptinConfirm": "Send opt-in confirmation", "settings.general.sendOptinConfirm": "Send opt-in confirmation",
"settings.general.sendOptinConfirmHelp": "When new subscribers signup or are added via the admin form, send an opt-in confirmation e-mail.", "settings.general.sendOptinConfirmHelp": "When new subscribers signup or are added via the admin form, send an opt-in confirmation e-mail.",
"settings.general.siteName": "Site name",
"settings.invalidMessengerName": "Nome de mensageiro inválido.", "settings.invalidMessengerName": "Nome de mensageiro inválido.",
"settings.mailserver.authProtocol": "Protocolo Autenticação", "settings.mailserver.authProtocol": "Protocolo Autenticação",
"settings.mailserver.host": "Host", "settings.mailserver.host": "Host",

View file

@ -384,6 +384,7 @@
"settings.general.rootURLHelp": "Adresa URL publică a instalării (fără bară finală).", "settings.general.rootURLHelp": "Adresa URL publică a instalării (fără bară finală).",
"settings.general.sendOptinConfirm": "Trimite confirmarea de înscriere", "settings.general.sendOptinConfirm": "Trimite confirmarea de înscriere",
"settings.general.sendOptinConfirmHelp": "Trimite un e-mail de confirmare de înscriere atunci când abonații se înscriu prin formularul public sau când sunt adăugați de către administrator.", "settings.general.sendOptinConfirmHelp": "Trimite un e-mail de confirmare de înscriere atunci când abonații se înscriu prin formularul public sau când sunt adăugați de către administrator.",
"settings.general.siteName": "Site name",
"settings.invalidMessengerName": "Numele mesagerului nu este valid.", "settings.invalidMessengerName": "Numele mesagerului nu este valid.",
"settings.mailserver.authProtocol": "Protocol de autentificare", "settings.mailserver.authProtocol": "Protocol de autentificare",
"settings.mailserver.host": "Gazdă", "settings.mailserver.host": "Gazdă",

View file

@ -384,6 +384,7 @@
"settings.general.rootURLHelp": "Публичный URL текущего портала (без конечного слэша).", "settings.general.rootURLHelp": "Публичный URL текущего портала (без конечного слэша).",
"settings.general.sendOptinConfirm": "Отправьте подтверждение об отказе от участия", "settings.general.sendOptinConfirm": "Отправьте подтверждение об отказе от участия",
"settings.general.sendOptinConfirmHelp": "Когда новые подписчики подписываются или добавляются через форму администратора, отправьте письмо с подтверждением подписки.", "settings.general.sendOptinConfirmHelp": "Когда новые подписчики подписываются или добавляются через форму администратора, отправьте письмо с подтверждением подписки.",
"settings.general.siteName": "Site name",
"settings.invalidMessengerName": "Неверное имя мессенджера.", "settings.invalidMessengerName": "Неверное имя мессенджера.",
"settings.mailserver.authProtocol": "Протокол авторизации", "settings.mailserver.authProtocol": "Протокол авторизации",
"settings.mailserver.host": "Хост", "settings.mailserver.host": "Хост",

View file

@ -384,6 +384,7 @@
"settings.general.rootURLHelp": "Kurulumun genel URL'si (bölme çizgisi yok).", "settings.general.rootURLHelp": "Kurulumun genel URL'si (bölme çizgisi yok).",
"settings.general.sendOptinConfirm": "Send opt-in confirmation", "settings.general.sendOptinConfirm": "Send opt-in confirmation",
"settings.general.sendOptinConfirmHelp": "When new subscribers signup or are added via the admin form, send an opt-in confirmation e-mail.", "settings.general.sendOptinConfirmHelp": "When new subscribers signup or are added via the admin form, send an opt-in confirmation e-mail.",
"settings.general.siteName": "Site name",
"settings.invalidMessengerName": "Geçersiz messenger adı.", "settings.invalidMessengerName": "Geçersiz messenger adı.",
"settings.mailserver.authProtocol": "Protokol", "settings.mailserver.authProtocol": "Protokol",
"settings.mailserver.host": "İstemci", "settings.mailserver.host": "İstemci",

View file

@ -384,6 +384,7 @@
"settings.general.rootURLHelp": "URL công khai của cài đặt (không có dấu gạch chéo).", "settings.general.rootURLHelp": "URL công khai của cài đặt (không có dấu gạch chéo).",
"settings.general.sendOptinConfirm": "Gửi xác nhận chọn tham gia", "settings.general.sendOptinConfirm": "Gửi xác nhận chọn tham gia",
"settings.general.sendOptinConfirmHelp": "Gửi e-mail xác nhận chọn tham gia khi người đăng ký đăng ký qua biểu mẫu công khai hoặc khi họ được thêm bởi quản trị viên.", "settings.general.sendOptinConfirmHelp": "Gửi e-mail xác nhận chọn tham gia khi người đăng ký đăng ký qua biểu mẫu công khai hoặc khi họ được thêm bởi quản trị viên.",
"settings.general.siteName": "Site name",
"settings.invalidMessengerName": "Tên người đưa tin không hợp lệ.", "settings.invalidMessengerName": "Tên người đưa tin không hợp lệ.",
"settings.mailserver.authProtocol": "Giao thức xác thực", "settings.mailserver.authProtocol": "Giao thức xác thực",
"settings.mailserver.host": "Host", "settings.mailserver.host": "Host",

View file

@ -384,6 +384,7 @@
"settings.general.rootURLHelp": "安装的公共 URL没有尾部斜杠。", "settings.general.rootURLHelp": "安装的公共 URL没有尾部斜杠。",
"settings.general.sendOptinConfirm": "发送选择加入确认", "settings.general.sendOptinConfirm": "发送选择加入确认",
"settings.general.sendOptinConfirmHelp": "当订阅者通过公共表单注册或由管理员添加时,发送选择加入确认电子邮件。", "settings.general.sendOptinConfirmHelp": "当订阅者通过公共表单注册或由管理员添加时,发送选择加入确认电子邮件。",
"settings.general.siteName": "Site name",
"settings.invalidMessengerName": "信使名称无效。", "settings.invalidMessengerName": "信使名称无效。",
"settings.mailserver.authProtocol": "身份验证协议", "settings.mailserver.authProtocol": "身份验证协议",
"settings.mailserver.host": "主机", "settings.mailserver.host": "主机",

View file

@ -384,6 +384,7 @@
"settings.general.rootURLHelp": "安裝的公共URL沒有尾部斜杠。", "settings.general.rootURLHelp": "安裝的公共URL沒有尾部斜杠。",
"settings.general.sendOptinConfirm": "發送選擇加入確認", "settings.general.sendOptinConfirm": "發送選擇加入確認",
"settings.general.sendOptinConfirmHelp": "當訂閱者通過公共表單註冊或由管理員添加時,發送選擇加入確認電子郵件。", "settings.general.sendOptinConfirmHelp": "當訂閱者通過公共表單註冊或由管理員添加時,發送選擇加入確認電子郵件。",
"settings.general.siteName": "Site name",
"settings.invalidMessengerName": "信使名稱無效。", "settings.invalidMessengerName": "信使名稱無效。",
"settings.mailserver.authProtocol": "身份驗證協議", "settings.mailserver.authProtocol": "身份驗證協議",
"settings.mailserver.host": "主機", "settings.mailserver.host": "主機",

View file

@ -25,13 +25,11 @@ func V2_3_0(db *sqlx.DB, fs stuffbin.FileSystem, ko *koanf.Koanf) error {
`); err != nil { `); err != nil {
return err return err
} }
// if _, err := db.Exec(`ALTER TABLE campaigns ADD COLUMN IF NOT EXISTS "publish_meta" JSONB NOT NULL DEFAULT '{}'`); err != nil {
// return err
// }
// Insert new preference settings. // Insert new preference settings.
if _, err := db.Exec(` if _, err := db.Exec(`
INSERT INTO settings (key, value) VALUES INSERT INTO settings (key, value) VALUES
('app.site_name', '"Mailing list"'),
('privacy.allow_preferences', 'false') ('privacy.allow_preferences', 'false')
ON CONFLICT DO NOTHING; ON CONFLICT DO NOTHING;
`); err != nil { `); err != nil {

View file

@ -2,6 +2,7 @@ package models
// Settings represents the app settings stored in the DB. // Settings represents the app settings stored in the DB.
type Settings struct { type Settings struct {
AppSiteName string `json:"app.site_name"`
AppRootURL string `json:"app.root_url"` AppRootURL string `json:"app.root_url"`
AppLogoURL string `json:"app.logo_url"` AppLogoURL string `json:"app.logo_url"`
AppFaviconURL string `json:"app.favicon_url"` AppFaviconURL string `json:"app.favicon_url"`

View file

@ -182,6 +182,7 @@ CREATE TABLE settings (
); );
DROP INDEX IF EXISTS idx_settings_key; CREATE INDEX idx_settings_key ON settings(key); DROP INDEX IF EXISTS idx_settings_key; CREATE INDEX idx_settings_key ON settings(key);
INSERT INTO settings (key, value) VALUES INSERT INTO settings (key, value) VALUES
('app.site_name', '"Mailing list"'),
('app.root_url', '"http://localhost:9000"'), ('app.root_url', '"http://localhost:9000"'),
('app.favicon_url', '""'), ('app.favicon_url', '""'),
('app.from_email', '"listmonk <noreply@listmonk.yoursite.com>"'), ('app.from_email', '"listmonk <noreply@listmonk.yoursite.com>"'),

View file

@ -3,7 +3,7 @@
<html> <html>
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>{{ .Data.Title }}</title> <title>{{ .Data.Title }} - {{ .SiteName }}</title>
<meta name="description" content="{{ .Data.Description }}" /> <meta name="description" content="{{ .Data.Description }}" />
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1" /> <meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1" />
<link href="/public/static/style.css" rel="stylesheet" type="text/css" /> <link href="/public/static/style.css" rel="stylesheet" type="text/css" />