Tools for Generating Websites

What's New

Version 6.1.1


Bug Fixes

  • Swift 5.7 is required (but older toolchains will not resolve to this version).

macOS • Windows • Web • Ubuntu • tvOS • iOS • Android • Amazon Linux • watchOS



SDGWeb provides tools for generating websites.

כְּשִׁמְךָ אֱלֹהִים כְּן תְּהלָּתְךָ עַל־קַצְוֵי־אֶרֶץ׃

Like your name, O God, your praise reaches to the ends of the earth.

―sons of קורח/Koraẖ


  • Sites are constructed from simple templates.
  • Customizable template processing in Swift.
  • Supports localized websites.

Example Usage

let mock = RepositoryStructure(
    .appendingPathComponent("Mock Projects")

let site = Site<L, Unfolder>(
  repositoryStructure: mock,
  siteRoot: UserFacing<URL, L>({ _ in return URL(string: "")! }),
  localizationDirectories: UserFacing<StrictString, L>({ localization in
    return localization.icon ?? StrictString(localization.code)
  author: UserFacing<ElementSyntax, L>({ _ in
    return .author("John Doe", language: InterfaceLocalization.englishCanada)
  reportProgress: { _ in }

try site.generate().get()
let warnings = site.validate()

Some platforms lack certain features. The compilation conditions which appear throughout the documentation are defined as follows:

.define("PLATFORM_LACKS_FOUNDATION_FILE_MANAGER", .when(platforms: [.wasi])),


SDGWeb provides libraries for use with the Swift Package Manager.

Simply add SDGWeb as a dependency in Package.swift and specify which of the libraries to use:

let package = Package(
  name: "MyPackage",
  dependencies: [
      name: "SDGWeb",
      url: "",
      from: Version(6, 1, 1)
  targets: [
      name: "MyTarget",
      dependencies: [
        .product(name: "SDGWeb", package: "SDGWeb"),
        .product(name: "SDGHTML", package: "SDGWeb"),
        .product(name: "SDGCSS", package: "SDGWeb"),

The modules can then be imported in source files:

import SDGWeb
import SDGHTML
import SDGCSS


The SDGWeb project is maintained by Jeremy David Giesbrecht.

If SDGWeb saves you money, consider giving some of it as a donation.

If SDGWeb saves you time, consider devoting some of it to contributing back to the project.

Ἄξιος γὰρ ὁ ἐργάτης τοῦ μισθοῦ αὐτοῦ ἐστι.

For the worker is worthy of his wages.



  • Swift Tools 5.7.0
View More Packages from this Author


Last updated: Thu Mar 16 2023 19:47:46 GMT-0500 (GMT-05:00)