Dark themed, SEO friendly: Nuxt Content + TailwindCSS + Firebase + i18n based SPA for procrastinating developers to quickly spin up their own kickass blog and showcase their projects.
Visit: template.karngyan.com to see all feature enabled version of this template.
Table of Contents
- Fork the project.
- Clone your copy and create your own branch out of it.
# replace <username> with your username
git clone git@github.com:<username>/karngyan.com.git
git checkout -b website- Choose your favorite editor and open the project.
- Local development setup:
# install node <= 14 and yarn (highly recommended)
$ npm install --global yarn
# cd into your project and install the dependencies
$ yarn install
# run the dev server
$ yarn dev
# open localhost:3000Page might not load right now, you can set
firebase.enabled = falseinkarngyan.config.jsfor now. Read along.
- Edit
karngyan.config.jsto your liking. You can turn on and off sections/pages by changing theenabledvalue for respective objects.- You can add your images to
staticdirectory. It matches to root when deployed. - Update the
stringsobject accordingly.
- You can add your images to
- To enable comments and likes on blog posts and project posts, we use Firebase.
If you don't need that, set
firebase.enabled = falseinkarngyan.config.js, and move to the next step. Otherwise follow these:- Create a firebase project.
- Create a web app and get the firebase config object. (You can follow this video)
- Enable Authorization (Google Provider supported as of now)
- Enable Firestore
- Set the following cloud firestore rules, so that your database is write protected:
rules_version = '2'; service cloud.firestore { match /databases/{database}/documents { match /likes/{id} { allow write: if request.auth != null; allow read: if true; } match /comments/{id} { allow write: if request.auth != null && request.resourse.data.text.size() > 0 && request.resource.data.slug.size() > 0; allow read: if true; } } } - This actually does open a security loophole of open reads and will increase your firebase bills for too many reads.
- Only if you'll be testing locally
- Create a copy of
.env.example->.envand add values from config object.
- Create a copy of
- Deploy to netlify using the following config:
- Repository: Your forked repository
- Branch:
website - Publish Directory:
dist - Build Command:
yarn generate - Don't forget to add all the environment variables if you have enabled firebase.
- Write your blogs in
content/postsand projects incontent/projectsin markdown or html. There's a couple of samples that come with the template. - Add to staging, Commit and Push.
The code is yours, edit whatever you feel like. Don't forget to star the repository if you liked it.
This project uses nuxt content, you can read about it here
You can also set up forestry to never open code and use a cool editor. I'll add instructions to use that later.
My own website karngyan.com is actually deployed on AWS in an S3 bucket, with Cloudfront. But that comes with a few caveats to configure and maintain. Anyways the gulpfile.js to deploy to AWS is committed with the project if you feel like you want to check it out.
Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature) - Commit your Changes (
git commit -m 'Add some AmazingFeature') - Push to the Branch (
git push origin feature/AmazingFeature) - Open a Pull Request
Raise a PR when your website's up to add you here.
Find your alphabetical position, or raise a PR to automate this.
- Anamika Pandey - anamika.dev
- Claudio Canales - klaudioz.eth
- Gyan Prakash Karn - karngyan.com
- Nenad Radovanovic - nenad.xyz
- Ankur Dubey - ankurdubey.com / ankurdubey.eth.limo
- Madhav Kauntia - madhavkauntia.com
Distributed under the MIT License. See LICENSE for more information.
Karn - @gyankarn - mail@karngyan.com
For detailed explanation on how things work, check out Nuxt.js docs.