Next js Blog Boilerplate with Tailwind CSS
Clone this project and use it to create your own Next.js blog. You can check a Next js blog templates demo.
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:
-
🔥 Next.js for Static Site Generator -
🎨 Integrate with Tailwind CSS -
💅 PostCSS for processing Tailwind CSS -
🎉 Type checking TypeScript -
✏️ Linter with ESLint -
🛠 Code Formatter with Prettier -
🦊 SEO metadata, JSON-LD and Open Graph tags with Next SEO -
⚙️ Bundler Analyzer
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
Nextjs Themes)
Premium Themes (Blue Dark Nextjs Theme | Blue Eclatant Nextjs Theme |
---|---|
Blue Modern Nextjs Theme | Blue Minimalist Nextjs Theme |
---|---|
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
andpublic/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 logosrc/styles/main.css
: your blog CSS file using Tailwind CSSsrc/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:
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 © 2020
See LICENSE for more information.
Made with
Doesn't work with Yarn and Next.js 12.0.7
After cloning the project, I ran:
When loaded the app page in Chrome, the console output:
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-nextjsSo far it looks like if you use the Deploy to Netlify Button to deploy the project, it will fail:
Deploy Log
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!
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
Bump ini from 1.3.5 to 1.3.8 [Dependencies updated manually, not needed anymore]
Bumps ini from 1.3.5 to 1.3.8.
Commits
a2c5da8
1.3.8af5c6bb
Do not use Object.create(null)8b648a1
don't test where our devdeps don't even workc74c8af
1.3.7024b8b5
update deps, add linting032fbaf
Use Object.create(null) to avoid default object property hazards2da9039
1.3.6cfea636
better git push script, before publish instead of after56d2805
do not allow invalid hazardous string as section nameMaintainer changes
This version was pushed to npm by isaacs, a new releaser for ini since your current version.
Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting
@dependabot rebase
.Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
@dependabot rebase
will rebase this PR@dependabot recreate
will recreate this PR, overwriting any edits that have been made to it@dependabot merge
will merge this PR after your CI passes on it@dependabot squash and merge
will squash and merge this PR after your CI passes on it@dependabot cancel merge
will cancel a previously requested merge and block automerging@dependabot reopen
will reopen this PR if it is closed@dependabot close
will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually@dependabot ignore this major version
will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)@dependabot ignore this minor version
will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)@dependabot ignore this dependency
will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)@dependabot use these labels
will set the current labels as the default for future PRs for this repo and language@dependabot use these reviewers
will set the current reviewers as the default for future PRs for this repo and language@dependabot use these assignees
will set the current assignees as the default for future PRs for this repo and language@dependabot use this milestone
will set the current milestone as the default for future PRs for this repo and languageYou can disable automated security fix PRs for this repo from the Security Alerts page.
Bump next from 9.5.3 to 9.5.4 [Dependencies updated manually, not needed anymore]
Bumps next from 9.5.3 to 9.5.4.
Release notes
Sourced from next's releases.
... (truncated)
Commits
6588108
v9.5.47108567
v9.5.4-canary.255d79a8c
Update workflow step to restore cache (#17656)4c38e3e
fix typo (#17653)241f38e
v9.5.4-canary.247dec911
change anonymous functions to named in docs examples (#17510)1659e4d
Update migrating from Gatsby docs. (#17636)06a8b1a
Add docs on how to migrate from Gatsby. (#17491)04234cc
Update to use hasNextSupport for custom-routes in next export check (#17630)742f5d9
test(create-next-app): increase coverage (#17507)Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting
@dependabot rebase
.Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
@dependabot rebase
will rebase this PR@dependabot recreate
will recreate this PR, overwriting any edits that have been made to it@dependabot merge
will merge this PR after your CI passes on it@dependabot squash and merge
will squash and merge this PR after your CI passes on it@dependabot cancel merge
will cancel a previously requested merge and block automerging@dependabot reopen
will reopen this PR if it is closed@dependabot close
will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually@dependabot ignore this major version
will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)@dependabot ignore this minor version
will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)@dependabot ignore this dependency
will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)@dependabot use these labels
will set the current labels as the default for future PRs for this repo and language@dependabot use these reviewers
will set the current reviewers as the default for future PRs for this repo and language@dependabot use these assignees
will set the current assignees as the default for future PRs for this repo and language@dependabot use this milestone
will set the current milestone as the default for future PRs for this repo and languageYou can disable automated security fix PRs for this repo from the Security Alerts page.