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 75d61e7
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 6 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ Adapted from [tailwind-astro-starting-blog](https://github.com/wanoo21/tailwind-
- For post titles, try to use the cover image as a dimmed background for the title.
- Restore OG meta data.
- Configure related posts.
- Once live, check the comment system.
- Restore the estimated reading time feature.
- Implement a service worker strategy.
- Use local avatar instead of gravatar.
Expand Down
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 75d61e7

Please sign in to comment.