Skip to content

Commit

Permalink
Merge pull request #207 from ios-osushi/feature/remove_tag
Browse files Browse the repository at this point in the history
Webサイトからタグを削除する
  • Loading branch information
uhooi authored Sep 28, 2024
2 parents a6bc08b + bfc9128 commit e0e4787
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 92 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/create_post.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
POST_DAY=${POST_DATE_BEFORE:6:2}
POST_DATE=$POST_YEAR-$POST_MONTH-$POST_DAY
touch $POST_FILE
echo -e "---\ndate: $POST_DATE 09:00\ndescription: TBD\ntags: TBD\n---\n# ${{ github.event.inputs.post_number }} $POST_DATE\n\n## TBD\n\n{ニュースなどを書く}\n\n## Apple のソフトウェアリリース情報\n\nApple が提供している OS や IDE のリリース情報です。\n\n### 正式版\n\n- [TBD](TBD)\n\n### 開発者向けベータ\n\n- [TBD](TBD)\n\n## OSS のリリース情報\n\niOS アプリ開発でよく使われている OSS のリリース情報です。\n\n### Apple\n\n#### TBD\n\n[TBD](TBD)\n\nTBD\n\n### サードパーティ\n\n#### TBD\n\n[TBD](TBD)\n\nTBD" > $POST_FILE
echo -e "---\ndate: $POST_DATE 09:00\ndescription: TBD\n---\n# ${{ github.event.inputs.post_number }} $POST_DATE\n\n## TBD\n\n{ニュースなどを書く}\n\n## Apple のソフトウェアリリース情報\n\nApple が提供している OS や IDE のリリース情報です。\n\n### 正式版\n\n- [TBD](TBD)\n\n### 開発者向けベータ\n\n- [TBD](TBD)\n\n## OSS のリリース情報\n\niOS アプリ開発でよく使われている OSS のリリース情報です。\n\n### Apple\n\n#### TBD\n\n[TBD](TBD)\n\nTBD\n\n### サードパーティ\n\n#### TBD\n\n[TBD](TBD)\n\nTBD" > $POST_FILE
git add $POST_FILE
git commit -m "Create $POST_FILENAME"
git push origin ${{ steps.create_work_branch.outputs.work_branch_name }}
Expand Down
31 changes: 0 additions & 31 deletions Resources/IosOsushiTheme/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -104,30 +104,6 @@ a {
margin-bottom: 0;
}

.tag-list {
margin-bottom: 10px;
}

.tag-list li,
.tag {
display: inline-block;
background-color: #000;
color: #ddd;
padding: 4px 6px;
border-radius: 5px;
margin-right: 5px;
margin-bottom: 5px;
}

.tag-list a,
.tag a {
text-decoration: none;
}

.item-page .tag-list {
display: inline-block;
}

.content {
margin-bottom: 40px;
overflow-wrap: break-word;
Expand Down Expand Up @@ -158,13 +134,6 @@ a {
margin-bottom: 30px;
}

.all-tags li {
font-size: 1.4em;
margin-right: 10px;
margin-bottom: 10px;
padding: 6px 10px;
}

footer {
color: #8a8a8a;
}
Expand Down
62 changes: 2 additions & 60 deletions Sources/IosOsushiWebsite/Theme+IosOsushi.swift
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,6 @@ private struct IosOsushiHTMLFactory<Site: Website>: HTMLFactory {
}
.class("share-buttons")
Div(item.content.body).class("content")
Span("タグ: ")
ItemTagList(item: item, site: context.site)
}
}
SiteFooter()
Expand All @@ -97,54 +95,11 @@ private struct IosOsushiHTMLFactory<Site: Website>: HTMLFactory {
}

func makeTagListHTML(for page: TagListPage, context: PublishingContext<Site>) throws -> HTML? {
HTML(
.lang(context.site.language),
.head(for: page, on: context.site),
.body {
SiteHeader(context: context, selectedSelectionID: nil)
Wrapper {
H1("すべてのタグ")
List(page.tags.sorted()) { tag in
ListItem {
Link(tag.string, url: context.site.path(for: tag).absoluteString)
}
.class("tag")
}
.class("all-tags")
}
SiteFooter()
}
)
nil
}

func makeTagDetailsHTML(for page: TagDetailsPage, context: PublishingContext<Site>) throws -> HTML? {
HTML(
.lang(context.site.language),
.head(for: page, on: context.site),
.body {
SiteHeader(context: context, selectedSelectionID: nil)
Wrapper {
H1 {
Text("タグ: ")
Span(page.tag.string).class("tag")
}

Link("すべてのタグを見る", url: context.site.tagListPath.absoluteString
)
.class("browse-all")

ItemList(
items: context.items(
taggedWith: page.tag,
sortedBy: \.date,
order: .descending
),
site: context.site
)
}
SiteFooter()
}
)
nil
}

private struct TweetButton<Site: Website>: Component {
Expand Down Expand Up @@ -225,26 +180,13 @@ private struct ItemList<Site: Website>: Component {
List(items) { item in
Article {
H1(Link(item.title, url: item.path.absoluteString))
ItemTagList(item: item, site: site)
Paragraph(item.description)
}
}
.class("item-list")
}
}

private struct ItemTagList<Site: Website>: Component {
var item: Item<Site>
var site: Site

var body: Component {
List(item.tags) { tag in
Link(tag.string, url: site.path(for: tag).absoluteString)
}
.class("tag-list")
}
}

private struct SiteFooter: Component {
var body: Component {
Footer {
Expand Down

0 comments on commit e0e4787

Please sign in to comment.