Skip to content

Commit

Permalink
Fixed for allowing Path to be set-able
Browse files Browse the repository at this point in the history
  • Loading branch information
Wayne Dixon committed Oct 8, 2022
1 parent fc8b0e0 commit 15b8187
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 6 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
</a>
</p>

**Note** This is a fork of the original for use by Wayne Dixon.

Welcome to **Publish**, a static site generator built specifically for Swift developers. It enables entire websites to be built using Swift, and supports themes, plugins and tons of other powerful customization options.

Publish is used to build all of [swiftbysundell.com](https://swiftbysundell.com).
Expand Down
2 changes: 1 addition & 1 deletion Sources/Publish/API/Index.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ import Foundation

/// A representation of a website's main index page
public struct Index: Location {
public var path: Path { "" }
public var path: Path = Path("")
public var content = Content()
}
3 changes: 2 additions & 1 deletion Sources/Publish/API/Item.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public struct Item<Site: Website>: AnyItem, Hashable {
/// this item is for.
public var metadata: Site.ItemMetadata
public var tags: [Tag]
public var path: Path { makeAbsolutePath() }
public var path: Path = Path("")
public var content: Content
public var rssProperties: ItemRSSProperties

Expand All @@ -39,6 +39,7 @@ public struct Item<Site: Website>: AnyItem, Hashable {
tags: [Tag] = [],
content: Content = Content(),
rssProperties: ItemRSSProperties = .init()) {
self.path = path
self.relativePath = path
self.sectionID = sectionID
self.metadata = metadata
Expand Down
3 changes: 2 additions & 1 deletion Sources/Publish/API/Section.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public struct Section<Site: Website>: Location {
public private(set) var items = [Item<Site>]()
/// The date of the last modified item within the section.
public private(set) var lastItemModificationDate: Date?
public var path: Path { Path(id.rawValue) }
public var path: Path = Path("")
public var content = Content()

internal var allTags: AnySequence<Tag> { .init(itemIndexesByTag.keys) }
Expand All @@ -28,6 +28,7 @@ public struct Section<Site: Website>: Location {
internal init(id: Site.SectionID) {
self.id = id
self.title = id.rawValue.capitalized
self.path = Path(self.id.rawValue)
}
}

Expand Down
4 changes: 2 additions & 2 deletions Sources/Publish/API/TagDetailsPage.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
import Foundation

/// A representation of a page that contains details about a given tag.
public struct TagDetailsPage: Location {
public struct TagDetailsPage: Location {
/// The tag that the details page is for.
public var tag: Tag
public let path: Path
public var path: Path = Path("")
public var content: Content
}
2 changes: 1 addition & 1 deletion Sources/Publish/API/TagListPage.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
public struct TagListPage: Location {
/// All of the tags used within the website.
public var tags: Set<Tag>
public let path: Path
public var path: Path = Path("")
public var content: Content
}

0 comments on commit 15b8187

Please sign in to comment.