Swiftpack.co - Package - SDGGiesbrecht/SDGWeb

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.

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()

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", from: Version(3, 1, 0)),
    ],
    targets: [
        .target(name: "MyTarget", dependencies: [
            .productItem(name: "SDGWeb", package: "SDGWeb"),
            .productItem(name: "SDGHTML", package: "SDGWeb"),
            .productItem(name: "SDGCSS", package: "SDGWeb"),
        ])
    ]
)

The modules can then be imported in source files:

import SDGWeb
import SDGHTML
import SDGCSS

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

Github

link
Stars: 1
Help us keep the lights on

Dependencies

Releases

3.1.0 - Oct 2, 2019

New Features

  • All platform restrictions have been removed.

3.0.0 - Sep 22, 2019

Breaking Changes

  • Swift 5.1
  • The older ContentSyntax and its child list node have been collapsed into a single list node.
    • The freed‐up, shorter name has been reused as the new name for ContentElementSyntax.

New Features

  • Many convenience methods and initializers have been added to syntax nodes.

2.0.1 - Aug 26, 2019

Bug Fixes

  • Validation recognizes data- attributes.

2.0.0 - Aug 16, 2019

Breaking Changes

  • Comments are now handled by the syntax tree, resulting in several new enumeration cases.

New Features

  • Validation is available directly without setting up site generation: Site.validate(site:).

Bug Fixes

  • Miscellaneous improvements to validation results.
  • Redirects have improved HTML style.
  • “>” is now escaped. While not technically necessary, this style makes many source operations more reliable.

1.0.2 - Jul 27, 2019

Bug Fixes

  • Interface‐related components are now localized into German.