Newsletter
Join the Community
Subscribe to our newsletter for the latest news and updates
Jekyll plugin to retrieve content from any Strapi API.
jekyll-strapi-4 is a Jekyll plugin that pulls content from a Strapi 4 API and generates static pages from the response. It works as a Ruby gem that you add to your Jekyll site, reads collection definitions from _config.yml, and exposes the fetched data to Liquid templates as the strapi variable.
jekyll-strapi-4 is a Jekyll plugin specifically built for Strapi 4, serving as the successor to the older jekyll-strapi plugin which targeted Strapi 3. It takes your Strapi API endpoint and collection configuration, fetches content during the Jekyll build, and outputs static HTML pages based on permalinks and layouts you define. The plugin is distributed as a Ruby gem named "jekyll-strapi-4", so you install it through a Gemfile and enable it in the plugins list of your _config.yml.
STRAPI_TOKEN environment variable to access non-public collections, and the docs recommend using Strapi Content API tokens for this purpose./image/:slug in English, /imagen/:slug in Spanish, and /zdjecie/:slug in Polish).asset_url filter downloads media from Strapi into the local assets folder and returns a local URL, so the built site does not depend on the Strapi server for images and files.sort, pagination[pageSize], and populate directly in the config; you can also add custom logic via a custom_path_params method in a _plugins file.single_request: true to fetch an entire collection in one HTTP request instead of one request per item, which suits small collections like testimonials./imagen/naranja in Spanish and /zdjecie/pomarancza in Polish from the same Strapi content.asset_url filter, so images and files work even if the API is unavailable after the build.First, add the gem to your Gemfile and add jekyll-strapi-4 to the plugins list in _config.yml. Then define one or more collections under the strapi key, specifying the API endpoint, permalink pattern, layout file, and any request parameters. During the Jekyll build, the plugin fetches the collections from Strapi, passes them to Liquid templates via strapi.collections, and generates output files based on the permalinks and layouts.
Add gem 'jekyll-strapi-4' to your Gemfile, then add jekyll-strapi-4 to the plugins list in _config.yml. After that you can start defining collections and using the strapi template variable.
The STRAPI_TOKEN environment variable holds an API token that lets the plugin access non-public Strapi collections. For Strapi 4, the recommended approach is to use the new Content API tokens.
Yes. Each collection under strapi.collections can have its own permalink, layout, parameters, and even localized permalink patterns, so you can render different content types with different templates.
Yes. You can define a default permalink and then add a permalinks map with locale-specific patterns, as shown in the README for English, Spanish, and Polish routes.
The asset_url filter downloads the asset into your local assets folder and returns a local URL. This means the built site serves images from your Jekyll output rather than relying on the Strapi server at runtime.
