2023-10-31 08:25:28 +00:00
|
|
|
|
2023-11-01 14:21:21 +00:00
|
|
|
# Test deprecation logging.
|
|
|
|
hugo -e info --logLevel info
|
|
|
|
stdout 'INFO deprecated: item was deprecated in Hugo'
|
2023-10-31 08:25:28 +00:00
|
|
|
|
2023-11-01 14:21:21 +00:00
|
|
|
hugo -e warn --logLevel warn
|
|
|
|
stdout 'WARN deprecated: item was deprecated in Hugo'
|
2023-10-31 08:25:28 +00:00
|
|
|
|
2023-11-01 14:21:21 +00:00
|
|
|
! hugo -e error --logLevel warn
|
|
|
|
stdout 'ERROR deprecated: item was deprecated in Hugo'
|
2023-10-31 08:25:28 +00:00
|
|
|
|
|
|
|
-- hugo.toml --
|
|
|
|
baseURL = "https://example.com/"
|
|
|
|
disableKinds = ["taxonomy", "term"]
|
|
|
|
-- layouts/index.html --
|
|
|
|
Deprecate:
|
|
|
|
{{ if eq hugo.Environment "info" }}
|
|
|
|
{{ debug.TestDeprecationInfo "item" "alternative" }}
|
|
|
|
{{ end }}
|
|
|
|
{{ if eq hugo.Environment "warn" }}
|
|
|
|
{{ debug.TestDeprecationWarn "item" "alternative" }}
|
|
|
|
{{ end }}
|
|
|
|
{{ if eq hugo.Environment "error" }}
|
|
|
|
{{ debug.TestDeprecationErr "item" "alternative" }}
|
|
|
|
{{ end }}
|