GithubHelp home page GithubHelp logo

ixartz / next-js-blog-boilerplate Goto Github PK

View Code? Open in Web Editor NEW
617.0 13.0 162.0 1.01 MB

๐Ÿš€ Nextjs Blog Boilerplate is starter code for your blog based on Next framework. โšก๏ธ Made with Nextjs 12, TypeScript, ESLint, Prettier, PostCSS, Tailwind CSS 3.

Home Page: https://creativedesignsguru.com

License: MIT License

JavaScript 8.27% TypeScript 79.85% CSS 11.27% Shell 0.61%
nextjs next-theme next-js nextjs-starter starter starter-kit starter-template starter-project boilerplate boilerplate-front-end

next-js-blog-boilerplate's Introduction

Next js Blog Boilerplate with Tailwind CSS Twitter

Nextjs starter banner

๐Ÿš€ Next.js Blog Boilerplate is starter code for your blog based on Next.js 12+ framework with Tailwind CSS 3.0. โšก๏ธ Made with Next.js, TypeScript, ESLint, Prettier, PostCSS, Tailwind CSS.

Clone this project and use it to create your own Next.js blog. You can check a Next js blog templates demo.

Sponsors

Sentry Codecov Better Stack React SaaS Boilerplate Next.js
Clerk โ€“ Authentication & User Management for Next.js SQLite Developer Experience Crowdin
Add your logo here

Features

Blog feature:

  • ๐ŸŽˆ Syntax Highlighting with Prism.js
  • ๐Ÿค– SEO metadata and Open Graph tags
  • โš™๏ธ JSON-LD for richer indexing
  • ๐Ÿ“– Pagination
  • ๐ŸŒˆ Include a FREE minimalist blog theme
  • โฌ‡๏ธ Markdown
  • ๐Ÿ’ฏ Maximize lighthouse score

Developer experience first:

Built-in feature from Next.js:

  • โ˜• Minify HTML & CSS
  • ๐Ÿ’จ Live reload
  • โœ… Cache busting

Philosophy

  • Minimal code
  • SEO-friendly
  • ๐Ÿš€ Production-ready

Requirements

  • Node.js and npm

Sponsors

React SaaS Boilerplate Next.js

Getting started

Run the following command on your local environment:

git clone --depth=1 https://github.com/ixartz/Next-js-Blog-Boilerplate.git my-project-name
cd my-project-name
npm install

Then, you can run locally in development mode with live reload:

npm run dev

Open http://localhost:3000 with your favorite browser to see your project.

.
โ”œโ”€โ”€ _posts            # Your blog posts
โ”œโ”€โ”€ public            # Static files
โ”‚   โ”œโ”€โ”€ assets
โ”‚   โ”‚   โ””โ”€โ”€ images
โ”‚   โ”‚       โ””โ”€โ”€ posts # Images used in your blog posts
โ””โ”€โ”€ src
    โ”œโ”€โ”€ pages         # Next.js pages
    โ”œโ”€โ”€ styles        # Your blog CSS files
    โ””โ”€โ”€ templates     # Blog templates

Customization

You can easily configure Next js Boilerplate. Please change the following file:

  • public/apple-touch-icon.png, public/favicon.ico, public/favicon-16x16.png and public/favicon-32x32.png: your blog favicon, you can generate from https://favicon.io/favicon-converter/
  • public/assets/images/logo.png, public/assets/images/logo-32x32.png: your blog logo
  • src/styles/main.css: your blog CSS file using Tailwind CSS
  • src/utils/Config.ts: configuration file like blog name, url, etc.
  • src/templates/Main.tsx: blog theme

Deploy to production

You can see the results locally in production mode with:

$ npm run build
$ npm run start

The generated HTML and CSS files are minified (built-in feature from Next js). It will also removed unused CSS from Tailwind CSS.

You can create an optimized production build with:

npm run build-prod

