Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 182b104

Browse files
committed
Replace deprecated excludeFiles and includeFiles with files in tests
1 parent be93ccd commit 182b104

4 files changed

Lines changed: 13 additions & 8 deletions

File tree

common/hugo/hugo.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,9 @@ func deprecateLevel(item, alternative, version string, level logg.Level) {
334334

335335
// DeprecateLevel informs about a deprecation logging at the given level.
336336
func deprecateLevelWithLogger(item, alternative, version string, level logg.Level, log logg.Logger) {
337+
//if strings.Contains(item, "module.mounts.lang") || strings.Contains(item, "includeFiles") {
338+
// hdebug.Panicf("Deprecated")
339+
//}
337340
var msg string
338341
if level == logg.LevelError {
339342
// Useful to debug deprecation errors that needs to be removedor fixed. Comment out when done debugging.

hugolib/filesystems/basefs_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -227,11 +227,11 @@ disableWatch = true
227227
[[module.mounts]]
228228
source = 'content4'
229229
target = 'content/excludedsome'
230-
excludeFiles = 'p1.md'
230+
files = '! p1.md'
231231
[[module.mounts]]
232232
source = 'content5'
233233
target = 'content/excludedall'
234-
excludeFiles = '/**'
234+
files = '! /**'
235235
[[module.mounts]]
236236
source = "hugo_stats.json"
237237
target = "assets/watching/hugo_stats.json"

hugolib/hugo_modules_test.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,15 @@ path="a"
5151
[[module.imports.mounts]]
5252
source="myacontent"
5353
target="content/blog"
54-
lang="en"
54+
[module.imports.mounts.sites.matrix]
55+
languages = "en"
5556
[[module.imports]]
5657
path="b"
5758
[[module.imports.mounts]]
5859
source="mybcontent"
5960
target="content/blog"
60-
lang="nn"
61+
[module.imports.mounts.sites.matrix]
62+
languages = "nn"
6163
[[module.imports]]
6264
path="c"
6365
[[module.imports]]

hugolib/mount_filters_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,22 +27,22 @@ baseURL = "http://example.com/"
2727
[[module.mounts]]
2828
source = 'content'
2929
target = 'content'
30-
excludeFiles = "/a/c/**"
30+
files = "! /a/c/**"
3131
[[module.mounts]]
3232
source = 'static'
3333
target = 'static'
3434
[[module.mounts]]
3535
source = 'layouts'
3636
target = 'layouts'
37-
excludeFiles = "/**/foo.html"
37+
files = "! /**/foo.html"
3838
[[module.mounts]]
3939
source = 'data'
4040
target = 'data'
41-
includeFiles = "/mydata/**"
41+
files = "/mydata/**"
4242
[[module.mounts]]
4343
source = 'assets'
4444
target = 'assets'
45-
excludeFiles = ["/**exclude.*", "/moooo.*"]
45+
files = ["! /**exclude.*", "! /moooo.*"]
4646
[[module.mounts]]
4747
source = 'i18n'
4848
target = 'i18n'

0 commit comments

Comments
 (0)