feat: add draft indicator for post list
This commit is contained in:
parent
ff91324a79
commit
e6816df0dc
2 changed files with 243 additions and 221 deletions
|
@ -5,7 +5,7 @@ const { posts, displayDate = false, placeholder = false } = Astro.props;
|
|||
{posts.map((post) => (
|
||||
<p>
|
||||
{displayDate && <span class="list-date">{new Date(post.data.date).toISOString().split('T')[0]}</span>}
|
||||
<a href={`/blog/${post.slug}`}>{post.data.title}</a>
|
||||
{post.data.draft && <span class="draft-badge">[draft] </span>}<a href={`/blog/${post.slug}`}>{post.data.title}</a>
|
||||
</p>
|
||||
))}
|
||||
|
||||
|
|
|
@ -14,6 +14,7 @@
|
|||
--terminal-red: #bf616a;
|
||||
--font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, "SF Mono", Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
|
||||
}
|
||||
|
||||
/* Light theme */
|
||||
@media (prefers-color-scheme: light) {
|
||||
:root:not([data-theme="dark"]) {
|
||||
|
@ -29,6 +30,7 @@
|
|||
--terminal-red: #bf616a;
|
||||
}
|
||||
}
|
||||
|
||||
/* Light theme override (for switch) */
|
||||
:root[data-theme="light"] {
|
||||
--bg-color: #eceff4;
|
||||
|
@ -116,9 +118,11 @@ body {
|
|||
content: "./";
|
||||
opacity: 0.7;
|
||||
}
|
||||
|
||||
.nav a.home::before {
|
||||
content: "";
|
||||
}
|
||||
|
||||
.cursor {
|
||||
display: inline-block;
|
||||
width: 0.6em;
|
||||
|
@ -129,8 +133,12 @@ body {
|
|||
}
|
||||
|
||||
@keyframes blink {
|
||||
from, to { opacity: 1; }
|
||||
50% { opacity: 0; }
|
||||
from, to {
|
||||
opacity: 1;
|
||||
}
|
||||
50% {
|
||||
opacity: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.footer {
|
||||
|
@ -171,6 +179,7 @@ body {
|
|||
background: var(--accent-color);
|
||||
color: var(--bg-color);
|
||||
}
|
||||
|
||||
/* Theme Switcher */
|
||||
.theme-switcher {
|
||||
background: var(--border-color);
|
||||
|
@ -194,8 +203,10 @@ h1.title {
|
|||
font-weight: bold;
|
||||
margin-bottom: 0.5rem;
|
||||
}
|
||||
|
||||
div.content {
|
||||
margin: 1rem auto;
|
||||
|
||||
span.date {
|
||||
color: var(--secondary-text-color);
|
||||
font-size: 0.9rem;
|
||||
|
@ -203,6 +214,7 @@ div.content {
|
|||
margin-bottom: 1.5rem;
|
||||
display: block;
|
||||
}
|
||||
|
||||
span.list-date {
|
||||
color: var(--secondary-text-color);
|
||||
font-size: 0.9rem;
|
||||
|
@ -210,14 +222,21 @@ div.content {
|
|||
margin-bottom: 1.5rem;
|
||||
}
|
||||
|
||||
span.draft-badge {
|
||||
color: var(--secondary-text-color);
|
||||
font-weight: 300;
|
||||
}
|
||||
|
||||
ul, ol, li {
|
||||
list-style-position: inside;
|
||||
}
|
||||
|
||||
ul {
|
||||
padding-left: 20px;
|
||||
margin-top: 0.5em;
|
||||
margin-bottom: 1em;
|
||||
}
|
||||
|
||||
ul li {
|
||||
padding-left: 0.5em;
|
||||
margin-bottom: 0.5em;
|
||||
|
@ -228,7 +247,9 @@ div.content {
|
|||
padding: 1rem;
|
||||
margin: 1rem auto;
|
||||
}
|
||||
|
||||
/* Highlighted Code Blocks */
|
||||
|
||||
pre.astro-code,
|
||||
pre.astro-code span {
|
||||
background-color: #3b4252 !important;
|
||||
|
@ -264,6 +285,7 @@ div.content {
|
|||
}
|
||||
|
||||
/* Responsive Images */
|
||||
|
||||
img {
|
||||
max-width: 100%;
|
||||
height: 100%;
|
||||
|
@ -271,7 +293,6 @@ div.content {
|
|||
}
|
||||
|
||||
|
||||
|
||||
/* Terminal Commands */
|
||||
.command {
|
||||
color: var(--terminal-green);
|
||||
|
@ -290,6 +311,7 @@ div.content {
|
|||
transition-duration: .7s;
|
||||
transition-timing-function: cubic-bezier(.4, 0, 1, 1);
|
||||
}
|
||||
|
||||
.fade-out {
|
||||
opacity: 0;
|
||||
transition-property: opacity;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue