Adds micro posts to the home page
Adds support for displaying microposts (e.g. Mastodon toots) on the home page. This includes adding a new "secondarysections" parameter to the configuration, updating the index layout to display these posts, and adding a default comment section to the micro archetype.
This commit is contained in:
@@ -10,5 +10,10 @@ repost:
|
||||
like:
|
||||
rsvp:
|
||||
bookmark:
|
||||
|
||||
comments:
|
||||
host: mastodon.social
|
||||
username: fundor333
|
||||
id:
|
||||
---
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@ defaultColor:
|
||||
# the default value is set to 'auto'.
|
||||
# You can take a look at layouts/index.html for more information.
|
||||
mainSections: ["post", "photos", "weeknote"]
|
||||
secondarysections: ["micro"]
|
||||
feedSections: ["post", "photos", "micro", "weeknote"]
|
||||
commentSections: ["post", "photos", "micro", "weeknote"]
|
||||
suggestionSections: ["post"]
|
||||
|
||||
@@ -12,6 +12,11 @@ repost:
|
||||
like:
|
||||
rsvp:
|
||||
bookmark:
|
||||
|
||||
comments:
|
||||
host: mastodon.social
|
||||
username: fundor333
|
||||
id: 114581620705519039
|
||||
---
|
||||
|
||||
#Pocket is closing and I had rework all the stuff I got into my personal #Django server.
|
||||
|
||||
@@ -32,6 +32,20 @@
|
||||
{{ end }}
|
||||
</p>
|
||||
{{ end }}
|
||||
<h3 class="posts-item-note" aria-label="Recent status/toots/micropost">{{ T "home.recent_posts" }}</h3>
|
||||
{{/* Show last 10 posts in reverse date order */}}
|
||||
{{ $pagesToShow := where .Site.RegularPages "Type" "in" site.Params.secondarysections }}
|
||||
{{ $posts := $pagesToShow.ByDate.Reverse }}
|
||||
{{ range first 10 $posts }}
|
||||
{{ partial "postCard" . }}
|
||||
{{ end }}
|
||||
{{ if gt (len $posts) 5 }}
|
||||
<p>
|
||||
{{ range $firstSection := (where .Site.Sections "Section" "in" (first 1 (.Site.Params.mainSections))) }}
|
||||
<a href="{{ $firstSection.Permalink }}">{{ T "home.see_all_posts" }}</a>
|
||||
{{ end }}
|
||||
</p>
|
||||
{{ end }}
|
||||
</main>
|
||||
</div>
|
||||
{{- partial "footer.html" . -}}
|
||||
|
||||
Reference in New Issue
Block a user