Skip to content

Commit

Permalink
adding cards to website
Browse files Browse the repository at this point in the history
  • Loading branch information
tmastny committed Jun 23, 2020
1 parent ca0f9df commit 11db9ee
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 12 deletions.
12 changes: 10 additions & 2 deletions layouts/list.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,17 @@

{{ .Content }}

{{ range (where .Pages "Section" "=" "projects") }}

{{ range .Pages }}

{{ partial "project-card.html" . }}

{{ end }}
{{ end }}

<ul>
{{ $pages := .Pages }}
{{ if .IsHome }}{{ $pages = .Site.RegularPages }}{{ end }}
{{ $pages := .Site.RegularPages }}
{{ $paginator := .Paginate (where $pages "Section" "=" "blog") }}
{{ range $paginator.Pages }}
<li>
Expand Down
12 changes: 12 additions & 0 deletions layouts/partials/project-card.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{{/* parameter: .Page */}}

<p><article class="card">
<h3><a href="{{ .RelPermalink }}">{{ .Title | markdownify }}</a></h3>

{{ with .Params.summary }}
{{ . | markdownify }}
{{ else }}
{{ .Summary }}
{{ end }}

</article></p>
2 changes: 2 additions & 0 deletions layouts/partials/two-column.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
{{/* parameter: .Pages */}}


{{ $n_pages := len . }}
{{ $n_rows := div $n_pages 2.0 }}
Expand Down
11 changes: 1 addition & 10 deletions layouts/projects/list.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,7 @@

<ul>
{{ range .Pages }}
<p><article class="card">
<h3><a href="{{ .RelPermalink }}">{{ .Title | markdownify }}</a></h3>

{{ with .Params.summary }}
{{ . | markdownify }}
{{ else }}
{{ .Summary }}
{{ end }}

</article></p>
{{ partial "project-card.html" . }}
{{ end }}
</ul>

Expand Down

0 comments on commit 11db9ee

Please sign in to comment.