Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimisation "partialCached" #165

Merged
merged 4 commits into from
Mar 21, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions exampleSite/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ enableRobotsTXT = true
github = ""
gitlab = ""
linkedin = ""
mastodon = ""
# choose a background color from any on this page: http://tachyons.io/docs/themes/skins/ and preface it with "bg-"
background_color_class = "bg-black"
featured_image = "/images/gohugo-default-sample-hero-image.jpg"
Expand Down
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
8 changes: 7 additions & 1 deletion layouts/partials/social-follow.html
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,10 @@
{{ partial "svg/medium.svg" (dict "size" $icon_size) }}
{{- partial "new-window-icon.html" . -}}
</a>
{{ end }}
{{ end }}
{{ with .Param "mastodon" }}
<a href="{{ . }}" target="_blank" class="link-transition mastodon link dib z-999 pt3 pt0-l mr1" title="Mastodon link" rel="noopener" aria-label="follow on Mastodon——Opens in a new window">
{{ partial "svg/mastodon.svg" (dict "size" $icon_size) }}
{{- partial "new-window-icon.html" . -}}
</a>
{{ end }}
4 changes: 4 additions & 0 deletions layouts/partials/svg/mastodon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 5 additions & 1 deletion src/css/_social-icons.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.facebook, .twitter, .instagram, .youtube, .github, .gitlab, .linkedin, .medium {
.facebook, .twitter, .instagram, .youtube, .github, .gitlab, .linkedin, .medium, .mastodon {
fill: #BABABA;
}

Expand Down Expand Up @@ -42,3 +42,7 @@
.medium:hover {
fill: #0077b5
}

.mastodon:hover {
fill: #3088d4;
}
6 changes: 5 additions & 1 deletion static/dist/css/app.955516233bcafa4d2a1c13cea63c7b50.css
Original file line number Diff line number Diff line change
Expand Up @@ -5894,7 +5894,7 @@ pre {
margin-bottom: 1em;
}

.facebook, .twitter, .instagram, .youtube, .github, .gitlab, .linkedin, .medium {
.facebook, .twitter, .instagram, .youtube, .github, .gitlab, .linkedin, .medium, .mastodon {
fill: #BABABA;
}

Expand Down Expand Up @@ -5940,6 +5940,10 @@ pre {
fill: #0077b5
}

.mastodon:hover {
fill: #3088d4;
}

/* Put your custom styles here and run `npm start` from the "src" directory on */

#TableOfContents ul li {
Expand Down