Skip to content

Commit 4ef4789

Browse files
authored
Merge pull request #773 from JPToroDev/bug-fixes
Update README.
2 parents 3a0cb7c + a786561 commit 4ef4789

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

README.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ Once you've built your site and are ready to see how it looks, do *not* just dou
5454
Instead, the best way to preview your site is using the Ignite CLI tool, which you installed in Getting Started above:
5555

5656
- 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`.
5857

5958
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.
6059

@@ -121,13 +120,13 @@ Accordion {
121120
It has automatic code syntax highlighting for a dozen languages:
122121

123122
```swift
124-
CodeBlock(language: "swift", """
123+
CodeBlock(.swift) { """
125124
struct ContentView: View {
126125
var body: some View {
127126
Text("Hello, Swift!")
128127
}
129128
}
130-
""")
129+
""" }
131130
```
132131

133132
![Swift code with syntax highlighting.](images/code.png)
@@ -174,38 +173,38 @@ And it results inn this **Build** structure:
174173

175174
**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."
176175

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:
178177

179178
```swift
180179
import Foundation
181180
import Ignite
182181

183-
struct CustomContentLayout: ContentLayout {
182+
struct CustomArticleLayout: ArticlePage {
184183
var body: some HTML {
185-
Text(content.title)
184+
Text(article.title)
186185
.font(.title1)
187186

188-
if let image = content.image {
189-
Image(image, description: content.imageDescription)
187+
if let image = article.image {
188+
Image(image, description: article.imageDescription)
190189
.resizable()
191190
.cornerRadius(20)
192191
.frame(maxHeight: 300)
193192
}
194193

195-
if content.hasTags {
194+
if let tags = article.tags {
196195
Section {
197-
Text("Tagged with: \(content.tags.joined(separator: ", "))")
196+
Text("Tagged with: \(tags.joined(separator: ", "))")
198197

199-
Text("\(content.estimatedWordCount) words; \(content.estimatedReadingMinutes) minutes to read.")
198+
Text("\(article.estimatedWordCount) words; \(article.estimatedReadingMinutes) minutes to read.")
200199
}
201200
}
202201

203-
Text(content.body)
202+
Text(article.text)
204203
}
205204
}
206205
```
207206

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:
209208

210209
```swift
211210
struct ExampleSite: Site {
@@ -216,8 +215,8 @@ struct ExampleSite: Site {
216215
var layout = MyLayout()
217216

218217
/* This part adds the custom layout */
219-
var layouts: [any ContentLayout] {
220-
CustomContentLayout()
218+
var articlePages: [any ArticlePage] {
219+
CustomArticleLayout()
221220
}
222221
}
223222
```
@@ -268,6 +267,7 @@ That will launch a local web server you should use to preview your site, and als
268267

269268
| Website | Repository |
270269
|------------------------|-------------------------------------------|
270+
| [Lighting Ignite on Fire](https://jptoro.dev/lighting-ignite-on-fire/) | [GitHub](https://github.com/JPToroDev/Lighting-Ignite-on-Fire) |
271271
| [jcalderita Portfolio](https://jcalderita.com) | [GitHub](https://github.com/jcalderita/portfolio-web-ignite) |
272272
| [Fotogroep de Gender](http://www.vdhamer.com/fgDeGender) | [GitHub](https://github.com/vdhamer/Photo-Club-Hub-HTML) |
273273
| [sookim-1's T.W.L](https://sookim-1.github.io) | [GitHub](https://github.com/sookim-1/blog-website) |

0 commit comments

Comments
 (0)