Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Building a hidden Posts feature in Astro using the new Strapi v5 Drafts & Publish feature #1523

Open
1 task done
noahflk opened this issue Aug 19, 2024 · 15 comments
Open
1 task done
Assignees
Labels
Beginner Expertise In Review Article is in review

Comments

@noahflk
Copy link

noahflk commented Aug 19, 2024

What is your article idea?

This article will be a tutorial and showcase of the new Strapi V5 Drafts & Publish feature.

We will build a simple blog in Astro where you can publish hidden draft posts that aren't publicly accessible. You can use this to present upcoming blog posts to your fellow team members for review directly on your blog - before they're published.

Sections

  • Introduction
    • Show our Tech Stack: Strapi, Astro and Tailwind
    • Benefits of publishing drafts
    • Requirements (Node.js)
  • Setting up strapi
    • Initial setup
    • Content mode
    • Configure API access
  • Getting started with Astro
    • Bootstrapping project
    • Adding Tailwind, design skelleton
    • Accessing Strapi API
  • Draft support
    • Draft explanation
    • Accessing drafts through the API
    • Rendering drafts
  • Conclusion

What are the objectives of your article?

Promoting the Strapi v5 Release with the new Drafts & Publish feature and show how you could use it in an Astro Strapi blog.

What is your expertise as a developer or writer?

Intermediate

What type of post is this?

Tutorial

Terms & Conditions

  • I have read the Write for the Community program guidelines.
@Theodore-Kelechukwu-Onyejiaku
Copy link
Collaborator

Hi @noahflk ,

It is great you want to use the Strapi 5 draft and publish feature but I am not sure what you mean by hidden post features. What are we building?

@noahflk
Copy link
Author

noahflk commented Aug 20, 2024

@Theodore-Kelechukwu-Onyejiaku absolutely:

The draft posts are not shown in the main list of blog posts. However, they can be accessed directly if you know the URL of the post. When viewed, they will display a badge indicating that the post is a draft.

The idea behind this is that you can easily share new draft posts with your team for internal review. They won't be publicly accessible, but you can still view them within the actual website.

@Theodore-Kelechukwu-Onyejiaku
Copy link
Collaborator

This sounds interesting! Meaning that posts that are drafts and published will be gotten using the status and published query?

Is there a better title you might suggest other than "Building a hidden posts feature in Astro..."?

Please let me know. Thank you.

@noahflk
Copy link
Author

noahflk commented Aug 21, 2024

@Theodore-Kelechukwu-Onyejiaku

This sounds interesting! Meaning that posts that are drafts and published will be gotten using the status and published query?

Yes exactly!

Is there a better title you might suggest other than "Building a hidden posts feature in Astro..."?

This sounds good to me. Should I get started?

@Theodore-Kelechukwu-Onyejiaku
Copy link
Collaborator

Please suggest a better title.

@Theodore-Kelechukwu-Onyejiaku
Copy link
Collaborator

How about "Build a note keeper with Strapi Draft and Publish"?

Or do you have a better suggestion please?

@noahflk
Copy link
Author

noahflk commented Aug 25, 2024

What about "Building a Blog Post Preview feature with Strapi Draft and Publish"

I think the blogging aspect works a bit better as an example. What do you think?

@Theodore-Kelechukwu-Onyejiaku

@Theodore-Kelechukwu-Onyejiaku
Copy link
Collaborator

Theodore-Kelechukwu-Onyejiaku commented Aug 26, 2024

Please proceed. Thank you!

Depending on the depth and effort, we will make this intermediate.

@noahflk
Copy link
Author

noahflk commented Sep 3, 2024

@Theodore-Kelechukwu-Onyejiaku
Copy link
Collaborator

Hi @noahflk ,

Thank you. Could you please provide me the following details on discord:

  • Full Name
  • Photo
  • Bio
  • Email
  • Twitter Handle

Thank you for your contribution to the "Write for the Community" program!

@Theodore-Kelechukwu-Onyejiaku Theodore-Kelechukwu-Onyejiaku added In Review Article is in review and removed In progress Tutorial being created labels Sep 26, 2024
@noahflk
Copy link
Author

noahflk commented Sep 30, 2024

@Theodore-Kelechukwu-Onyejiaku just sent it on Discord DM

@Theodore-Kelechukwu-Onyejiaku
Copy link
Collaborator

Thank you!

Just a few requests. I am hoping we can make this intermediate. How about we include Strapi customization or backend customization by introducing the new Strapi Document Service API functions:

  • count()
  • publish()
  • unpublish()
  • discardDraft()

That way, we could have these functions integrated into the app in your work. So a user can can count documents published or in draft, publish a draft, unpublish a draft and discard a draft.

Please let me know if you are willing to incorporate this.

@noahflk
Copy link
Author

noahflk commented Oct 1, 2024

Thank you @Theodore-Kelechukwu-Onyejiaku

I am happy to incorporate it.

Is this what you have in mind:

  • Each post gets a publish/unpublish/discard button?

Incorporating full-blown authentication in Astro is difficult. So I would make the user enter a secret passport to perform the action.

@Theodore-Kelechukwu-Onyejiaku
Copy link
Collaborator

Hi @noahflk ,

Yes that is what I have in mind. And this time, it should be a form of a custom controller(s) which should make use of the Document Service to call these new functions.

Please let me know if you understand. Thank you!

@noahflk
Copy link
Author

noahflk commented Oct 3, 2024

@Theodore-Kelechukwu-Onyejiaku got it, will deliver asap

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Beginner Expertise In Review Article is in review
Projects
None yet
Development

No branches or pull requests

2 participants