mirror of
https://github.com/gohugoio/hugo.git
synced 2026-08-24 15:28:54 +00:00
@@ -1,2 +1 @@
|
||||
{{- warnf "The %q shortcode was deprecated in v0.143.0 and will be removed in a future release. See https://gohugo.io/shortcodes/gist for instructions to create a replacement." .Name -}}
|
||||
<script src="https://gist.github.com/{{ index .Params 0 }}/{{ index .Params 1 }}.js{{if len .Params | eq 3 }}?file={{ index .Params 2 }}{{end}}"></script>
|
||||
{{- errorf "The \"gist\" shortcode was deprecated in v0.143.0 and removed in v0.156.0." -}}
|
||||
|
||||
@@ -125,26 +125,6 @@ Content: {{ .Content }}
|
||||
b.AssertFileContent("public/index.html", "35b077dcb9887a84")
|
||||
}
|
||||
|
||||
func TestGistShortcode(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
files := `
|
||||
-- hugo.toml --
|
||||
disableKinds = ['page','rss','section','sitemap','taxonomy','term']
|
||||
-- layouts/home.html --
|
||||
{{ .Content }}
|
||||
-- content/_index.md --
|
||||
---
|
||||
title: home
|
||||
---
|
||||
{{< gist jmooring 23932424365401ffa5e9d9810102a477 >}}
|
||||
`
|
||||
|
||||
b := hugolib.Test(t, files, hugolib.TestOptWarn())
|
||||
b.AssertFileContent("public/index.html", `<script src="https://gist.github.com/jmooring/23932424365401ffa5e9d9810102a477.js"></script>`)
|
||||
b.AssertLogContains(`WARN The "gist" shortcode was deprecated in v0.143.0 and will be removed in a future release. See https://gohugo.io/shortcodes/gist for instructions to create a replacement.`)
|
||||
}
|
||||
|
||||
func TestHighlightShortcode(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
@@ -890,3 +870,24 @@ title: p1
|
||||
b.AssertLogContains(want)
|
||||
}
|
||||
}
|
||||
|
||||
// Issue 14491
|
||||
func TestGistShortcodeDeprecationError14491(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
files := `
|
||||
-- hugo.toml --
|
||||
disableKinds = ['page','rss','section','sitemap','taxonomy','term']
|
||||
-- layouts/home.html --
|
||||
{{ .Content }}
|
||||
-- content/_index.md --
|
||||
---
|
||||
title: home
|
||||
---
|
||||
{{< gist user 23932424365401ffa5e9d9810102a477 >}}
|
||||
`
|
||||
|
||||
b, err := hugolib.TestE(t, files, hugolib.TestOptWarn())
|
||||
b.Assert(err, qt.IsNotNil)
|
||||
b.AssertLogContains(`ERROR The "gist" shortcode was deprecated in v0.143.0 and removed in v0.156.0.`)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user