mirror of
https://github.com/13hannes11/hugo-coder-timeline.git
synced 2024-09-04 00:50:58 +02:00
Modularize <head> and baseof templates (#639)
* Add extension points for template customization Today, if you use the hugo-coder template, you can't modify <head> without having to write the entire template from scratch. This makes small point modifications or adjustments impractical and means that downstream consumers will quickly be out of sync with upstream changes. To remedy this, we split up the template into more modular extension points. This commit adds one extension point to <body> for arbitrary scripting and several more to <head> for different existing touchpoints. * Add John Feminella to CONTRIBUTORS.md * Modularize home.html template Co-authored-by: Luiz F. A. de Prá <luizdepra@users.noreply.github.com>
This commit is contained in:
@@ -1,35 +1,9 @@
|
||||
<section class="container centered">
|
||||
<div class="about">
|
||||
{{ if and (isset .Site.Params "avatarurl") (not (isset .Site.Params "gravatar")) }}
|
||||
{{ with .Site.Params.avatarURL }}
|
||||
<div class="avatar"><img src="{{ . | relURL }}" alt="avatar"></div>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ with .Site.Params.gravatar }}
|
||||
<div class="avatar"><img src="https://www.gravatar.com/avatar/{{md5 .}}?s=240&d=mp" alt="gravatar"></div>
|
||||
{{ end }}
|
||||
<h1>{{ .Site.Params.author }}</h1>
|
||||
{{ if reflect.IsSlice .Site.Params.info }}
|
||||
<h2>{{ range .Site.Params.info }}{{.}}<br>{{ end}}</h2>
|
||||
{{ else }}
|
||||
<h2>{{ .Site.Params.info }}</h2>
|
||||
{{ end }}
|
||||
{{ with .Site.Params.social }}
|
||||
<ul>
|
||||
{{ range sort . "weight" }}
|
||||
{{ if .icon }}
|
||||
<li>
|
||||
<a href="{{ .url | safeURL }}" aria-label="{{ .name }}" {{ if .rel }}rel="{{ .rel }}"{{ end }} {{ if .target }}target="{{ .target }}"{{ end }} {{ if .type }}type="{{ .type }}"{{ end }}>
|
||||
<i class="{{ .icon }}" aria-hidden="true"></i>
|
||||
</a>
|
||||
</li>
|
||||
{{ else }}
|
||||
<li>
|
||||
<a href="{{ .url | safeURL }}" aria-label="{{ .name }}" {{ if .rel }}rel="{{ .rel }}"{{ end }} {{ if .target }}target="{{ .target }}"{{ end }}>{{ .name }}</a>
|
||||
</li>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</ul>
|
||||
{{ end }}
|
||||
{{ partialCached "home/avatar.html" . }}
|
||||
|
||||
{{ partialCached "home/author.html" . }}
|
||||
|
||||
{{ partialCached "home/social.html" . }}
|
||||
</div>
|
||||
</section>
|
||||
|
||||
Reference in New Issue
Block a user