"Remove posts from front page" option

This commit is contained in:
Andrew Godwin 2022-12-22 14:16:08 -07:00
parent af6ddcf8f1
commit 699b6fc29e
3 changed files with 7 additions and 1 deletions

View File

@ -201,6 +201,7 @@ class Config(models.Model):
site_name: str = "Takahē" site_name: str = "Takahē"
highlight_color: str = "#449c8c" highlight_color: str = "#449c8c"
site_about: str = "<h2>Welcome!</h2>\n\nThis is a community running Takahē." site_about: str = "<h2>Welcome!</h2>\n\nThis is a community running Takahē."
site_frontpage_posts: bool = True
site_icon: UploadedImage = StaticAbsoluteUrl("img/icon-128.png").relative # type: ignore site_icon: UploadedImage = StaticAbsoluteUrl("img/icon-128.png").relative # type: ignore
site_banner: UploadedImage = StaticAbsoluteUrl( site_banner: UploadedImage = StaticAbsoluteUrl(
"img/fjords-banner-600.jpg" "img/fjords-banner-600.jpg"

View File

@ -8,7 +8,7 @@
{{ content }} {{ content }}
</section> </section>
{% if not request.user.is_authenticated %} {% if not request.user.is_authenticated and config.site_frontpage_posts %}
<h1>Recent Posts</h1> <h1>Recent Posts</h1>
<section class="posts shell"> <section class="posts shell">
{% for post in posts %} {% for post in posts %}

View File

@ -51,6 +51,10 @@ class BasicSettings(AdminSettingsPage):
"help_text": "Displayed on the homepage and the about page.\nUse Markdown for formatting.", "help_text": "Displayed on the homepage and the about page.\nUse Markdown for formatting.",
"display": "textarea", "display": "textarea",
}, },
"site_frontpage_posts": {
"title": "Show Posts On Front Page",
"help_text": "Whether to show some recent posts on the logged-out homepage.",
},
"site_icon": { "site_icon": {
"title": "Site Icon", "title": "Site Icon",
"help_text": "Minimum size 64x64px. Should be square.", "help_text": "Minimum size 64x64px. Should be square.",
@ -95,6 +99,7 @@ class BasicSettings(AdminSettingsPage):
"Branding": [ "Branding": [
"site_name", "site_name",
"site_about", "site_about",
"site_frontpage_posts",
"site_icon", "site_icon",
"site_banner", "site_banner",
"highlight_color", "highlight_color",