Skip to content

Commit

Permalink
Fix the draft system 🔧.
Browse files Browse the repository at this point in the history
  • Loading branch information
gmarty committed Mar 30, 2024
1 parent 60a0b0e commit fe657d6
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/functions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ export const sortBlogPosts = (
* @returns True if the post is not a draft
*/
export const excludeDrafts = ({ data }: CollectionEntry<'blog'>): boolean =>
import.meta.env.PROD ? true : !data.draft
import.meta.env.DEV ? true : !data.draft
4 changes: 2 additions & 2 deletions src/layouts/PostLayout.astro
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,8 @@ const { Content, headings } = await post.render()
<div class="xl:col-span-3 xl:row-span-2 xl:pb-0">
{
post.data.draft && (
<div class="bg-yellow-50 border-l-4 border-yellow-400 p-4 dark:bg-yellow-500 dark:border-yellow-300 mt-10">
<p class="leading-5 text-yellow-700 dark:text-yellow-300">
<div class="bg-yellow-100 dark:bg-yellow-900 border-yellow-400 dark:border-yellow-600 border-l-4 p-4 mt-10">
<p class="text-yellow-700 dark:text-yellow-300">
{t('layouts.postLayout.draftMessage')}
</p>
</div>
Expand Down
4 changes: 2 additions & 2 deletions src/layouts/SimplePostLayout.astro
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ const { Content, headings } = await post.render()
>
{
post.data.draft && (
<div class="bg-yellow-50 border-l-4 border-yellow-400 p-4 dark:bg-yellow-500 dark:border-yellow-300 mt-10">
<p class="leading-5 text-yellow-700 dark:text-yellow-300">
<div class="bg-yellow-100 dark:bg-yellow-900 border-yellow-400 dark:border-yellow-600 border-l-4 p-4 mt-10">
<p class="text-yellow-700 dark:text-yellow-300">
{t('layouts.postLayout.draftMessage')}
</p>
</div>
Expand Down

0 comments on commit fe657d6

Please sign in to comment.