Now, your blog is ready to be deployed. All generated files are located at dist folder, which you can deploy with any hosting service.

Deploy to Netlify

Clone this repository on own GitHub account and deploy to Netlify:

Netlify Deploy button

Contributions

Everyone is welcome to contribute to this project. Feel free to open an issue if you have question or found a bug.

License

Licensed under the MIT License, Copyright ยฉ 2022

See LICENSE for more information.

Sponsors

Sentry Codecov Better Stack React SaaS Boilerplate Next.js
Clerk โ€“ Authentication & User Management for Next.js SQLite Developer Experience Crowdin
Add your logo here

Made with โ™ฅ by CreativeDesignsGuru Twitter

Sponsor Next JS Boilerplate

next-js-blog-boilerplate's People

Contributors

ikhattab avatar ivanskodje avatar ixartz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

next-js-blog-boilerplate's Issues

TypeError: Cannot read property 'theme' of undefined after first start

git clone --depth=1 https://github.com/ixartz/Next-js-Blog-Boilerplate.git website-next-js
cd website-next-js/
yarn
yarn run dev

results in:

yarn run v1.22.10 $ next ready - started server on 0.0.0.0:3000, url: http://localhost:3000 info - Using webpack 5. Reason: future.webpack5 option enabled https://nextjs.org/docs/messages/webpack5 error - ./node_modules/next/dist/compiled/css-loader/cjs.js??ruleSet[1].rules[2].oneOf[6].use[1]!./node_modules/next/dist/compiled/postcss-loader/cjs.js??ruleSet[1].rules[2].oneOf[6].use[2]!./src/styles/main.css TypeError: Cannot read property 'theme' of undefined

Update the publish directory for netlify.toml

Howdy there!

Looks like you're using Next v12. With Next on Netlify, we need to modify where we're setting the output directory too. I think you can actually remove it from there all together and default to using .next. See here for the source https://github.com/netlify/netlify-plugin-nextjs

So far it looks like if you use the Deploy to Netlify Button to deploy the project, it will fail:

Deploy Log
9:35:26 AM: โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
9:35:26 AM:   Plugin "@netlify/plugin-nextjs" failed                        
9:35:26 AM: โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
9:35:26 AM: โ€‹
9:35:26 AM:   Error message
9:35:26 AM:   Error: The directory "out" does not contain a Next.js production build. Perhaps the build command was not run, or you specified the wrong publish directory.
9:35:26 AM:   Your publish directory is set to "out", but in most cases it should be ".next".
9:35:26 AM:   If you are using "next export" then you should set the environment variable NETLIFY_NEXT_PLUGIN_SKIP to "true".
9:35:26 AM: โ€‹
9:35:26 AM:   Plugin details
9:35:26 AM:   Package:        @netlify/plugin-nextjs
9:35:26 AM:   Version:        4.2.4
9:35:26 AM:   Repository:     git+https://github.com/netlify/netlify-plugin-nextjs.git
9:35:26 AM:   npm link:       https://www.npmjs.com/package/@netlify/plugin-nextjs
9:35:26 AM:   Report issues:  https://github.com/netlify/netlify-plugin-nextjs/issues

If you're open to it, I think this should be a small fix but could even help out the Next-js-Boilerplate project too. I can try to open a PR for it today!

Doesn't work with Yarn and Next.js 12.0.7

After cloning the project, I ran:

yarn
yarn dev

When loaded the app page in Chrome, the console output:

error - ./node_modules/next/dist/compiled/css-loader/cjs.js??ruleSet[1].rules[2].oneOf[6].use[1]!./node_modules/next/dist/compiled/postcss-loader/cjs.js??ruleSet[1].rules[2].oneOf[6].use[2]!./src/styles/main.css
TypeError: Cannot read property 'theme' of undefined

Where to write post?

I'm really a beginner. So a bit confused. Please kindly tell me where I can write posts.

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.