Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for tags to blog posts #503

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion _layouts/post.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,17 @@
<article class="post">
<header>
<h1>{{ page.title }}</h1>
<div class="subtitle">
<time pubdate datetime="{{ page.date | date_to_xmlschema }}">
{{ page.date | date: "%B %-d, %Y" }}
</time>

<time pubdate datetime="{{ page.date | date_to_xmlschema }}">{{ page.date | date: "%B %-d, %Y" }}</time>
<div class="tags">
{% for tag in page.tag %}
<div class="tag"><span>{{ tag }}</span></div>
{% endfor %}
</div>
</div>
{% include authors.html authors=page.author compact=true %}
</header>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ published: true
date: 2024-03-12 10:00:00
title: "Byte-sized Swift: Building Tiny Games for the Playdate"
author: [rauhul]
tag: [embedded]
---

I'm excited to share [swift-playdate-examples](https://github.com/apple/swift-playdate-examples), a technical demonstration of using Swift to build games for [Playdate](https://play.date/), a handheld game system by [Panic](https://panic.com).
Expand Down
1 change: 1 addition & 0 deletions _posts/2024-04-03-embedded-swift-examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ published: true
date: 2024-04-03 10:00:00
title: "Get Started with Embedded Swift on ARM and RISC-V Microcontrollers"
author: [kubamracek]
tag: [embedded]
---

We're pleased to introduce a [repository of example projects](https://github.com/apple/swift-embedded-examples) that demonstrate how Embedded Swift can be used to develop software on a range of microcontrollers.
Expand Down
48 changes: 34 additions & 14 deletions assets/stylesheets/_screen.scss
Original file line number Diff line number Diff line change
Expand Up @@ -570,21 +570,41 @@ article {
padding-top: 0em;
}

time {
display: block;
text-transform: uppercase;
font-size: 14px;
font-weight: 400;
color: var(--color-figure-gray-tertiary);
margin-right: 3em;
margin-bottom: 1.25em;
}
.subtitle {
display: flex;
justify-content: space-between;
margin-bottom: 1em;

.tags {
display: block;
font-size: 12px;
font-weight: 400;
margin-top: 0;
time {
flex-shrink: 0;
margin-top: 0.2em + 0.15em;
text-transform: uppercase;
font-size: 0.8em;
font-weight: 400;
color: var(--color-figure-gray-tertiary);
}

.tags {
display: flex;
flex-direction: row;
/* Allow tags to wrap to additional lines */
flex-wrap: wrap;
/* Add a small gap between additional lines */
gap: 0.4em;
/* Align to trailing edge */
justify-content: flex-end;
Comment on lines +589 to +595
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can remove these comments as they do not add additional insight that the styles aren't already telling.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We also need to add a media query to improve the mobile layout. My vote would be to put the tags below the date label to accommodate larger accessibility font sizes.
scht

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rauhul If you want I can push these changes after getting this merged to unblock this.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure! I dont think I'll have time for a while to address these css changes.

Excuse the crude markup, but I was hoping on laying out the tags like this:
Screenshot 2024-09-17 at 3 41 13 PM


.tag {
text-transform: uppercase;
font-size: 0.8em;
font-weight: 400;
margin-left: 0.5em; /* Adjust margin as needed for spacing between tags */
color: var(--color-figure-gray-tertiary);
border: 0.15em solid var(--color-nav-rule);
border-radius: 0.5rem;
padding: 0.15em 0.4em;
}
}
}
}

Expand Down
12 changes: 11 additions & 1 deletion blog/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,17 @@
<article id="{{ post.id }}" class="summary">
<header>
<h2 class="title"><a href="{{ post.url }}">{{ post.title }}</a></h2>
<time pubdate datetime="{{ post.date | date_to_xmlschema }}">{{ post.date | date: "%B %-d, %Y" }}</time>
<div class="subtitle">
<time pubdate datetime="{{ post.date | date_to_xmlschema }}">
{{ post.date | date: "%B %-d, %Y" }}
</time>

<div class="tags">
{% for tag in post.tag %}
<div class="tag"><span>{{ tag }}</span></div>
{% endfor %}
</div>
</div>
</header>
<section class="excerpt">
{{ post.excerpt }}
Expand Down