@@ -11,6 +11,7 @@ import (
11
11
qt "github.com/frankban/quicktest"
12
12
"github.com/gohugoio/hugo/common/types"
13
13
"github.com/gohugoio/hugo/htesting"
14
+ "github.com/gohugoio/hugo/markup/asciidocext"
14
15
"github.com/gohugoio/hugo/resources/resource_transformers/tocss/dartsass"
15
16
"github.com/gohugoio/hugo/resources/resource_transformers/tocss/scss"
16
17
)
@@ -1514,3 +1515,41 @@ MyTemplate: {{ partial "MyTemplate.html" . }}|
1514
1515
1515
1516
b .AssertFileContent ("public/index.html" , "MyTemplate: MyTemplate Edited" )
1516
1517
}
1518
+
1519
+ func TestRebuildEditAsciidocContentFile (t * testing.T ) {
1520
+ if ! asciidocext .Supports () {
1521
+ t .Skip ("skip asciidoc" )
1522
+ }
1523
+ files := `
1524
+ -- hugo.toml --
1525
+ baseURL = "https://example.com"
1526
+ disableLiveReload = true
1527
+ disableKinds = ["taxonomy", "term", "sitemap", "robotsTXT", "404", "rss", "home", "section"]
1528
+ [security]
1529
+ [security.exec]
1530
+ allow = ['^python$', '^rst2html.*', '^asciidoctor$']
1531
+ -- content/posts/p1.adoc --
1532
+ ---
1533
+ title: "P1"
1534
+ ---
1535
+ P1 Content.
1536
+ -- content/posts/p2.adoc --
1537
+ ---
1538
+ title: "P2"
1539
+ ---
1540
+ P2 Content.
1541
+ -- layouts/_default/single.html --
1542
+ Single: {{ .Title }}|{{ .Content }}|
1543
+ `
1544
+ b := TestRunning (t , files )
1545
+ b .AssertFileContent ("public/posts/p1/index.html" ,
1546
+ "Single: P1|<div class=\" paragraph\" >\n <p>P1 Content.</p>\n </div>\n |" )
1547
+ b .AssertRenderCountPage (2 )
1548
+ b .AssertRenderCountContent (2 )
1549
+
1550
+ b .EditFileReplaceAll ("content/posts/p1.adoc" , "P1 Content." , "P1 Content Edited." ).Build ()
1551
+
1552
+ b .AssertFileContent ("public/posts/p1/index.html" , "Single: P1|<div class=\" paragraph\" >\n <p>P1 Content Edited.</p>\n </div>\n |" )
1553
+ b .AssertRenderCountPage (1 )
1554
+ b .AssertRenderCountContent (1 )
1555
+ }
0 commit comments