This is an example project for Astro 5 and Strapi 5. It is a simple project that uses Astro 5 and Strapi 5 to create a website with a landing page, a blog, and a contact form.
Uses the new strapi-community-astro-loader-v2 to fetch data from Strapi for pages and articles.
(contact form not implemented yet)
- Clone the repository
In the root directory, run:
git clone https://github.com/PaulBratslavsky/astro-strapi-example-project.git- Install the dependencies
In the root directory, run:
yarn setupTo seed the database, run:
yarn seedAnd do start both the Astro client and the Strapi server:
yarn devThe project is structured as follows:
client: The Astro clientserver: The Strapi server
The client directory contains the Astro client and the server directory contains the Strapi server.
The home page is the main page of the website. It is the first page that loads when the user navigates to the website.
The content is structured in blocks. Each block is a component that is responsible for rendering a specific section of the page and all the data is fetched from Strapi from our landing page content type.
The dynamic page is a page that is rendered from a Strapi and consist of blocks similar to the home page.
This allow a none-technical user to create a new page by just adding and rearranging the blocks.
In this example we are just rendering the person block.
The blog page pulls all the posts from the blog content type and displays them in a paginated list which is handled by Astro.
The blog page is rendered from the blog page content type.
The article page is a page that is rendered from a Strapi and consist of blocks similar to the home page plus additional fields like featured image, tags, and author.
The article page is rendered from the article content type.
The global page is responsible for the header and footer content of the website.
The global page is rendered from the global content type.
Thank you for checking out this example project. I hope you find it useful.
If you have any questions or suggestions, please feel free to post an issue on the GitHub repository.
All the best,
Paul
Socials:











