Skip to content
This repository has been archived by the owner on Dec 1, 2023. It is now read-only.

Commit

Permalink
only show posts with rstats or python tags"
Browse files Browse the repository at this point in the history
  • Loading branch information
DaveParr committed Jun 11, 2020
1 parent cbff075 commit d4f29da
Showing 1 changed file with 23 additions and 25 deletions.
48 changes: 23 additions & 25 deletions layouts/_default/blog.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,32 +6,30 @@ <h1>{{ .Params.title }}</h1>

<div class="post-feed">
<div class="post-feed-inside">
{{ $display_posts := ((.Site.GetPage "section" "/posts").Pages).ByDate.Reverse }}
{{ range $post := $display_posts }}
{{ if not (in .Params.tags "question") }}
<article class="post post-card">
<div class="post-inside">
{{ if $post.Params.thumb_img_path }}
<a class="post-thumbnail" href="{{ $post.URL }}">
<img src="{{ $post.Params.thumb_img_path | relURL }}" alt="{{ $post.Params.title }}" />
</a>
{{ end }}
<header class="post-header">
<h2 class="post-title"><a href="{{ $post.URL }}" rel="bookmark">{{ $post.Params.title }}</a></h2>
</header><!-- .post-header -->
{{ if $post.Params.excerpt }}
<div class="post-content">
<p>{{ $post.Params.excerpt }}</p>
</div>
{{ end }}
<footer class="post-meta">
<time class="published"
datetime="{{ $post.Date | dateFormat "2006-01-02 15:04" }}">{{ $post.Date | dateFormat "January 02, 2006" }}</time>
<p> {{ $post.Params.tags }} </p>
</footer>
{{ $display_posts := (((.Site.GetPage "section" "/posts").Pages).ByDate.Reverse) }}
{{ range $post := (where $display_posts "Params.tags" "intersect" (slice "Rstats" "rstats" "python")) }}
<article class="post post-card">
<div class="post-inside">
{{ if $post.Params.thumb_img_path }}
<a class="post-thumbnail" href="{{ $post.URL }}">
<img src="{{ $post.Params.thumb_img_path | relURL }}" alt="{{ $post.Params.title }}" />
</a>
{{ end }}
<header class="post-header">
<h2 class="post-title"><a href="{{ $post.URL }}" rel="bookmark">{{ $post.Params.title }}</a></h2>
</header><!-- .post-header -->
{{ if $post.Params.excerpt }}
<div class="post-content">
<p>{{ $post.Params.excerpt }}</p>
</div>
</article><!-- .post -->
{{ end }}
{{ end }}
<footer class="post-meta">
<time class="published"
datetime="{{ $post.Date | dateFormat "2006-01-02 15:04" }}">{{ $post.Date | dateFormat "January 02, 2006" }}</time>
<p> {{ $post.Params.tags }} </p>
</footer>
</div>
</article><!-- .post -->
{{ end }}
</div>
</div><!-- .post-feed -->
Expand Down

0 comments on commit d4f29da

Please sign in to comment.