Skip to content

Commit

Permalink
Eyebrows: Link to topic if possible
Browse files Browse the repository at this point in the history
  • Loading branch information
earthboundkid committed Mar 16, 2020
1 parent 93727c5 commit f89ff87
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 13 deletions.
7 changes: 6 additions & 1 deletion layouts/partials/main.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,12 @@
<div class="column is-three-fifths">
{{ if $params.showTitle }}
<header class="block">
{{ if $params.kicker }}
{{ if $params.topic }}
<a
class="tag is-square is-black is-uppercase has-text-weight-semibold has-margin-bottom-thin"
href="{{ $params.topic.RelPermalink }}"
>{{ $params.kicker | default $params.topic.Title }}</a>
{{ else if $params.kicker }}
<p
class="tag is-square is-black is-uppercase has-text-weight-semibold has-margin-bottom-thin"
>{{ $params.kicker }}</p>
Expand Down
11 changes: 8 additions & 3 deletions layouts/partials/page-params.html
Original file line number Diff line number Diff line change
@@ -1,18 +1,23 @@
{{ $byline := "" }}
{{ with .Param "authors" }}
{{ $byline = delimit . ", " " and " }}
{{ $byline = delimit . ", " " and " }}
{{ end }}
{{ with .Param "byline" }}
{{ $byline = . }}
{{ $byline = . }}
{{ end }}

{{ $kicker := .Param "kicker" }}

{{ $topic := "" }}
{{ if .Param "topics" }}
{{ $topic = index (.GetTerms "topics") 0 }}
{{ end }}

{{ $blurb := .Param "blurb" | default "" }}

{{ $showTitle := .Param "suppress-title" | not }}

{{ $params := dict "byline" $byline "kicker" $kicker "blurb" $blurb "showTitle" $showTitle }}
{{ $params := dict "byline" $byline "kicker" $kicker "blurb" $blurb "showTitle" $showTitle "topic" $topic }}

{{ with .PublishDate }}
{{ $pub := partial "date-apstyle.html" .Local }}
Expand Down
13 changes: 10 additions & 3 deletions layouts/partials/tile-featured.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,16 @@
Top News <!-- TODO: Admin -->
{{ end }}
</span>
<span class="tag is-square is-outline is-uppercase has-text-weight-semibold">
{{ $featuredParams.kicker | default "News" }}
</span>
{{ if $featuredParams.topic }}
<a
class="tag is-square is-outline is-uppercase has-text-weight-semibold"
href="{{ $featuredParams.topic.RelPermalink }}"
>{{ $featuredParams.kicker | default $featuredParams.topic.Title }}</a>
{{ else if $featuredParams.kicker }}
<span
class="tag is-square is-outline is-uppercase has-text-weight-semibold"
>{{ $featuredParams.kicker | default "News" }}</span>
{{ end }}
</span>
</div>
</div>
Expand Down
13 changes: 10 additions & 3 deletions layouts/partials/tile-horiz.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,16 @@
<div class="tile">
<div class="tile is-parent is-top">
<div class="tile is-child">
<h3 class="tag is-square is-black is-uppercase has-text-weight-semibold has-margin-bottom-thin">
{{ $params.kicker| default "News" }}
</h3>
{{ if $params.topic }}
<a
class="tag is-square is-black is-uppercase has-text-weight-semibold has-margin-bottom-thin"
href="{{ $params.topic.RelPermalink }}"
>{{ $params.kicker | default $params.topic.Title }}</a>
{{ else }}
<h3
class="tag is-square is-black is-uppercase has-text-weight-semibold has-margin-bottom-thin"
>{{ $params.kicker | default "News" }}</h3>
{{ end }}
</div>
</div>
</div>
Expand Down
13 changes: 10 additions & 3 deletions layouts/partials/tile-stack.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
{{ $params := partialCached "page-params.html" .Page .RelPermalink }}

<article>
<h3 class="tag is-square is-black is-uppercase has-text-weight-semibold has-margin-bottom-thin">
{{ $params.kicker | default "News" }}
</h3>
{{ if $params.topic }}
<a
class="tag is-square is-black is-uppercase has-text-weight-semibold has-margin-bottom-thin"
href="{{ $params.topic.RelPermalink }}"
>{{ $params.kicker | default $params.topic.Title }}</a>
{{ else }}
<h3
class="tag is-square is-black is-uppercase has-text-weight-semibold has-margin-bottom-thin"
>{{ $params.kicker | default "News" }}</h3>
{{ end }}

{{ $name := .Page.Param "image" }}
{{ $credit := .Page.Param "image-credit" }}
Expand Down

0 comments on commit f89ff87

Please sign in to comment.