Skip to content

Commit 6d9864c

Browse files
authored
Merge pull request #33 from snipem/hugo-upstream-asciidoc-fix
Use native Asciidoc Plugins Support of Hugo, no Workaround needed
2 parents 0c61715 + b87e046 commit 6d9864c

File tree

9 files changed

+68
-396
lines changed

9 files changed

+68
-396
lines changed

Makefile

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
2-
# run: make theme && head internal/theme/bindata.go
1+
# run: make theme && head internal/theme/bindata.go
32
SHELL := /bin/bash
43
.PHONY: compose test
54

@@ -59,8 +58,8 @@ run_prd: build secrets
5958

6059
run: build compose serve
6160

62-
run_local: build
63-
# Runs locally, clons this git repo to use test data
61+
run_local: build
62+
# Runs locally, clones this git repo to use test data
6463
./monako -config test/config.local.yaml -menu-config test/config.menu.local.md
6564
$(MAKE) serve
6665

cmd/monako/main_test.go

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -68,19 +68,19 @@ func TestMainMonakoTest(t *testing.T) {
6868
})
6969

7070
t.Run("Check for generated test doc markdown page", func(t *testing.T) {
71-
assert.FileExists(t, filepath.Join(targetDir, "compose/public/docs/test/test_doc_markdown/index.html"), "Generated Test doc does not exist")
71+
assert.FileExists(t, filepath.Join(targetDir, "compose/public/docs/test/test_doc_markdown.html"), "Generated Test doc does not exist")
7272

73-
contentBytes, err := ioutil.ReadFile(filepath.Join(targetDir, "compose/public/docs/test/test_doc_markdown/index.html"))
73+
contentBytes, err := ioutil.ReadFile(filepath.Join(targetDir, "compose/public/docs/test/test_doc_markdown.html"))
7474
content := string(contentBytes)
7575

7676
assert.NoError(t, err, "Can't read file")
7777
assert.Contains(t, content, "<strong>Test docs</strong>", "Contains menu")
7878

79-
assert.Contains(t, content, "<img src=\"../profile.png\" alt=\"Picture in same folder\" />", "Contains relative picture")
79+
assert.Contains(t, content, "<img src=\"profile.png\" alt=\"Picture in same folder\" />", "Contains picture")
8080
assert.FileExists(t, filepath.Join(targetDir, "compose/public/docs/test/profile.png"), "Relative picture right placed")
8181

8282
assert.FileExists(t, filepath.Join(targetDir, "compose/public/docs/test/subfolder/subfolderprofile.png"), "Relative subfolder picture right placed")
83-
assert.Contains(t, content, "<img src=\"../subfolder/subfolderprofile.png\" alt=\"Picture in sub folder\" />", "Contains relative picture")
83+
assert.Contains(t, content, "<img src=\"subfolder/subfolderprofile.png\" alt=\"Picture in sub folder\" />", "Contains picture")
8484
})
8585

8686
// Provide the public folder over a webserver
@@ -90,7 +90,7 @@ func TestMainMonakoTest(t *testing.T) {
9090

9191
t.Run("Check if images and sources are served", func(t *testing.T) {
9292

93-
content, err := getContentFromURL(ts, "/docs/test/test_doc_markdown/index.html")
93+
content, err := getContentFromURL(ts, "/docs/test/test_doc_markdown.html")
9494
assert.NoError(t, err, "HTTP Call failed")
9595

9696
srcs, err := getURLKeyValuesFromHTML(content, "src", ts.URL)
@@ -118,7 +118,7 @@ func TestMainMonakoTest(t *testing.T) {
118118

119119
t.Run("Check contents of served page markdown", func(t *testing.T) {
120120

121-
content, err := getContentFromURL(ts, "/docs/test/test_doc_markdown/index.html")
121+
content, err := getContentFromURL(ts, "/docs/test/test_doc_markdown.html")
122122
assert.NoError(t, err, "HTTP Call failed")
123123

124124
assert.Contains(t, content, "Ihr naht euch wieder, schwankende Gestalten!", "Does not contain Goethe")
@@ -129,7 +129,7 @@ func TestMainMonakoTest(t *testing.T) {
129129

130130
t.Run("Check contents of served page asciidoc", func(t *testing.T) {
131131

132-
content, err := getContentFromURL(ts, "/docs/test/test_doc_asciidoc/index.html")
132+
content, err := getContentFromURL(ts, "/docs/test/test_doc_asciidoc.html")
133133
assert.NoError(t, err, "HTTP Call failed")
134134

135135
assert.Contains(t, content, "Ihr naht euch wieder, schwankende Gestalten!", "Does not contain Goethe")
@@ -150,6 +150,14 @@ func TestMainMonakoTest(t *testing.T) {
150150

151151
})
152152

153+
t.Run("Test if asciidoc diagram is served as svg", func(t *testing.T) {
154+
content, err := getContentFromURL(ts, "/docs/test/ditaa-diagram.svg")
155+
assert.NoError(t, err, "HTTP Call failed")
156+
157+
assert.Contains(t, content, "Lots of work")
158+
159+
})
160+
153161
t.Run("Check for RSS feed", func(t *testing.T) {
154162
content, err := getContentFromURL(ts, "/docs/index.xml")
155163
assert.NoError(t, err, "HTTP Call failed")

go.mod

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,9 @@ require (
77
github.com/PuerkitoBio/goquery v1.5.1
88
github.com/fsnotify/fsnotify v1.4.9 // indirect
99
github.com/gobuffalo/envy v1.9.0 // indirect
10-
github.com/gohugoio/hugo v0.67.0
10+
github.com/gohugoio/hugo v0.73.1-0.20200625075133-f0266e2ef348
1111
github.com/golang/protobuf v1.3.2 // indirect
1212
github.com/konsorten/go-windows-terminal-sequences v1.0.2 // indirect
13-
github.com/mattn/go-isatty v0.0.12 // indirect
1413
github.com/mitchellh/mapstructure v1.2.2 // indirect
1514
github.com/mmcdole/gofeed v1.0.0-beta2
1615
github.com/mmcdole/goxpp v0.0.0-20181012175147-0068e33feabf // indirect
@@ -20,10 +19,8 @@ require (
2019
github.com/spf13/cobra v0.0.7 // indirect
2120
github.com/spf13/viper v1.6.2 // indirect
2221
github.com/stretchr/testify v1.5.1
23-
github.com/yuin/goldmark v1.1.25 // indirect
2422
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550 // indirect
2523
golang.org/x/net v0.0.0-20200226121028-0de0cce0169b
26-
golang.org/x/sys v0.0.0-20200327173247-9dae0f8f5775 // indirect
2724
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 // indirect
2825
gopkg.in/ini.v1 v1.55.0 // indirect
2926
gopkg.in/src-d/go-billy.v4 v4.3.2

0 commit comments

Comments
 (0)