@oceansoft/strapi-template-blog

2.2.2 • Public • Published

Strapi Template >> Blog

Strapi is an open-source Node.js Headless CMS with a fully customizable API that lets you develop practical, production-ready Node.js APIs in hours instead of weeks.

🎯 Strapi V4 Headless-CMS Template for creating Blog CMS Backend, such as Education, Agency, Beauty, Medical, News, Personal, and Science.

Usage

Step 1: Install Strapi Backend

yarn create strapi-app backend --template @oceansoft/strapi-template-blog
  • When the installation is complete, Strapi's administration panel will open in your browser, and you can register a user and get started creating content.

Step 2: Installing Gatsby plugins & Enter Access Credentials

  • After installing Strapi, you need to install the Gatsby plugin.

    cd ../frontend
    # yarn add gatsby-source-strapi
    

Auto-generated Access Credentials

  • If you are working on local development, create a .env file and paste your Strapi credentials in it.

  • ☑️ To deploy your application in production, you need to add the environment variables to your deployment platform provider.

    echo "Move backend/frontend.env.development to frontend/.env"
    mv ../backend/frontend.env.development .env
    # cat frontend/.env
    

    frontend/.env

    STRAPI_API_URL=Your_Strapi_Server_URL
    STRAPI_TOKEN=Your_Strapi_API_Token
    

Step 3: Register Strapi CMS plugin

frontend/gatsby-config.js

require('dotenv').config()

module.exports = {
  plugins: [
    {
      resolve: 'gatsby-source-strapi',
      options: {
        apiURL: process.env.STRAPI_API_URL || 'http://localhost:1337',
        accessToken: process.env.STRAPI_TOKEN,
        collectionTypes: ['article', 'category', 'author'],
        queryLimit: 1000
      }
    },
    {
      /** ATTENTION: Match the theme name with the theme you're using */
      resolve: '@oceansoft/gatsby-blog-education',
      options: {
        sources: {
          strapi: true,
          local: false
        }
      }
    }
  ]
}

Step 4.

  • Every time you modify gatsby-config.js file, you need to clean the cache:

    yarn clean

  • That’s it! You can now start gatsby dev server to see your content from Strapi.

    yarn develop

Step 5 (Optional): Automate Re-building

If you’re planning to deploy your site to AWS, Netlify or Vercel, you can automate deployments by configuring webhooks to trigger a site rebuild when content is modified in your Strapi panel.

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
2.2.26latest

Version History

VersionDownloads (Last 7 Days)Published
2.2.26
2.2.11
2.2.01
2.1.90
2.1.80
2.1.70
2.1.60
2.1.51
2.1.40
2.1.30
2.1.20
2.1.10
2.1.00
2.0.90
2.0.81
2.0.70
2.0.60
2.0.50
2.0.40
2.0.30
2.0.20
2.0.10
2.0.00
1.2.50
1.2.30
1.2.20
1.2.10
1.2.01
1.1.20
1.1.11
1.1.00
1.0.80
1.0.71
1.0.60
1.0.51
1.0.40
1.0.30
1.0.20
1.0.10
1.0.00

Package Sidebar

Install

npm i @oceansoft/strapi-template-blog

Weekly Downloads

14

Version

2.2.2

License

MIT

Unpacked Size

1.16 MB

Total Files

36

Last publish

Collaborators

  • nnthanh101