Skip to content

Commit

Permalink
Optimisation "partialCached" (#165)
Browse files Browse the repository at this point in the history
* Create fr.toml

French translation

* Social link to "mastodon" added

* Some statics partials are cached, to optimise rendering
  • Loading branch information
echarp authored and Bud Parr committed Mar 21, 2019
1 parent 8b348e6 commit 1754826
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions layouts/_default/baseof.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
{{ end }}

{{ block "favicon" . }}
{{ partial "site-favicon.html" . }}
{{ partialCached "site-favicon.html" . }}
{{ end }}

{{ if .RSSLink }}
Expand All @@ -52,7 +52,7 @@
<main class="pb7" role="main">
{{ block "main" . }}{{ end }}
</main>
{{ block "footer" . }}{{ partial "site-footer.html" . }}{{ end }}
{{ block "scripts" . }}{{ partial "site-scripts.html" . }}{{ end }}
{{ block "footer" . }}{{ partialCached "site-footer.html" . }}{{ end }}
{{ block "scripts" . }}{{ partialCached "site-scripts.html" . }}{{ end }}
</body>
</html>
4 changes: 2 additions & 2 deletions layouts/partials/page-header.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
{{ $featured_image := (trim $featured_image "/") | absURL }}
<header class="cover bg-top" style="background-image: url('{{ $featured_image }}');">
<div class="pb3-m pb6-l bg-black-60">
{{ partial "site-navigation.html" . }}
{{ partialCached "site-navigation.html" . }}
<div class="tc-l pv6 ph3 ph4-ns">
{{ if not .Params.omit_header_text }}
<h1 class="f2 f1-l fw2 white-90 mb0 lh-title">{{ .Title | default .Site.Title }}</h1>
Expand All @@ -20,7 +20,7 @@ <h2 class="fw1 f5 f3-l white-80 measure-wide-l center lh-copy mt3 mb4">
{{ else }}
<header>
<div class="{{ .Site.Params.background_color_class | default "bg-black" }}">
{{ partial "site-navigation.html" . }}
{{ partialCached "site-navigation.html" . }}
</div>
</header>
{{ end }}
4 changes: 2 additions & 2 deletions layouts/partials/site-header.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
{{ $featured_image := (trim $featured_image "/") | absURL }}
<header class="cover bg-top" style="background-image: url('{{ $featured_image }}');">
<div class="{{ .Site.Params.cover_dimming_class | default "bg-black-60" }}">
{{ partial "site-navigation.html" .}}
{{ partialCached "site-navigation.html" .}}
<div class="tc-l pv4 pv6-l ph3 ph4-ns">
<h1 class="f2 f-subheadline-l fw2 white-90 mb0 lh-title">
{{ .Title | default .Site.Title }}
Expand All @@ -20,7 +20,7 @@ <h2 class="fw1 f5 f3-l white-80 measure-wide-l center mt3">
{{ else }}
<header>
<div class="pb3-m pb6-l {{ .Site.Params.background_color_class | default "bg-black" }}">
{{ partial "site-navigation.html" . }}
{{ partialCached "site-navigation.html" . }}
<div class="tc-l pv3 ph3 ph4-ns">
<h1 class="f2 f-subheadline-l fw2 light-silver mb0 lh-title">
{{ .Title | default .Site.Title }}
Expand Down

0 comments on commit 1754826

Please sign in to comment.