mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-29 22:29:56 +02:00
Add Markdown diagrams and render hooks for code blocks
You can now create custom hook templates for code blocks, either one for all (`render-codeblock.html`) or for a given code language (e.g. `render-codeblock-go.html`). We also used this new hook to add support for diagrams in Hugo: * Goat (Go ASCII Tool) is built-in and enabled by default; just create a fenced code block with the language `goat` and start draw your Ascii diagrams. * Another popular alternative for diagrams in Markdown, Mermaid (supported by GitHub), can also be implemented with a simple template. See the Hugo documentation for more information. Updates #7765 Closes #9538 Fixes #9553 Fixes #8520 Fixes #6702 Fixes #9558
This commit is contained in:
@@ -150,7 +150,7 @@ func TestPageBundlerSiteRegular(t *testing.T) {
|
||||
c.Assert(leafBundle1.Section(), qt.Equals, "b")
|
||||
sectionB := s.getPage(page.KindSection, "b")
|
||||
c.Assert(sectionB, qt.Not(qt.IsNil))
|
||||
home, _ := s.Info.Home()
|
||||
home := s.Info.Home()
|
||||
c.Assert(home.BundleType(), qt.Equals, files.ContentClassBranch)
|
||||
|
||||
// This is a root bundle and should live in the "home section"
|
||||
@@ -290,7 +290,7 @@ func TestPageBundlerSiteMultilingual(t *testing.T) {
|
||||
|
||||
c.Assert(len(s.RegularPages()), qt.Equals, 8)
|
||||
c.Assert(len(s.Pages()), qt.Equals, 16)
|
||||
//dumpPages(s.AllPages()...)
|
||||
// dumpPages(s.AllPages()...)
|
||||
|
||||
c.Assert(len(s.AllPages()), qt.Equals, 31)
|
||||
|
||||
|
Reference in New Issue
Block a user