Giter Site home page Giter Site logo

nextjs-netlify-blog-template2's Introduction

Next.js blogging template for Netlify

Netlify Status MADE BY Next.js

Next.js blogging template for Netlify is a boilerplate for building blogs with only Netlify stacks.

There are some boilerplate or tutorials for the combination of Next.js and Netlify on GitHub. These resources have documentation and good tutorial to get started Next.js and Netlify quickly, but they are too simple to build blogs with standard features like tagging.

Next.js blogging template for Netlify has already implemented these standard features for building blogs with only using Next.js and Netlify stacks.

Demo

Deploy on your environment by clicking here:

Deploy to Netlify

Or access the following demo site:

Next.js blog template for Netlify

Features

  • Tagging: organizes content by tags
  • Author: displays author names who write a post
  • Pagination: limits the number of posts per page
  • CMS: built with CMS to allow editors modifying content with the quickest way
  • SEO optimized: built-in metadata like JSON-LD
  • Shortcode: extends content writing with React component like WordPress shortcodes

Dependencies

Getting started

To create your blog using the template, open your terminal, cd into the directory you'd like to create the app in, and run the following command:

npx create-next-app your-blog --example "https://github.com/wutali/nextjs-netlify-blog-template"

After that, set up your project as following the Netlify blog:

A Step-by-Step Guide: Deploying on Netlify

Customization

This template is just a template and a boilerplate in which users can customize anything after the project was cloned and started. The following instructions introduce common customization points like adding new metadata or applying a new design theme.

Styling pages by a customized theme

All source codes related to the blog are under components and pages directory. You can modify it freely if you want to apply your design theme. All components use styled-jsx and css-modules to define their styles, but you can choose any styling libraries for designing your theme.

The directory tree containing the blog source code are described below:

meta: yaml files defining metadata like authors or tags
public: images, favicons and other static assets
src
├── assets: other assets using inside of components
├── components: pieces of components consisting of pages
├── content: mdx files for each post page
├── lib: project libraries like data fetching or pagination
└── pages: page components managing by Next.js

Organizing content by categories

The category metadata that associates with content have the same relationship with the authors' one. Then reference these implementations for adding new metadata:

You understood they have four steps to add the category metadata on your project after you read the above source codes:

  1. Define the category metadata on the above Netlify config file
  2. Create an empty file named with categories.yml under meta directory
  3. Create a new module for fetching category metadata
  4. Display the category metadata on src/components/PostLayout.tsx or other components you want

It is all you have to do. After that, you can access Netlify CMS and create new categories at any time.

Locale settings for Netlify CMS

Modify config.yml and index.html under public/admin directory as following instructions:

Netlify CMS - Configuration Options #Locale

References

License

MIT

nextjs-netlify-blog-template2's People

Contributors

erezrokah avatar mrkwse avatar rnhsnd avatar silkie-chicken avatar wutali avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.