Skip to content

Commit

Permalink
render mailchimp html preview
Browse files Browse the repository at this point in the history
  • Loading branch information
xaprb committed Feb 17, 2019
1 parent 35c2b3b commit a62491c
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
1 change: 1 addition & 0 deletions exampleSite/content/mailchimp/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ skip: true
layout: mailchimp
outputs:
- rss
- html
---
38 changes: 38 additions & 0 deletions layouts/_default/mailchimp.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{{ define "title" }}{{ .Section | title }} • {{ .Site.Title }}{{ end }}
{{ define "main" }}
<div class="pa3 pa4-ns w-100 w-70-ns center">
<section class="w-100 mw8">
{{- $hdr := cond (or (in .Site.Params.classes "feature-nohdr") (in .Params.classes "feature-nohdr")) false true -}}
{{ range first 20 (where (where (where .Site.RegularPages "Section" "ne" "slides") ".Params.skip" "ne" "true") ".Date.Unix" "<" now.Unix) }}
<div class="relative w-100">
<article>
<div class="db pv4 {{ cond $hdr "ph3" "" }} ph0-l no-underline dark-gray">
<div class="flex flex-column flex-row-ns">
{{ if $hdr }}
<div class="mb4 mb0-ns w-100 h4 h4-m w4-m h5-ns w5-ns br3 cover {{ if lt .Date.Unix now.Unix }}hide-child{{ end }}" style="background-image: url('{{ absURL (default "img/default-header-img.tn-500x500.jpg" (default .Params.image .Params.thumbnail)) }}'); background-position: center;">
<a href="{{ .Permalink }}" class="sans-serif db child w-100 h-100 f7 lh-copy white no-underline br3 ph3 pt4 pt5-l ttu tc bg-black-60">
<i class="mt3 mt5-l child far {{ cond (gt .Date.Unix now.Unix) "fa-hourglass" "fa-calendar-alt" }}"></i> {{ .Date.Format "Jan 2, 2006" }}
</a>
</div>
{{ end }}
<div class="w-100 w6-ns pl3-ns">
<h1 class="f3 fw1 mt0 lh-title"><a href="{{ .Permalink }}" class="color-inherit dim link">
{{- cond (eq .Site.Params.titlecase true) (.Title | title | markdownify) (.Title | markdownify) -}}
</a></h1>
<div class="f6 f5-l lh-copy nested-copy-line-height nested-links">
{{ with .Params.tldr }}{{ . | markdownify | html }}{{ else }}{{ (printf "%s<br>%s" .Params.description .Summary) | markdownify | html }}{{ end }}
</div>
</div>
</div>
</div>
</article>
</div>

{{ end }}
</section>
</div>
{{ end }}

{{ define "pagination" }}
<br>
{{ end }}

0 comments on commit a62491c

Please sign in to comment.