blog/root/admin/settings.gohtml

206 lines
7.7 KiB
Plaintext
Raw Permalink Normal View History

2017-11-15 14:55:15 +00:00
{{ define "title" }}Website Settings{{ end }}
{{ define "content" }}
2018-04-12 01:59:30 +00:00
<div class="card">
<div class="card-body">
<form action="/admin/settings" method="POST">
<input type="hidden" name="_csrf" value="{{ .CSRF }}">
2017-11-15 14:55:15 +00:00
2018-04-12 01:59:30 +00:00
{{ with .Data.s }}
<h3>The Basics</h3>
2017-11-15 14:55:15 +00:00
2018-04-12 01:59:30 +00:00
<div class="form-group">
<label for="title">Title</label>
<input type="text"
class="form-control"
name="title"
value="{{ .Site.Title }}"
placeholder="Website Title">
</div>
2017-11-15 14:55:15 +00:00
2018-04-12 01:59:30 +00:00
<div class="form-group">
<label for="title">Description</label>
<input type="text"
class="form-control"
name="description"
value="{{ .Site.Description }}"
placeholder="Just another web blog.">
</div>
2018-02-02 04:14:42 +00:00
2018-04-12 01:59:30 +00:00
<div class="form-group">
<label for="admin-email">Admin Email</label>
<small class="text-muted">For getting notifications about comments, etc.</small>
<input type="text"
class="form-control"
name="admin-email"
value="{{ .Site.AdminEmail }}"
placeholder="name@domain.com">
</div>
2018-04-12 01:59:30 +00:00
<div class="form-group">
<label for="admin-email">URL Root</label>
<small class="text-muted d-block">
The base absolute URL to your website. This is used to generate
emails such as comment notifications. If not provided, these
emails will not be sent.
</small>
<input type="text"
class="form-control"
name="url"
value="{{ .Site.URL }}"
placeholder="https://www.example.com/">
</div>
2017-11-15 14:55:15 +00:00
2018-04-12 02:34:37 +00:00
<strong>NSFW Website</strong>
<div class="form-check mb-4">
<label class="form-check-label">
<input type="checkbox"
class="form-check-input"
name="nsfw"
value="true"
{{ if .Site.NSFW }}checked{{ end }}>
Website is NSFW. Requires an age verification to enter.
</label>
</div>
<h3>Blog Settings</h3>
<div class="form-group">
<label for="admin-email">Posts Per Page</label>
<input type="text"
class="form-control"
name="posts-per-page"
value="{{ .Blog.PostsPerPage }}"
placeholder="https://www.example.com/">
</div>
<div class="form-group">
<label for="admin-email">Posts Per (RSS) Feed</label>
<input type="text"
class="form-control"
name="posts-per-page"
value="{{ .Blog.PostsPerFeed }}"
placeholder="https://www.example.com/">
</div>
2018-04-12 01:59:30 +00:00
<h3>Redis Cache</h3>
2017-11-15 14:55:15 +00:00
2018-04-12 01:59:30 +00:00
<p>
Using a <a href="https://redis.io/" target="_blank">Redis</a> cache can
boost the performance of the JSON database by caching documents in
memory instead of always reading from disk.
</p>
2017-11-15 14:55:15 +00:00
2018-04-12 01:59:30 +00:00
<div class="form-check">
<label class="form-check-label">
<input type="checkbox"
class="form-check-input"
name="redis-enabled"
value="true"
{{ if .Redis.Enabled }}checked{{ end }}>
Enable Redis
</label>
</div>
<div class="form-group">
<label for="redis-host">Redis Host</label>
<input type="text"
class="form-control"
name="redis-host"
value="{{ .Redis.Host }}"
placeholder="localhost">
</div>
<div class="form-group">
<label for="redis-port">Port</label>
<input type="text"
class="form-control"
name="redis-port"
value="{{ .Redis.Port }}"
placeholder="6379">
</div>
<div class="form-group">
<label for="redis-db">DB Number</label>
<small class="text-muted">0-15</small>
<input type="text"
class="form-control"
name="redis-db"
value="{{ .Redis.DB }}"
placeholder="0">
</div>
<div class="form-group">
<label for="redis-prefix">Key Prefix</label>
<small class="text-muted">(optional)</small>
<input type="text"
class="form-control"
name="redis-prefix"
value="{{ .Redis.Prefix }}"
placeholder="blog:">
</div>
2018-04-12 01:59:30 +00:00
<h3>Email Settings</h3>
2018-04-12 01:59:30 +00:00
<div class="form-check">
<label class="form-check-label">
<input type="checkbox"
class="form-check-input"
name="mail-enabled"
value="true"
{{ if .Mail.Enabled }}checked{{ end }}>
Enable email to be sent by this site
</label>
</div>
<div class="form-group">
<label for="mail-sender">Sender Address</label>
<input type="email"
name="mail-sender"
id="mail-sender"
class="form-control"
value="{{ .Mail.Sender }}"
placeholder="no-reply@example.com">
</div>
<div class="form-group">
<label for="mail-host">SMTP Host</label>
<input type="text"
class="form-control"
name="mail-host"
id="mail-host"
value="{{ .Mail.Host }}"
placeholder="localhost">
</div>
<div class="form-group">
<label for="mail-port">SMTP Port</label>
<input type="text"
class="form-control"
name="mail-port"
id="mail-port"
value="{{ .Mail.Port }}"
placeholder="25">
</div>
<div class="form-group">
<label for="mail-username">SMTP Username</label>
<small class="text-muted">(optional)</small>
<input type="text"
class="form-control"
name="mail-username"
value="{{ .Mail.Username }}"
placeholder="">
</div>
<div class="form-group">
<label for="mail-password">SMTP Password</label>
<small class="text-muted">(optional)</small>
<input type="text"
class="form-control"
name="mail-password"
value="{{ .Mail.Password }}"
placeholder="">
</div>
2017-11-20 05:49:19 +00:00
2018-04-12 01:59:30 +00:00
<div class="form-group">
<button type="submit" class="btn btn-primary">Save Settings</button>
<a href="/admin" class="btn btn-secondary">Cancel</a>
</div>
{{ end }}
2017-11-27 03:44:36 +00:00
2018-04-12 01:59:30 +00:00
</form>
</div>
</div>
2017-11-15 14:55:15 +00:00
{{ end }}