From 29f323e028c28fcac5de50a301bd2e1d06750469 Mon Sep 17 00:00:00 2001 From: Jihoonahn Date: Thu, 24 Aug 2023 00:57:24 +0900 Subject: [PATCH] Update Source --- Sources/Blog/Blog.swift | 6 +++--- .../NextAndPreview/NextAndPreview.swift | 5 ++--- .../Common properties/Pagination/Pagination.swift | 10 +++++----- .../Components/Common properties/Script/Script.swift | 4 ++-- .../Common properties/SiteMain/SiteMain.swift | 6 ++++-- .../Components/Common properties/Time/Time.swift | 4 ++-- .../Components/Common properties/Wrapper/Wrapper.swift | 2 +- .../Index/Categories/IndexCategories.swift | 2 +- .../Components/System Properties/Index/IndexPage.swift | 3 +-- .../System Properties/Index/Posts/IndexPosts.swift | 2 +- .../System Properties/Index/Profile/IndexProfile.swift | 2 +- .../System Properties/Section/About/AboutPage.swift | 2 +- .../System Properties/Tag/Detail/TagDetail.swift | 2 +- .../System Properties/Tag/List/TagList.swift | 6 +++--- Sources/Blog/SocialMediaLink.swift | 9 +-------- 15 files changed, 29 insertions(+), 36 deletions(-) diff --git a/Sources/Blog/Blog.swift b/Sources/Blog/Blog.swift index 9fa995d7..650e2514 100644 --- a/Sources/Blog/Blog.swift +++ b/Sources/Blog/Blog.swift @@ -14,11 +14,11 @@ struct Blog: Website { } } } - + struct ItemMetadata: WebsiteItemMetadata { var postImage: String } - + var url = URL(string: "https://blog.jihoon.me")! var name = "Jihoon.me" var description = "This is a personal blog for iOS Developer Jihoonahn." @@ -27,5 +27,5 @@ struct Blog: Website { var favicon: Favicon? { Favicon(path: "/favicon.ico", type: "image/x-icon") } - var socialMediaLinks: [SocialMediaLink] { [.github, .linkedIn, .twitter, .email, .rss] } + var socialMediaLinks: [SocialMediaLink] { [.github, .linkedIn, .email, .rss] } } diff --git a/Sources/Blog/BlogTheme/Components/Common properties/NextAndPreview/NextAndPreview.swift b/Sources/Blog/BlogTheme/Components/Common properties/NextAndPreview/NextAndPreview.swift index 836bc7e6..0ecbfbd2 100644 --- a/Sources/Blog/BlogTheme/Components/Common properties/NextAndPreview/NextAndPreview.swift +++ b/Sources/Blog/BlogTheme/Components/Common properties/NextAndPreview/NextAndPreview.swift @@ -2,10 +2,10 @@ import Plot import Publish struct NextAndPreview: Component { - + var context: PublishingContext var item: Item - + var body: Component { Div { let items = context.allItems(sortedBy: \.date) @@ -34,4 +34,3 @@ struct NextAndPreview: Component { }.class("nextAndPreview") } } -//context.allItems(sortedBy: \.date) diff --git a/Sources/Blog/BlogTheme/Components/Common properties/Pagination/Pagination.swift b/Sources/Blog/BlogTheme/Components/Common properties/Pagination/Pagination.swift index 301a3f77..b4be482c 100644 --- a/Sources/Blog/BlogTheme/Components/Common properties/Pagination/Pagination.swift +++ b/Sources/Blog/BlogTheme/Components/Common properties/Pagination/Pagination.swift @@ -6,14 +6,14 @@ struct Pagination: Component { let numberOfPages: Int let pageURL: (_ pageNumber: Int) -> String let isDemo: Bool - + public init(activePage: Int, numberOfPages: Int, pageURL: @escaping (Int) -> String, isDemo: Bool = false) { self.activePage = activePage self.numberOfPages = numberOfPages self.pageURL = pageURL self.isDemo = isDemo } - + var body: Component { Navigation { List { @@ -99,7 +99,7 @@ struct Pagination: Component { }.class("pagination justify-content-center") }.accessibilityLabel("site-pagination") } - + func generatePageURL(pageNumber: Int) -> String { if isDemo { return "#" @@ -107,7 +107,7 @@ struct Pagination: Component { return pageURL(pageNumber) } } - + func buildPageLink(pageNumber: Int) -> Component { var linkClassList = "page-item d-none d-lg-block" let generatingCurrentPageLink = pageNumber == activePage @@ -128,7 +128,7 @@ struct Pagination: Component { pageLink = pageLink.class(linkClassList) return pageLink } - + func buildEllipsisPageLink() -> Component { ListItem { Text("...") diff --git a/Sources/Blog/BlogTheme/Components/Common properties/Script/Script.swift b/Sources/Blog/BlogTheme/Components/Common properties/Script/Script.swift index 2aae1bbf..538b5529 100644 --- a/Sources/Blog/BlogTheme/Components/Common properties/Script/Script.swift +++ b/Sources/Blog/BlogTheme/Components/Common properties/Script/Script.swift @@ -3,12 +3,12 @@ import Plot struct Script: Component { // MARK: - Properties var nodes: [Node] - + // MARK: - Initalizer init(_ nodes: Node...) { self.nodes = nodes } - + var body: Component { Node.script(nodes.node) } diff --git a/Sources/Blog/BlogTheme/Components/Common properties/SiteMain/SiteMain.swift b/Sources/Blog/BlogTheme/Components/Common properties/SiteMain/SiteMain.swift index e8ba0945..1f11bdda 100644 --- a/Sources/Blog/BlogTheme/Components/Common properties/SiteMain/SiteMain.swift +++ b/Sources/Blog/BlogTheme/Components/Common properties/SiteMain/SiteMain.swift @@ -3,8 +3,10 @@ import Publish struct SiteMain: ComponentContainer { @ComponentBuilder var content: ContentProvider - + var body: Component { - Main(content: content).id("site-main").class("site-main outer") + Main(content: content) + .id("site-main") + .class("site-main outer") } } diff --git a/Sources/Blog/BlogTheme/Components/Common properties/Time/Time.swift b/Sources/Blog/BlogTheme/Components/Common properties/Time/Time.swift index d76ea6bc..330207ee 100644 --- a/Sources/Blog/BlogTheme/Components/Common properties/Time/Time.swift +++ b/Sources/Blog/BlogTheme/Components/Common properties/Time/Time.swift @@ -3,12 +3,12 @@ import Plot struct Time: Component { // MARK: - Properties var text: String - + // MARK: - Initalizer init(_ text: String) { self.text = text } - + var body: Component { Node.nodeTime(.text(text)) } diff --git a/Sources/Blog/BlogTheme/Components/Common properties/Wrapper/Wrapper.swift b/Sources/Blog/BlogTheme/Components/Common properties/Wrapper/Wrapper.swift index e1e77a23..4136074d 100644 --- a/Sources/Blog/BlogTheme/Components/Common properties/Wrapper/Wrapper.swift +++ b/Sources/Blog/BlogTheme/Components/Common properties/Wrapper/Wrapper.swift @@ -3,7 +3,7 @@ import Publish struct Wrapper: ComponentContainer { @ComponentBuilder var content: ContentProvider - + var body: Component { Div(content: content).class("wrapper") } diff --git a/Sources/Blog/BlogTheme/Components/System Properties/Index/Categories/IndexCategories.swift b/Sources/Blog/BlogTheme/Components/System Properties/Index/Categories/IndexCategories.swift index 6a3bd18f..e59ad606 100644 --- a/Sources/Blog/BlogTheme/Components/System Properties/Index/Categories/IndexCategories.swift +++ b/Sources/Blog/BlogTheme/Components/System Properties/Index/Categories/IndexCategories.swift @@ -4,7 +4,7 @@ import Publish struct IndexCategories: Component { var tags: [Tag] var context: PublishingContext - + var body: Component { Div { H2("Explore Categories") diff --git a/Sources/Blog/BlogTheme/Components/System Properties/Index/IndexPage.swift b/Sources/Blog/BlogTheme/Components/System Properties/Index/IndexPage.swift index f56634e8..8a9ff865 100644 --- a/Sources/Blog/BlogTheme/Components/System Properties/Index/IndexPage.swift +++ b/Sources/Blog/BlogTheme/Components/System Properties/Index/IndexPage.swift @@ -4,8 +4,7 @@ import Publish struct IndexPage: Component { let pageNumber: Int let context: PublishingContext - - @ComponentBuilder + var body: Component { SiteMain { Div { diff --git a/Sources/Blog/BlogTheme/Components/System Properties/Index/Posts/IndexPosts.swift b/Sources/Blog/BlogTheme/Components/System Properties/Index/Posts/IndexPosts.swift index 1becb1b5..19df5bf0 100644 --- a/Sources/Blog/BlogTheme/Components/System Properties/Index/Posts/IndexPosts.swift +++ b/Sources/Blog/BlogTheme/Components/System Properties/Index/Posts/IndexPosts.swift @@ -5,7 +5,7 @@ import Publish struct IndexPosts: Component { var item: Item var context: PublishingContext - + var body: Component { Link(url: item.path.absoluteString) { Div { diff --git a/Sources/Blog/BlogTheme/Components/System Properties/Index/Profile/IndexProfile.swift b/Sources/Blog/BlogTheme/Components/System Properties/Index/Profile/IndexProfile.swift index 1a8a7a74..c0d661b9 100644 --- a/Sources/Blog/BlogTheme/Components/System Properties/Index/Profile/IndexProfile.swift +++ b/Sources/Blog/BlogTheme/Components/System Properties/Index/Profile/IndexProfile.swift @@ -4,7 +4,7 @@ import Publish struct IndexProfile: Component { var context: PublishingContext - + var body: Component { Div { H2("Profile").class("post-title") diff --git a/Sources/Blog/BlogTheme/Components/System Properties/Section/About/AboutPage.swift b/Sources/Blog/BlogTheme/Components/System Properties/Section/About/AboutPage.swift index dea12c72..f0371bee 100644 --- a/Sources/Blog/BlogTheme/Components/System Properties/Section/About/AboutPage.swift +++ b/Sources/Blog/BlogTheme/Components/System Properties/Section/About/AboutPage.swift @@ -2,7 +2,7 @@ import Plot import Publish struct AboutPage: Component { - var section: Publish.Section + let section: Publish.Section var body: Component { SiteMain { diff --git a/Sources/Blog/BlogTheme/Components/System Properties/Tag/Detail/TagDetail.swift b/Sources/Blog/BlogTheme/Components/System Properties/Tag/Detail/TagDetail.swift index 96ccb530..58dd0847 100644 --- a/Sources/Blog/BlogTheme/Components/System Properties/Tag/Detail/TagDetail.swift +++ b/Sources/Blog/BlogTheme/Components/System Properties/Tag/Detail/TagDetail.swift @@ -6,7 +6,7 @@ struct TagDetail: Component { let context: PublishingContext let selectedTag: Tag? let pageNumber: Int - + var body: Component { SiteMain { Div { diff --git a/Sources/Blog/BlogTheme/Components/System Properties/Tag/List/TagList.swift b/Sources/Blog/BlogTheme/Components/System Properties/Tag/List/TagList.swift index 699992a7..a5c69c8e 100644 --- a/Sources/Blog/BlogTheme/Components/System Properties/Tag/List/TagList.swift +++ b/Sources/Blog/BlogTheme/Components/System Properties/Tag/List/TagList.swift @@ -2,9 +2,9 @@ import Plot import Publish struct TagList: Component { - var tags: [Tag] - var context: PublishingContext - + let tags: [Tag] + let context: PublishingContext + var body: Component { SiteMain { Div { diff --git a/Sources/Blog/SocialMediaLink.swift b/Sources/Blog/SocialMediaLink.swift index 110bfa46..494dab2d 100644 --- a/Sources/Blog/SocialMediaLink.swift +++ b/Sources/Blog/SocialMediaLink.swift @@ -14,13 +14,6 @@ extension SocialMediaLink { icon: "fa-brands fa-linkedin-in" ) } - static var twitter: SocialMediaLink { - return SocialMediaLink( - title: "Twitter", - url: "https://twitter.com/jihoon_dev", - icon: "fa-brands fa-twitter" - ) - } static var github: SocialMediaLink { return SocialMediaLink( title: "GitHub", @@ -37,7 +30,7 @@ extension SocialMediaLink { static var email: SocialMediaLink { return SocialMediaLink( title: "Email", - url: "mailto:official@jihoon.me", + url: "mailto:jihoonahn.dev@gmail.com", icon: "fa-solid fa-envelope" ) }