Skip to content

Commit 1ecfe3c

Browse files
committed
added cache updates
1 parent 376b406 commit 1ecfe3c

20 files changed

Lines changed: 36 additions & 58 deletions

File tree

config/_default/hugo.yml

Lines changed: 6 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ dataDir: data
88
archetypeDir: archetypes
99
disableKinds: ["taxonomy"]
1010
enableEmoji: true
11+
timeout: 300s
1112
pagination:
1213
path: blog
1314
markup:
@@ -22,33 +23,6 @@ languages:
2223
languageName: English
2324
weight: 0
2425

25-
# menus:
26-
# main:
27-
# - name: events
28-
# pageRef: /events
29-
# weight: -150
30-
# identifier: events
31-
# - name: blog
32-
# pageRef: /blog
33-
# weight: -140
34-
# identifier: blog
35-
# - name: sponsor
36-
# pageRef: /sponsor
37-
# weight: -130
38-
# identifier: sponsor
39-
# - name: speaking
40-
# pageRef: /speaking
41-
# weight: -120
42-
# identifier: speaking
43-
# - name: organizing
44-
# pageRef: /organizing
45-
# weight: -110
46-
# identifier: organizing
47-
# - name: about
48-
# pageRef: /about
49-
# weight: -100
50-
# identifier: about
51-
5226
permalinks:
5327
page: /:contentbasename/
5428
blog: /blog/:year/:month/:day/:title/
@@ -102,20 +76,20 @@ minify:
10276

10377
build:
10478
buildStats:
105-
disableClasses: true
106-
disableIDs: true
107-
disableTags: true
108-
enable: true
79+
enable: false
10980
cacheBusters:
11081
- source: (postcss|tailwind)\.config\.js
11182
target: (css|styles|scss|sass)
11283
noJSConfigInAssets: false
113-
useResourceCacheWhen: fallback
84+
useResourceCacheWhen: always
11485

11586
caches:
11687
assets:
11788
dir: ":resourceDir/_gen"
11889
maxAge: -1
90+
getresource:
91+
dir: ":resourceDir/_gen"
92+
maxAge: -1
11993
images:
12094
dir: ":resourceDir/_gen"
12195
maxAge: -1

themes/devopsdays-theme/layouts/_default/baseof.html

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
{{- partialCached "global_navbar.html" . -}}
99
{{- $section := index (split (.Permalink | relURL) "/") 1 -}}
1010
{{- if and (eq $section "events") (ne .Type "events") -}}
11-
{{- partial "events/event_navbar.html" . -}}
11+
{{- $eventDir := "" -}}{{- with .File -}}{{- $eventDir = .Dir -}}{{- end -}}
12+
{{- partialCached "events/event_navbar.html" . $eventDir -}}
1213
{{- end -}}
1314
<main id="main-content" role="main">
1415
<div class="container-fluid">
@@ -54,6 +55,7 @@
5455
</div>
5556
</main>
5657
{{- partialCached "footer.html" . -}}
57-
{{- partial "footer_scripts.html" . -}}
58+
{{- $fsCacheKey := .Type -}}{{- with .File -}}{{- $fsCacheKey = .Dir -}}{{- end -}}
59+
{{- partialCached "footer_scripts.html" . $fsCacheKey -}}
5860
</body>
5961
</html>

themes/devopsdays-theme/layouts/event/single.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
{{- if eq .File.BaseFileName "welcome" -}}
66
{{- partial "welcome.html" . -}}
77
{{- else -}}
8-
{{- partial "events/non-current-banner.html" . -}}
8+
{{- partialCached "events/non-current-banner.html" . .File.Dir -}}
99
<h1>devopsdays {{ $e.city }} - {{ .Title }}</h1>
1010
{{ .Content }}
1111
{{- end -}}

themes/devopsdays-theme/layouts/events/single.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ <h2>Upcoming</h2>
99
</div>
1010
</div>
1111

12-
{{- $upcoming := partial "functions/get-upcoming-events" . -}}
13-
{{- $tbd := partial "functions/get-tbd-events" . -}}
14-
{{- $events := partial "functions/get-all-events" . -}}
12+
{{- $upcoming := partialCached "functions/get-upcoming-events" . "global" -}}
13+
{{- $tbd := partialCached "functions/get-tbd-events" . "global" -}}
14+
{{- $events := partialCached "functions/get-all-events" . "global" -}}
1515

1616
<div class="row">
1717
{{- $currentMonth := "" -}}

themes/devopsdays-theme/layouts/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{{ define "main" }}
22

3-
{{- $upcoming := partial "functions/get-upcoming-events" . -}}
3+
{{- $upcoming := partialCached "functions/get-upcoming-events" . "global" -}}
44

55
<h1 class="sr-only">Upcoming DevOpsDays Events</h1>
66
<div class="row">

themes/devopsdays-theme/layouts/partials/footer.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<div class="row">
66
<div class="col-md-6 col-lg-4 footer-nav-col">
77
<h3 class="footer-nav">CFP Open</h3>
8-
{{- $upcoming := partial "functions/get-upcoming-events" . -}}
8+
{{- $upcoming := partialCached "functions/get-upcoming-events" . "global" -}}
99
{{- range sort $upcoming "startdate" -}}
1010
{{- if and .cfp_date_end .cfp_date_start -}}
1111
{{- if and (ge now (time.AsTime .cfp_date_start)) (ge (time.AsTime .cfp_date_end) now) -}}

themes/devopsdays-theme/layouts/partials/functions/get-current-event-for-city.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919
{{- $matchTitle = $e.event_group -}}
2020
{{- end -}}
2121

22-
{{- $allEvents := partial "functions/get-all-events" . -}}
23-
{{- $tbdEvents := partial "functions/get-tbd-events" . -}}
22+
{{- $allEvents := partialCached "functions/get-all-events" . "global" -}}
23+
{{- $tbdEvents := partialCached "functions/get-tbd-events" . "global" -}}
2424

2525
{{- $allEventsIncludingTBD := $allEvents -}}
2626
{{- range $tbdEvents -}}

themes/devopsdays-theme/layouts/partials/future.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
{{- $upcoming := partial "functions/get-upcoming-events" . -}}
2-
{{- $tbd := partial "functions/get-tbd-events" . -}}
1+
{{- $upcoming := partialCached "functions/get-upcoming-events" . "global" -}}
2+
{{- $tbd := partialCached "functions/get-tbd-events" . "global" -}}
33

44
{{- $currentYear := "" -}}
55
{{- $currentMonth := "" -}}

themes/devopsdays-theme/layouts/partials/head.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,4 @@
4646
{{- end -}}
4747
{{ $title }}
4848
</title>
49-
{{- partial "head_includes.html" . -}}
49+
{{- partialCached "head_includes.html" . .Type .Kind -}}

themes/devopsdays-theme/layouts/partials/head_includes.html

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
{{ partial "google_analytics.html" . }}
2-
{{ partial "google_tag_manager.html" . }}
1+
{{- $cacheKey := .Type -}}
2+
{{- with .File -}}{{- $cacheKey = .Dir -}}{{- end -}}
3+
{{ partialCached "google_analytics.html" . $cacheKey }}
4+
{{ partialCached "google_tag_manager.html" . $cacheKey }}
35

46
<link rel="preconnect" href="https://fonts.googleapis.com">
57
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>

0 commit comments

Comments
 (0)