Skip to content

Commit 250ab6c

Browse files
committed
updated linking mechanism to be shown for projects
1 parent a568ad5 commit 250ab6c

File tree

3 files changed

+9
-8
lines changed

3 files changed

+9
-8
lines changed

src/pages/reflections/index.astro

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ allPosts = allPosts.sort((a, b) => new Date(b.frontmatter.publishDate).valueOf()
2222
<a href={href}>{post.frontmatter.title}</a>
2323
</h2>
2424
<p>{post.frontmatter.description}</p>
25-
<div class="post-item-footer">
25+
{/* <div class="post-item-footer">
2626
<span class="post-item-date">— {post.frontmatter.publishDate}</span>
27-
</div>
27+
</div> */}
2828
</div>
2929
</div>
3030
)

src/pages/work/[slug].astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ const permalink = `${Astro.site.href}blog/${slug}`;
1919

2020
<BaseLayout title={title} description={description} permalink={permalink} current="blog">
2121
<header>
22-
<p>{publishDate} ~ {readingTime}</p>
22+
<!-- <p>{publishDate} ~ {readingTime}</p> -->
2323
<h1>{title}</h1>
2424
<hr />
2525
</header>

src/pages/work/index.astro

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,21 @@ allPosts = allPosts.sort((a, b) => new Date(b.frontmatter.publishDate).valueOf()
1414
<h1>{title}</h1>
1515
<div class="flex-container">
1616
{allPosts.map((post, index) => {
17-
const href = `/work/${post.file.split('/').pop().split('.').shift()}`;
17+
const href = (post.frontmatter.direct_link && post.frontmatter.direct_link !== '') ? post.frontmatter.direct_link : `/work/${post.file.split('/').pop().split('.').shift()}`
18+
const target = (post.frontmatter.direct_link && post.frontmatter.direct_link !== '') ? '_blank' : '_self';
1819
const thumbnail = `/assets/work/${post.frontmatter.thumbnail}`;
1920
return (
2021
<article>
2122
<div class="post-item">
22-
<h2><a href={href}>{post.frontmatter.title}</a></h2>
23+
<h2><a href={href} target={target}>{post.frontmatter.title}</a></h2>
2324
<br />
24-
<a href={href}>
25+
<a href={href} target={target}>
2526
<div class="thumbnail"></div>
2627
</a>
2728
<p>{post.frontmatter.description}</p>
28-
<div class="post-item-footer">
29+
{/* <div class="post-item-footer">
2930
<span class="post-item-date">— {post.frontmatter.publishDate}</span>
30-
</div>
31+
</div> */}
3132
</div>
3233
</article>
3334
)

0 commit comments

Comments
 (0)