Last active
October 14, 2018 19:57
-
-
Save EmielH/da637a61ccc813adb1be791299623650 to your computer and use it in GitHub Desktop.
Partial "inheritance" - is it possible?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- | |
I would like this to retrieve the partial from the theme. | |
I would also like this file to be called single-post-info.html so that I do not have to edit single.html, which comes from the theme | |
--> | |
{{ partial "single-post-info.html" . }} | |
<!-- Add my own stuff here --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="post-info"> | |
<span>{{ i18n "writtenBy" }}</span> | |
{{- if .Params.Author }} | |
{{ .Params.Author }} | |
{{- else }} | |
{{ .Site.Params.Author }} | |
{{- end }} | |
{{- if .PublishDate }} | |
<br> | |
<span>{{ i18n "on" }} </span><time datetime="{{ .PublishDate }}">{{ i18n "publishdate" . }}</time> | |
{{- end }} | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{{ define "main" }} | |
<main> | |
<div class="post"> | |
{{ partial "single-post-info.html" . }} | |
<h1 class="post-title">{{ .Title }}</h1> | |
<div class="post-line"></div> | |
{{ .Content }} | |
</div> | |
<div class="pagination"> | |
{{- if .Next }} | |
<a href="{{ .Next.URL }}" class="left arrow">←</a> | |
{{- end }} | |
{{- if .Prev }} | |
<a href="{{ .Prev.URL }}" class="right arrow">→</a> | |
{{- end }} | |
<a href="#" class="top">Top</a> | |
</div> | |
</main> | |
{{ end }} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment