You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+15-15Lines changed: 15 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -54,7 +54,6 @@ Once you've built your site and are ready to see how it looks, do *not* just dou
54
54
Instead, the best way to preview your site is using the Ignite CLI tool, which you installed in Getting Started above:
55
55
56
56
- Run `ignite run --preview` to preview your site and open it in your web browser.
57
-
- If Ignite tells you there is already a web server running on that port, run `ignite run --preview --force`.
58
57
59
58
That will open your web browser straight to your site. You can then return to Xcode and make changes to your site freely – every time you press Cmd+R to build your site, you can refresh your browser to see the changes.
60
59
@@ -121,13 +120,13 @@ Accordion {
121
120
It has automatic code syntax highlighting for a dozen languages:
122
121
123
122
```swift
124
-
CodeBlock(language: "swift","""
123
+
CodeBlock(.swift) {"""
125
124
struct ContentView: View {
126
125
var body: some View {
127
126
Text("Hello, Swift!")
128
127
}
129
128
}
130
-
""")
129
+
""" }
131
130
```
132
131
133
132

@@ -174,38 +173,38 @@ And it results inn this **Build** structure:
174
173
175
174
**A precondition for this to work is to have a layout available to render your content.** If you don't have a valid layout in place, Ignite will issue a warning saying "Your site must provide at least one layout in order to render Markdown."
176
175
177
-
You can create custom content layouts by making types conform to the `ContentLayout` protocol, which will automatically be given a `content` property to access the content it is displaying. For example:
176
+
You can create custom layouts for articles by making types conform to the `ArticlePage` protocol, which will automatically be given an `article` property to access the content it is displaying. For example:
Text("\(content.estimatedWordCount) words; \(content.estimatedReadingMinutes) minutes to read.")
198
+
Text("\(article.estimatedWordCount) words; \(article.estimatedReadingMinutes) minutes to read.")
200
199
}
201
200
}
202
201
203
-
Text(content.body)
202
+
Text(article.text)
204
203
}
205
204
}
206
205
```
207
206
208
-
Once you've defined a custom layout, you should add it to your `Site` struct. This can be done by adding this new layout to the `layouts` property of the site, like this:
207
+
Once you've defined a custom layout, you should add it to your `Site` struct. This can be done by adding this new layout to the `articlePages` property of the site, like this:
209
208
210
209
```swift
211
210
structExampleSite: Site {
@@ -216,8 +215,8 @@ struct ExampleSite: Site {
216
215
var layout =MyLayout()
217
216
218
217
/* This part adds the custom layout */
219
-
varlayouts: [anyContentLayout] {
220
-
CustomContentLayout()
218
+
vararticlePages: [anyArticlePage] {
219
+
CustomArticleLayout()
221
220
}
222
221
}
223
222
```
@@ -268,6 +267,7 @@ That will launch a local web server you should use to preview your site, and als
0 commit comments