Commit 0474ba69 authored by Kaushal Modi's avatar Kaushal Modi

Use partialCached instead of partial where possible

Run hugo --templateMetrics --templateMetricsHints and pay attention to the
partials with "cache potential" of 100. Those are the likely candidates where
partialCached can be used instead of partial.
parent ab18be79
......@@ -27,7 +27,7 @@
<a href="#top" class="back-to-top">Back to top</a>
</div>
{{ end }}
{{ partial "toc_on_side.html" . }}
{{ partialCached "toc_on_side.html" . }}
{{ end }}
<div class="content">
......
<!-- https://gist.github.com/carlmjohnson/e3716a0a89fab0484d0552a750c8cfb7 -->
{{- $site := .Site -}}
{{- $asset := .asset -}}
{{- with $site.Data.assets -}}
{{- if $site.Params.cache_busting -}}
{{- if in (string $site.BaseURL) "localhost" -}}
{{- $asset | relURL -}}
{{- $ast := .asset -}}
{{- with $.Site.Data.assets -}}
{{- if $.Site.Params.cache_busting -}}
{{- if in (string $.Site.BaseURL) "localhost" -}}
{{- $ast | relURL -}}
{{- else -}}
{{- (index . $asset) | relURL -}}
{{- (index . $ast) | relURL -}}
{{- end -}}
{{- else if $site.Params.cache_busting_debug -}}
{{- (index . $asset) | relURL -}}
{{- else if $.Site.Params.cache_busting_debug -}}
{{- (index . $ast) | relURL -}}
{{- else -}}
{{- $asset | relURL -}}
{{- $ast | relURL -}}
{{- end -}}
{{- else -}}
{{- $asset | relURL -}}
{{- $ast | relURL -}}
{{- end -}}
<hr />
<footer>
{{ partial "social.html" . }}
{{ partialCached "social.html" . }}
{{ if .Site.Params.source.ox_hugo }}
<p>
This site is generated using
......@@ -35,7 +35,7 @@
{{ end }}
</p>
{{ partial "indieweb-badges.html" . }}
{{ partialCached "indieweb-badges.html" . }}
<!-- Fragmentions - https://github.com/chapmanu/fragmentions -->
<!-- With this, links like this will work!
......@@ -45,5 +45,5 @@
<!-- Fragmentioner - https://github.com/kartikprabhu/fragmentioner -->
<script defer src="{{ partial "asset.html" (dict "Site" .Site "asset" "js/fragmentioner.js") }}"></script>
{{ partial "h-card.html" . }}
{{ partialCached "h-card.html" . }}
</footer>
......@@ -17,7 +17,7 @@
</title>
<!-- {{ template "_internal/google_analytics_async.html" . }} -->
{{ partial "googleanalytics.html" . }}
{{ partialCached "googleanalytics.html" . }}
<!-- Lazy load CSS -->
<!-- https://github.com/filamentgroup/loadCSS -->
......@@ -59,7 +59,7 @@
</style>
{{ if eq (getenv "HUGO_ENV") "devel" }}
<style>{{ partial "debugprint.css" | safeCSS }}</style>
<style>{{ partialCached "debugprint.css" . | safeCSS }}</style>
{{ end }}
<!-- Retain the order of loading these CSS files -->
......@@ -71,7 +71,7 @@
which are the critical components in that CSS that I can inline here. -->
<link rel="stylesheet" href="{{ partial "asset.html" (dict "Site" .Site "asset" "css/refined.css") }}">
{{ partial "asset_custom_css.html" . }}
{{ partialCached "asset_custom_css.html" . }}
<!-- Isso -->
<!-- https://github.com/posativ/isso/issues/287 -->
......@@ -99,7 +99,7 @@
<script defer src="{{ partial "asset.html" (dict "Site" .Site "asset" "js/fontawesome-all.js") }}"></script>
{{ with .Params.mathjax }}
{{ partial "mathjax.html" }}
{{ partialCached "mathjax.html" . }}
{{ end }}
<!-- Icons -->
......@@ -113,7 +113,7 @@
<meta name="theme-color" content="#ffffff" />
<!-- Webmention, Opengraph and Twitter -->
{{ partial "indieweb-head.html" . }}
{{ partialCached "indieweb-head.html" . }}
{{ partial "opengraph.html" . }}
{{ partial "twitter_cards.html" . }}
......
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