Skip to content

Commit 168d6e7

Browse files
committed
Playwright: Disable last modified for tests
1 parent 78599a2 commit 168d6e7

File tree

7 files changed

+7
-2
lines changed

7 files changed

+7
-2
lines changed

exampleSite/hugo.test.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[params]
2+
enable_last_modified = false

exampleSite/hugo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,5 @@ maxAge = -1
2323

2424
[params]
2525
github_repo = "https://github.com/nginxinc/nginx-hugo-theme"
26-
github_subdir = "exampleSite"
26+
github_subdir = "exampleSite"
27+
enable_last_modified = true

layouts/partials/page-meta-links.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@
2929
{{ $viewURL := printf "%s/tree/%s" $gh_repo $gh_repo_path -}}
3030
{{ $editURL := printf "%s/edit/%s" $gh_repo $gh_repo_path -}}
3131
{{ $issuesURL := printf "%s/issues/new?title=%s&template=2-bug_report.md" $gh_repo (safeURL $.Title ) -}}
32+
{{ if $.Param "enable_last_modified" -}}
3233
<div> Last modified {{ .Page.Lastmod.Format "January 2, 2006" }} </div>
34+
{{ end -}}
3335
<div>
3436
<a href="{{ $viewURL }}" class="" target="_blank" rel="noopener"><i class="fa-solid fa-file-lines fa-fw"></i> View source</a>
3537
</div>

tests/playwright.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export default defineConfig({
3131
},
3232
],
3333
webServer: {
34-
command: `cd ../exampleSite && hugo mod get && hugo --gc -e production && hugo serve --port ${PORT}`,
34+
command: `cd ../exampleSite && hugo mod get && hugo --gc --config hugo.toml,hugo.test.toml && hugo serve --port ${PORT} --config hugo.toml,hugo.test.toml`,
3535
url: `${BASE_URL}:${PORT}`,
3636
stdout: 'ignore',
3737
},
Loading
Loading
Loading

0 commit comments

Comments
 (0)