Skip to content

Commit 5d6a6d6

Browse files
committed
new tdsehub
1 parent 852deb8 commit 5d6a6d6

82 files changed

Lines changed: 616 additions & 453 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

lasso/src/components/Blog/blog.tsx

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
import React from 'react';
2+
import Heading from '@theme/Heading';
3+
import clsx from 'clsx';
4+
5+
export default function RecentPosts({ recentPosts }) {
6+
return (
7+
<section>
8+
<div className="container padding--sm">
9+
<div className="text--center margin-bottom--lg">
10+
<Heading as="h2">Recent Blog Posts</Heading>
11+
</div>
12+
<div className="recent-post-list">
13+
{recentPosts.items.slice(0, 3).map((item, index) => (
14+
<a
15+
key={index}
16+
href={item.permalink}
17+
className="card shadow--md recent-post-list-item"
18+
>
19+
<div className="card__body">
20+
<span className="recent-post-date">
21+
{item.date && new Date(item.date).toLocaleDateString()}
22+
</span>
23+
<h3 className="card__title">{item.title}</h3>
24+
{item.description && (
25+
<p className="margin-vert--xs">{item.description}</p>
26+
)}
27+
</div>
28+
</a>
29+
))}
30+
</div>
31+
</div>
32+
<style>
33+
{`
34+
.recent-post-list {
35+
display: flex;
36+
flex-direction: column;
37+
gap: 1.5rem;
38+
}
39+
40+
.recent-post-list-item {
41+
transition: box-shadow 0.2s, transform 0.2s;
42+
text-decoration: none;
43+
color: inherit;
44+
border-left: 4px solid var(--ifm-color-primary);
45+
padding-left: 0.5rem;
46+
}
47+
48+
.recent-post-list-item:hover {
49+
box-shadow: 0 4px 24px 0 rgba(0,0,0,0.15);
50+
transform: translateY(-2px) scale(1.01);
51+
background: var(--ifm-color-emphasis-100);
52+
color: var(--ifm-link-color);
53+
text-decoration: none;
54+
}
55+
56+
.recent-post-date {
57+
font-size: 0.85em;
58+
color: var(--ifm-color-secondary-darkest);
59+
margin-bottom: 0.3em;
60+
display: block;
61+
}
62+
`}
63+
</style>
64+
65+
<br/>
66+
</section>
67+
);
68+
}

0 commit comments

Comments
 (0)