Skip to content
Tools for Generating Websites
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github
Documentation
Resources
Sources
Tests
.gitignore
.travis.yml
LICENSE.md
Package.resolved
Package.swift
README.md
Refresh (Linux).sh
Refresh (macOS).command
Workspace.swift

README.md

🇨🇦EN

macOS • Linux • iOS • watchOS • tvOS

Documentation

SDGWeb

SDGWeb provides tools for generating websites.

כְּשִׁמְךָ אֱלֹהִים כְּן תְּהלָּתְךָ עַל־קַצְוֵי־אֶרֶץ׃
Like your name, O God, your praise reaches to the ends of the earth.

                                                                                                    ―sons of קורח/Koraẖ

Features

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

(For a list of related projects, see here.)

Importing

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: [
        .package(url: "https://github.com/SDGGiesbrecht/SDGWeb", .upToNextMinor(from: Version(0, 1, 1))),
    ],
    targets: [
        .target(name: "MyTarget", dependencies: [
            .productItem(name: "SDGWeb", package: "SDGWeb"),
            .productItem(name: "SDGHTML", package: "SDGWeb"),
            .productItem(name: "SDGCSS", package: "SDGWeb"),
        ])
    ]
)

The libraries’ modules can then be imported in source files:

import SDGWeb
import SDGHTML
import SDGCSS

Example Usage

let mock = RepositoryStructure(
    root: URL(fileURLWithPath: #file)
        .deletingLastPathComponent()
        .deletingLastPathComponent()
        .appendingPathComponent("Mock Projects/\(mockName)"))

let site = Site<L>(
    repositoryStructure: mock,
    domain: UserFacing<StrictString, L>({ _ in return "http://example.com" }),
    localizationDirectories: UserFacing<StrictString, L>({ localization in return localization.icon ?? StrictString(localization.code) }),
    pageProcessor: Processor(),
    reportProgress: { _ in })

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

About

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.

                                                                                                    ―‎ישוע/Yeshuʼa

You can’t perform that action at this time.