mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-12 20:13:59 +02:00
@@ -40,12 +40,12 @@ func TestCodeblocks(t *testing.T) {
|
||||
style = 'monokai'
|
||||
tabWidth = 4
|
||||
-- layouts/_default/_markup/render-codeblock-goat.html --
|
||||
{{ $diagram := diagrams.Goat .Code }}
|
||||
{{ $diagram := diagrams.Goat .Inner }}
|
||||
Goat SVG:{{ substr $diagram.SVG 0 100 | safeHTML }} }}|
|
||||
Goat Attribute: {{ .Attributes.width}}|
|
||||
-- layouts/_default/_markup/render-codeblock-go.html --
|
||||
Go Code: {{ .Code | safeHTML }}|
|
||||
Go Language: {{ .Lang }}|
|
||||
Go Code: {{ .Inner | safeHTML }}|
|
||||
Go Language: {{ .Type }}|
|
||||
-- layouts/_default/single.html --
|
||||
{{ .Content }}
|
||||
-- content/p1.md --
|
||||
@@ -129,7 +129,7 @@ echo "p1";
|
||||
-- layouts/_default/single.html --
|
||||
{{ .Content }}
|
||||
-- layouts/_default/_markup/render-codeblock.html --
|
||||
|{{ .Code | safeHTML }}|
|
||||
|{{ .Inner | safeHTML }}|
|
||||
|
||||
`
|
||||
|
||||
|
@@ -150,11 +150,11 @@ func (c *codeBlockContext) Page() interface{} {
|
||||
return c.page
|
||||
}
|
||||
|
||||
func (c *codeBlockContext) Lang() string {
|
||||
func (c *codeBlockContext) Type() string {
|
||||
return c.lang
|
||||
}
|
||||
|
||||
func (c *codeBlockContext) Code() string {
|
||||
func (c *codeBlockContext) Inner() string {
|
||||
return c.code
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user