Static Site Generation with Swift using Publish, Plot and Ink
By the end of this tutorial, you will be able to create static websites generated with Swift using Publish, Plot and Ink.
Publish is provided as a Swift package and can be used with the Swift Package Manager by adding the package as a dependency within the
let package = Package( ... dependencies: [ .package(url: "https://github.com/johnsundell/publish.git", from: "0.1.0") ], ... )
However, the easiest way to get started is using the command-line tool to set up new projects and deploy websites. To use the command-line tool, clone the Publish repository and run
make in the local folder of the repository:
$ git clone https://github.com/JohnSundell/Publish.git $ cd Publish $ make
publish help provides instructions on how to use it. The basic
publish new command will create a new project at the current location, which can then be edited in Xcode using the
open Package.swift command.
$ mkdir AmazingWebsite $ cd AmazingWebsite $ publish new
Now, let's have a closer look at how it works in detail. Become a free member or log in to proceed.