@@ -14,20 +14,6 @@ Feature: Hugo Bookshop CloudCannon Live Editing Site Data
14
14
go.mod from starters/hugo/site.go.mod
15
15
config.toml from starters/hugo/site.config.toml
16
16
"""
17
-
18
- Scenario : Bookshop live renders website data
19
- Given a site/cloudcannon.config.yml file containing:
20
- """
21
- data_config: true
22
- """
23
- Given a site/data/cat.yml file containing:
24
- """
25
- name: Cheeka
26
- """
27
- * a component-lib/components/cat/cat.hugo.html file containing:
28
- """
29
- <h1>{{ if .show }}{{ site.Data.cat.name }}{{ end }}</h1>
30
- """
31
17
* [front_matter]:
32
18
"""
33
19
show: false
@@ -43,10 +29,24 @@ Feature: Hugo Bookshop CloudCannon Live Editing Site Data
43
29
<html>
44
30
<body>
45
31
{{ partial "bookshop_bindings" `(dict "show" .Params.show)` }}
46
- {{ partial "bookshop" (slice "cat " (dict "show" .Params.show)) }}
32
+ {{ partial "bookshop" (slice "block " (dict "show" .Params.show)) }}
47
33
</body>
48
34
</html>
49
35
"""
36
+
37
+ Scenario : Bookshop live renders website data
38
+ Given a site/cloudcannon.config.yml file containing:
39
+ """
40
+ data_config: true
41
+ """
42
+ Given a site/data/cat.yml file containing:
43
+ """
44
+ name: Cheeka
45
+ """
46
+ * a component-lib/components/block/block.hugo.html file containing:
47
+ """
48
+ <h1>{{ if .show }}{{ site.Data.cat.name }}{{ end }}</h1>
49
+ """
50
50
* 🌐 I have loaded my site in CloudCannon
51
51
When 🌐 CloudCannon pushes new yaml:
52
52
"""
@@ -74,32 +74,32 @@ Feature: Hugo Bookshop CloudCannon Live Editing Site Data
74
74
useful: yes
75
75
messy: yes
76
76
"""
77
- * a component-lib/components/cat/cat .hugo.html file containing:
77
+ * a component-lib/components/block/block .hugo.html file containing:
78
78
"""
79
79
{{ if .show }}
80
80
{{ range site.Data.cats }}
81
81
<p>{{ .name }} — {{ .useful }}/{{ .messy }}</p>
82
82
{{ end }}
83
83
{{ end }}
84
84
"""
85
- * [front_matter]:
86
- """
87
- show: false
88
- """
89
- * a site/content/_index.md file containing:
85
+ * 🌐 I have loaded my site in CloudCannon
86
+ When 🌐 CloudCannon pushes new yaml:
90
87
"""
91
- ---
92
- [front_matter]
93
- ---
88
+ show: true
94
89
"""
95
- * a site/layouts/index.html file containing:
90
+ Then 🌐 There should be no errors
91
+ * 🌐 There should be no logs
92
+ * 🌐 The selector p:nth-of-type(1) should contain "Cheeka — no/no"
93
+ * 🌐 The selector p:nth-of-type(2) should contain "Smudge — yes/yes"
94
+
95
+ Scenario : Bookshop live renders special website config
96
+ Given a component-lib/components/block/block.hugo.html file containing:
96
97
"""
97
- <html>
98
- <body>
99
- {{ partial "bookshop_bindings" `(dict "show" .Params.show)` }}
100
- {{ partial "bookshop" (slice "cat" (dict "show" .Params.show)) }}
101
- </body>
102
- </html>
98
+ {{ if .show }}
99
+ <h1>{{ site.BaseURL }}</h1>
100
+ <h2>{{ site.Copyright }}</h2>
101
+ <h3>{{ site.Title }}</h3>
102
+ {{ end }}
103
103
"""
104
104
* 🌐 I have loaded my site in CloudCannon
105
105
When 🌐 CloudCannon pushes new yaml:
@@ -108,5 +108,6 @@ Feature: Hugo Bookshop CloudCannon Live Editing Site Data
108
108
"""
109
109
Then 🌐 There should be no errors
110
110
* 🌐 There should be no logs
111
- * 🌐 The selector p:nth-of-type(1) should contain "Cheeka — no/no"
112
- * 🌐 The selector p:nth-of-type(2) should contain "Smudge — yes/yes"
111
+ * 🌐 The selector h1 should contain "https://bookshop.build/"
112
+ * 🌐 The selector h2 should contain "🎉"
113
+ * 🌐 The selector h3 should contain "Hugo Bookshop Cucumber"
0 commit comments