mirror of
https://github.com/BBaoVanC/bobatheme.git
synced 2025-06-13 01:57:28 -05:00
Add caching to some partials that don't change much
This commit is contained in:
@ -2,7 +2,7 @@
|
||||
<div class="post-metadata">
|
||||
{{ if .Date }}
|
||||
<span class="post-meta-item">
|
||||
{{ partial "icon.html" "calendar" }}
|
||||
{{ partialCached "icon.html" "calendar" "calendar" }}
|
||||
<time datetime="{{ .Date.Format "January 2, 2006" }}" pubdate>
|
||||
{{ .Date.Format "January 2, 2006" }}
|
||||
</time>
|
||||
@ -11,7 +11,7 @@
|
||||
{{ if not .Site.Params.repoURL }}
|
||||
{{ if ne .Lastmod .Date }}
|
||||
<span class="post-meta-item">
|
||||
{{ partial "icon.html" "edit-2" }}
|
||||
{{ partialCached "icon.html" "edit-2" "edit-2" }}
|
||||
<time datetime="{{ .Lastmod.Format "2006-01-02" }}" pubdate>
|
||||
{{ .Lastmod.Format "January 2, 2006" }}
|
||||
</time>
|
||||
@ -22,14 +22,14 @@
|
||||
|
||||
{{ if .Site.Params.wordcount }}
|
||||
<span class="post-meta-item">
|
||||
{{ partial "icon.html" "type" }}
|
||||
{{ partialCached "icon.html" "type" "type" }}
|
||||
{{ .WordCount }} words
|
||||
</span>
|
||||
{{ end }}
|
||||
|
||||
{{ if .Site.Params.readingtime }}
|
||||
<span class="post-meta-item">
|
||||
{{ partial "icon.html" "clock" }}
|
||||
{{ partialCached "icon.html" "clock" "clock" }}
|
||||
{{ .ReadingTime }} {{ if gt .ReadingTime 1 }} mins {{ else }} min {{ end }}
|
||||
</span>
|
||||
{{ end }}
|
||||
@ -37,7 +37,7 @@
|
||||
{{ if .Site.Params.repoURL }}
|
||||
{{ with .GitInfo }}
|
||||
<span class="post-meta-item">
|
||||
{{ partial "icon.html" "git-commit" }}
|
||||
{{ partialCached "icon.html" "git-commit" "git-commit" }}
|
||||
<a href="{{ (printf "%s/commit/%s" $.Site.Params.repoURL .Hash) | absURL }}">
|
||||
<code>{{ .AbbreviatedHash }}</code>
|
||||
</a>
|
||||
@ -48,7 +48,7 @@
|
||||
<div class="tags">
|
||||
{{ range (.GetTerms "tags") }}
|
||||
<span class="post-meta-item">
|
||||
{{ partial "icon.html" "tag" }}
|
||||
{{ partialCached "icon.html" "tag" "tag" }}
|
||||
<a href="{{ .Permalink }}">{{ .LinkTitle }}</a>
|
||||
</span>
|
||||
{{ end }}
|
||||
|
10
layouts/partials/top.html
Normal file
10
layouts/partials/top.html
Normal file
@ -0,0 +1,10 @@
|
||||
<h2 class="header">
|
||||
<a href="{{ "/" | relURL }}">{{ .Site.Title | markdownify }}</a>
|
||||
</h2>
|
||||
|
||||
<nav id="navbar">
|
||||
<a class="navbar-item" href="{{ "/" | relURL }}">Home</a>
|
||||
{{ range .Site.Menus.main }}
|
||||
<a class="navbar-item" href="{{ .URL }}">{{ .Name }}</a>
|
||||
{{ end }}
|
||||
</nav>
|
Reference in New Issue
Block a user