{{ define "main" }}
- {{ .Content }}
- {{ range site.RegularPages }}
- <section>
- <h2><a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a></h2>
- {{ .Summary }}
- </section>
- {{ end }}
+ {{ partial "hero.html" . }}
+
+ <div class="container feed-section">
+ <div class="feed-label">Latest</div>
+
+ {{ $posts := where site.RegularPages "Type" "in" (slice "articles") }}
+ {{ $posts := sort $posts "Params.date" "desc" }}
+ {{ $latest := first 3 $posts }}
+
+ <div class="feed-grid">
+ {{ range $latest }}
+ {{ $data := dict "title" .Title "type" .Params.type "description" .Summary "date" .Date "url" .RelPermalink "image" .Params.image "featured" .Params.featured }}
+ {{ partial "post-card.html" $data }}
+ {{ end }}
+ </div>
+
+ <a href="/articles/" class="feed-cta">View all articles</a>
+ </div>
{{ end }}
{{ define "main" }}
- <h1>{{ .Title }}</h1>
+ <article class="page-page">
+ <div class="container-narrow">
+ <h1>{{ .Title }}</h1>
+ <div class="post-card-meta" style="margin-bottom: 2rem;">
+ <span>{{ dateFormat "Jan 2, 2006" .Date }}</span>
+ {{ if .Params.type }}<span class="post-type-badge {{ .Params.type }}">{{ .Params.type }}</span>{{ end }}
+ </div>
- {{ $dateMachine := .Date | time.Format "2006-01-02T15:04:05-07:00" }}
- {{ $dateHuman := .Date | time.Format ":date_long" }}
- <time datetime="{{ $dateMachine }}">{{ $dateHuman }}</time>
+ <div class="post-content">
+ {{ .Content }}
+ </div>
+ </div>
+ </article>
- {{ .Content }}
- {{ partial "terms.html" (dict "taxonomy" "tags" "page" .) }}
+ {{ if eq .Type "is" }}
+ <div class="container-narrow" style="margin-top: 3rem; padding-top: 2rem; border-top: 1px solid var(--border);">
+ <nav class="page-nav">
+ <h3 style="margin-bottom: 1rem;">Other pages</h3>
+ <ul style="list-style: none; margin: 0;">
+ {{ range .Site.Sections.By }}
+ {{ if eq .Type "is" }}
+ {{ range .Pages }}
+ <li style="margin-bottom: 0.5rem;">
+ <a href="{{ .RelPermalink }}" {{ if eq $.RelPermalink .RelPermalink }}class="active"{{ end }}>
+ {{ .Title }}
+ </a>
+ </li>
+ {{ end }}
+ {{ end }}
+ {{ end }}
+ </ul>
+ </nav>
+ </div>
+ {{ end }}
{{ end }}
{{ define "main" }}
- <h1>{{ .Title }}</h1>
- {{ .Content }}
- {{ range .Pages }}
- <section>
- <h2><a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a></h2>
- {{ .Summary }}
- </section>
+ <div class="container">
+ <h1>{{ .Title }}</h1>
+
+ {{ if eq .Type "articles" }}
+ <div class="filter-bar">
+ <button class="filter-btn active" data-filter="all">All</button>
+ <button class="filter-btn" data-filter="tech">Tech</button>
+ <button class="filter-btn" data-filter="life">Life</button>
+ <button class="filter-btn" data-filter="quote">Quote</button>
+ <button class="filter-btn" data-filter="link">Link</button>
+ <button class="filter-btn" data-filter="photo">Photo</button>
+ </div>
+
+ <div class="feed-list" id="articles-feed">
+ {{ range .Pages.ByDate.Reverse }}
+ {{ $data := dict "title" .Title "type" .Params.type "description" .Summary "date" .Date "url" .RelPermalink "image" .Params.image "featured" false }}
+ {{ partial "post-card.html" $data }}
+ {{ end }}
+ </div>
+ {{ else }}
+ {{ .Content }}
+ {{ end }}
+ </div>
+
+ {{ if eq .Type "articles" }}
+ <script defer src="{{ resources.Get "js/filters.js" | fingerprint | .RelPermalink }}"></script>
{{ end }}
{{ end }}