New layout type "feed"

This commit is contained in:
Brandon Rozek 2022-05-02 00:05:34 -04:00
parent dbf02ca97d
commit 29decd270e
2 changed files with 58 additions and 0 deletions

View file

@ -77,6 +77,7 @@ footer {
/* Top page */
#profileContainer {
min-height: calc(100vh - 100px);
/* max-width: 600px; */
display: flex;
justify-content: center;
align-items: center;
@ -204,6 +205,23 @@ nav li {
border: solid 1px #c9c9c9;
}
#feedList {
text-align: left;
max-width: 800px;
margin-left: auto;
margin-right: auto;
}
#feedList h2 {
margin-bottom: 0.25rem;
}
#feedList .date {
margin-top: 0;
margin-bottom: 0;
border-bottom: 1px solid #c9c9c9;
}
/* Page */
#contentBody {
max-width: 800px;

40
layouts/feed/list.html Normal file
View file

@ -0,0 +1,40 @@
{{ define "main"}}
<h1 class='title p-name'>{{ .Title }}</h1>
{{ partial "header.html" . }}
<!-- search box -->
<div id="searchBox">
<input type="text" id="searchBoxInput" placeholder="Search..." />
<img id="searchBoxIcon" src="{{ .Site.BaseURL }}/img/search.png" />
</div>
<!-- search results -->
<div id="searchResults"></div>
<!-- contents -->
<div id="feedList">
{{ $listPageDateFormat := .Site.Params.listPageDateFormat | default "January, 2006"}}
{{ range $index, $value := .Pages.GroupByDate $listPageDateFormat }}
{{ range .Pages }}
<article class="h-entry">
<h2 class='title p-name'>{{ .Title }}</h2>
<!-- date -->
{{ if not .Date.IsZero }}
{{ $singlePageDateFormat := .Site.Params.singlePageDateFormat | default "January 2, 2006"}}
<p class="date"><time class="dt-published" datetime='{{ .Date.Format "2006-01-02T15:04:05Z0700" }}'>{{ .Date.Format $singlePageDateFormat }}</time></p>
<a style="display: none" class="u-url" href="{{ .Permalink }}"></a>
{{ end }}
<div id="contentBody" class="e-content">
{{ .Content }}
</div>
</article>
{{ end }}
{{ end }}
</div>
{{ partial "footer.html" . }}
{{ $jquery := resources.Get "js/jquery-3.5.1.min.js" }}
{{ $mark := resources.Get "js/jquery.mark.es6.min.js" }}
{{ $lunr := resources.Get "js/lunr.js" }}
{{ $search := resources.Get "js/search.js" }}
<script src="{{ $jquery.Permalink }}"></script>
<script src="{{ $mark.Permalink }}"></script>
<script src="{{ $lunr.Permalink }}"></script>
<script src="{{ $search.Permalink }}"></script>
{{ end }}