Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,16 @@

@Chapter(name: "Your first site") {
Learn the basics of making a static website with Slipstream.

And there's cute pigs too 🐷

@Image(source: "IntroducingSlipstream-YourFirstSite", alt: "The Slipstream logo. The Swift bird logo is flying off the edge of the Tailwind CSS wind logo")

@TutorialReference(tutorial: "doc:IntroducingSlipstream-YourFirstSite-Workspace")
@TutorialReference(tutorial: "doc:IntroducingSlipstream-YourFirstSite-HelloWorld")
@TutorialReference(tutorial: "doc:IntroducingSlipstream-YourFirstSite-TextImageLink")
@TutorialReference(tutorial: "doc:IntroducingSlipstream-YourFirstSite-LayoutsAndResponsive")
@TutorialReference(tutorial: "doc:IntroducingSlipstream-YourFirstSite-MultiPageSite")
@TutorialReference(tutorial: "doc:IntroducingSlipstream-YourFirstSite-FormsAndInput")
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import Foundation

import Slipstream

struct Contact: View {
var body: some View {
HTML {
Head {
Stylesheet(URL(string: "main.css"))
}
Body {
Container {
H1("Contact Coco")
.fontSize(.extraExtraExtraLarge)
.bold()
.margin(.bottom, 32)

Text("Want to say hello to Coco? Fill out the form below!")
.margin(.bottom, 24)
}
.padding(.vertical, 48)
}
}
}
}

let sitemap: Sitemap = [
"contact.html": Contact()
]

guard let projectURL = URL(filePath: #filePath)?
.deletingLastPathComponent()
.deletingLastPathComponent() else {
print("Unable to create URL for \(#filePath)")
exit(1)
}

let outputURL = projectURL.appending(path: "site")

try renderSitemap(sitemap, to: outputURL)
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
import Foundation

import Slipstream

struct Contact: View {
var body: some View {
HTML {
Head {
Stylesheet(URL(string: "main.css"))
}
Body {
Container {
H1("Contact Coco")
.fontSize(.extraExtraExtraLarge)
.bold()
.margin(.bottom, 32)

Text("Want to say hello to Coco? Fill out the form below!")
.margin(.bottom, 24)

Form(method: .post, url: URL(string: "/submit")) {
// Form fields will go here
}
}
.padding(.vertical, 48)
}
}
}
}

let sitemap: Sitemap = [
"contact.html": Contact()
]

guard let projectURL = URL(filePath: #filePath)?
.deletingLastPathComponent()
.deletingLastPathComponent() else {
print("Unable to create URL for \(#filePath)")
exit(1)
}

let outputURL = projectURL.appending(path: "site")

try renderSitemap(sitemap, to: outputURL)
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import Foundation

import Slipstream

struct Contact: View {
var body: some View {
HTML {
Head {
Stylesheet(URL(string: "main.css"))
}
Body {
Container {
H1("Contact Coco")
.fontSize(.extraExtraExtraLarge)
.bold()
.margin(.bottom, 32)

Text("Want to say hello to Coco? Fill out the form below!")
.margin(.bottom, 24)

Form(method: .post, url: URL(string: "/submit")) {
TextField("Your name", type: .text, name: "name")
TextField("Your email", type: .email, name: "email")
}
}
.padding(.vertical, 48)
}
}
}
}

let sitemap: Sitemap = [
"contact.html": Contact()
]

guard let projectURL = URL(filePath: #filePath)?
.deletingLastPathComponent()
.deletingLastPathComponent() else {
print("Unable to create URL for \(#filePath)")
exit(1)
}

let outputURL = projectURL.appending(path: "site")

try renderSitemap(sitemap, to: outputURL)
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
import Foundation

import Slipstream

struct Contact: View {
var body: some View {
HTML {
Head {
Stylesheet(URL(string: "main.css"))
}
Body {
Container {
H1("Contact Coco")
.fontSize(.extraExtraExtraLarge)
.bold()
.margin(.bottom, 32)

Text("Want to say hello to Coco? Fill out the form below!")
.margin(.bottom, 24)

Form(method: .post, url: URL(string: "/submit")) {
TextField("Your name", type: .text, name: "name")
TextField("Your email", type: .email, name: "email")
TextArea("Your message", name: "message", rows: 5)
}
}
.padding(.vertical, 48)
}
}
}
}

let sitemap: Sitemap = [
"contact.html": Contact()
]

guard let projectURL = URL(filePath: #filePath)?
.deletingLastPathComponent()
.deletingLastPathComponent() else {
print("Unable to create URL for \(#filePath)")
exit(1)
}

let outputURL = projectURL.appending(path: "site")

try renderSitemap(sitemap, to: outputURL)
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
import Foundation

import Slipstream

struct Contact: View {
var body: some View {
HTML {
Head {
Stylesheet(URL(string: "main.css"))
}
Body {
Container {
H1("Contact Coco")
.fontSize(.extraExtraExtraLarge)
.bold()
.margin(.bottom, 32)

Text("Want to say hello to Coco? Fill out the form below!")
.margin(.bottom, 24)

Form(method: .post, url: URL(string: "/submit")) {
TextField("Your name", type: .text, name: "name")
TextField("Your email", type: .email, name: "email")
TextArea("Your message", name: "message", rows: 5)
Button(.submit) {
Text("Send Message")
}
}
}
.padding(.vertical, 48)
}
}
}
}

let sitemap: Sitemap = [
"contact.html": Contact()
]

guard let projectURL = URL(filePath: #filePath)?
.deletingLastPathComponent()
.deletingLastPathComponent() else {
print("Unable to create URL for \(#filePath)")
exit(1)
}

let outputURL = projectURL.appending(path: "site")

try renderSitemap(sitemap, to: outputURL)
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
import Foundation

import Slipstream

struct Contact: View {
var body: some View {
HTML {
Head {
Stylesheet(URL(string: "main.css"))
}
Body {
Container {
H1("Contact Coco")
.fontSize(.extraExtraExtraLarge)
.bold()
.margin(.bottom, 32)

Text("Want to say hello to Coco? Fill out the form below!")
.margin(.bottom, 24)

Form(method: .post, url: URL(string: "/submit")) {
TextField("Your name", type: .text, name: "name")
.padding(12)
.border(.all, width: 1, color: .gray, darkness: 300)
.cornerRadius(.medium)
.border(.all, width: 2, color: .blue, darkness: 500, condition: .focus)
.frame(width: .full)

TextField("Your email", type: .email, name: "email")
.padding(12)
.border(.all, width: 1, color: .gray, darkness: 300)
.cornerRadius(.medium)
.border(.all, width: 2, color: .blue, darkness: 500, condition: .focus)
.frame(width: .full)

TextArea("Your message", name: "message", rows: 5)
Button(.submit) {
Text("Send Message")
}
}
}
.padding(.vertical, 48)
}
}
}
}

let sitemap: Sitemap = [
"contact.html": Contact()
]

guard let projectURL = URL(filePath: #filePath)?
.deletingLastPathComponent()
.deletingLastPathComponent() else {
print("Unable to create URL for \(#filePath)")
exit(1)
}

let outputURL = projectURL.appending(path: "site")

try renderSitemap(sitemap, to: outputURL)
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
import Foundation

import Slipstream

struct Contact: View {
var body: some View {
HTML {
Head {
Stylesheet(URL(string: "main.css"))
}
Body {
Container {
H1("Contact Coco")
.fontSize(.extraExtraExtraLarge)
.bold()
.margin(.bottom, 32)

Text("Want to say hello to Coco? Fill out the form below!")
.margin(.bottom, 24)

Form(method: .post, url: URL(string: "/submit")) {
TextField("Your name", type: .text, name: "name")
.padding(12)
.border(.all, width: 1, color: .gray, darkness: 300)
.cornerRadius(.medium)
.border(.all, width: 2, color: .blue, darkness: 500, condition: .focus)
.frame(width: .full)

TextField("Your email", type: .email, name: "email")
.padding(12)
.border(.all, width: 1, color: .gray, darkness: 300)
.cornerRadius(.medium)
.border(.all, width: 2, color: .blue, darkness: 500, condition: .focus)
.frame(width: .full)

TextArea("Your message", name: "message", rows: 5)
.padding(12)
.border(.all, width: 1, color: .gray, darkness: 300)
.cornerRadius(.medium)
.border(.all, width: 2, color: .blue, darkness: 500, condition: .focus)
.frame(width: .full)

Button(.submit) {
Text("Send Message")
}
}
}
.padding(.vertical, 48)
}
}
}
}

let sitemap: Sitemap = [
"contact.html": Contact()
]

guard let projectURL = URL(filePath: #filePath)?
.deletingLastPathComponent()
.deletingLastPathComponent() else {
print("Unable to create URL for \(#filePath)")
exit(1)
}

let outputURL = projectURL.appending(path: "site")

try renderSitemap(sitemap, to: outputURL)
Loading