Skip to content

Commit

Permalink
Update Source
Browse files Browse the repository at this point in the history
  • Loading branch information
jihoonahn committed Aug 23, 2023
1 parent f0459d5 commit 29f323e
Show file tree
Hide file tree
Showing 15 changed files with 29 additions and 36 deletions.
6 changes: 3 additions & 3 deletions Sources/Blog/Blog.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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."
Expand All @@ -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] }
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ import Plot
import Publish

struct NextAndPreview: Component {

var context: PublishingContext<Blog>
var item: Item<Blog>

var body: Component {
Div {
let items = context.allItems(sortedBy: \.date)
Expand Down Expand Up @@ -34,4 +34,3 @@ struct NextAndPreview: Component {
}.class("nextAndPreview")
}
}
//context.allItems(sortedBy: \.date)
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -99,15 +99,15 @@ struct Pagination: Component {
}.class("pagination justify-content-center")
}.accessibilityLabel("site-pagination")
}

func generatePageURL(pageNumber: Int) -> String {
if isDemo {
return "#"
} else {
return pageURL(pageNumber)
}
}

func buildPageLink(pageNumber: Int) -> Component {
var linkClassList = "page-item d-none d-lg-block"
let generatingCurrentPageLink = pageNumber == activePage
Expand All @@ -128,7 +128,7 @@ struct Pagination: Component {
pageLink = pageLink.class(linkClassList)
return pageLink
}

func buildEllipsisPageLink() -> Component {
ListItem {
Text("...")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ import Plot
struct Script: Component {
// MARK: - Properties
var nodes: [Node<HTML.ScriptContext>]

// MARK: - Initalizer
init(_ nodes: Node<HTML.ScriptContext>...) {
self.nodes = nodes
}

var body: Component {
Node<HTML.BodyContext>.script(nodes.node)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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<HTML.BodyContext>.nodeTime(.text(text))
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import Publish

struct Wrapper: ComponentContainer {
@ComponentBuilder var content: ContentProvider

var body: Component {
Div(content: content).class("wrapper")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import Publish
struct IndexCategories: Component {
var tags: [Tag]
var context: PublishingContext<Blog>

var body: Component {
Div {
H2("Explore Categories")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ import Publish
struct IndexPage: Component {
let pageNumber: Int
let context: PublishingContext<Blog>

@ComponentBuilder

var body: Component {
SiteMain {
Div {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import Publish
struct IndexPosts: Component {
var item: Item<Blog>
var context: PublishingContext<Blog>

var body: Component {
Link(url: item.path.absoluteString) {
Div {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import Publish

struct IndexProfile: Component {
var context: PublishingContext<Blog>

var body: Component {
Div {
H2("Profile").class("post-title")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import Plot
import Publish

struct AboutPage: Component {
var section: Publish.Section<Blog>
let section: Publish.Section<Blog>

var body: Component {
SiteMain {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ struct TagDetail: Component {
let context: PublishingContext<Blog>
let selectedTag: Tag?
let pageNumber: Int

var body: Component {
SiteMain {
Div {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import Plot
import Publish

struct TagList: Component {
var tags: [Tag]
var context: PublishingContext<Blog>
let tags: [Tag]
let context: PublishingContext<Blog>

var body: Component {
SiteMain {
Div {
Expand Down
9 changes: 1 addition & 8 deletions Sources/Blog/SocialMediaLink.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -37,7 +30,7 @@ extension SocialMediaLink {
static var email: SocialMediaLink {
return SocialMediaLink(
title: "Email",
url: "mailto:[email protected]",
url: "mailto:[email protected]",
icon: "fa-solid fa-envelope"
)
}
Expand Down

0 comments on commit 29f323e

Please sign in to comment.