Commit 47729599 authored by Kaushal Modi's avatar Kaushal Modi

Move content from _index.md to outside the h-feed

parent 9ce0d824
......@@ -2,11 +2,41 @@
{{ partial "draft-tag.html" . }}
{{ partialCached "all-terms.html" . }}
{{ $has_some_content := (not (eq "" (.Content | replaceRE "[[:^alpha:]]" ""))) }}
{{ if $has_some_content }}
<br /> <!-- This br needed so that the below taxo-buttons are center-aligned. -->
<article class="post h-entry {{ .Section }}">
<header>
<div class="center">{{ partial "taxo-buttons.html" . }}</div>
<h1 class="post-title p-name">{{ .Title }}</h1>
<!-- To complete the h-entry meta-data as per https://indiewebify.me/validate-h-entry/ -->
<data class="u-url" value="{{ .Permalink }}"></data>
</header>
<hr />
<div class="content">
{{ with .Description }}
<div class="description p-summary">
{{ . | markdownify }}
</div>
{{ end }}
{{ partial "author.html" . }}
<div class="e-content">
{{ partial "headline-hash.html" .Content }}
</div>
</div>
<hr />
</article>
{{ end }}
<!-- http://microformats.org/wiki/h-feed -->
<section class="h-feed">
<header>
{{ partialCached "all-terms.html" . }}
<!-- To complete the h-feed meta-data -->
<data class="u-url" value="{{ .Permalink }}"></data>
{{ partial "author.html" . }}
......@@ -16,32 +46,18 @@
"%N" in the string retrieved from phrase map will be replaced with .Name
-->
{{ $term := .Data.Term }}
{{ $phrase := (index .Site.Data.taxonomy.phrases .Data.Plural) | replaceRE "%T" (printf "‘%s’" $term) | replaceRE "%N" (printf "‘%s’" .Name) }}
{{ $term_count := (len .Pages) }}
<h1 class="p-name">{{ printf "Posts %s (%d)" $phrase $term_count }}</h1>
<div class="center">{{ partial "taxo-buttons.html" . }}</div>
{{ if $has_some_content }}
{{ $phrase := (index .Site.Data.taxonomy.phrases .Data.Plural) | replaceRE "%T" (printf "‘%s’" $term) | replaceRE "%N" "this" }}
<h2 class="p-name">{{ printf "Posts %s (%d)" $phrase $term_count }}</h2>
{{ else }}
<div class="center">{{ partial "taxo-buttons.html" . }}</div>
{{ $phrase := (index .Site.Data.taxonomy.phrases .Data.Plural) | replaceRE "%T" (printf "‘%s’" $term) | replaceRE "%N" (printf "‘%s’" .Name) }}
<h1 class="p-name">{{ printf "Posts %s (%d)" $phrase $term_count }}</h1>
{{ end }}
</header>
{{ $has_some_content := (not (eq "" (.Content | replaceRE "[[:^alpha:]]" ""))) }}
{{ if $has_some_content }}
<article class="post h-entry {{ .Section }}">
<hr />
<div class="content">
{{ with .Description }}
<div class="description p-summary">
{{ . | markdownify }}
</div>
{{ end }}
<div class="e-content">
{{ partial "headline-hash.html" .Content }}
</div>
</div>
<hr />
</article>
{{ end }}
{{ range .Pages }}
<!-- If the current page's $term is "foo", it replaces «li class="__foo__"»
with «li class="active"».
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment