š This is my personal website and blog, built using Next.js, TypeScript, Tailwind CSS, and Notion. The blog posts are managed in Notion, and the website pulls the content from the Notion API at build time.
To get started with this project, follow these steps:
To get started with this project, you can clone the repository and install the dependencies:
git clone https://github.com/howznguyen/howz.dev.git
cd howz.dev
npm install
Copy the .env file to .env.example:
cp .env .env.example
You can duplicate the Notion page for database template here.
Once you have your own duplicate page, you can get the NOTION_API_KEY
and database IDs needed to run the project. To get your NOTION_API_KEY
, follow these steps:
Warning: Calling notion api in browser will leak your token to everyone who visit your blog website. And then they can write/delete your notion database. Be sure that your token is only granted with Read access.
NOTION_API_KEY
under the "Internal Integration Tokens" section.To add your app into page, folow these steps:
To get the database IDs, follow these steps:
Update the .env
file with your NOTION_API_KEY
and the database IDs for your settings, navigation, footer, and posts databases. Use the .env.example
file as a guide.
You can customize the language content and categories in folder src/lang
In this folder, you can see 2 files en.json
and vi.json
. You can add more language file with the same format.
If you want to customize the categories in home page, you can edit values in key categories
in en.ts
and vi.ts
file.
To enable commenting functionality using Giscus, you need to set up a repository and obtain a repository ID. You can find more information on the Giscus website.
.env
file, add the following variables with the values for your Giscus site:GISCUS_REPO=username/repository
GISCUS_REPO_ID=repository-id
GISCUS_CATEGORY=category-name
GISCUS_CATEGORY_ID=category-id
To enable Google Analytics, you need to set up a Google Analytics account and obtain a tracking ID. You can find more information on the Google Analytics website.
.env
file, add the following variable with the value for your Google Analytics tracking ID:NEXT_PUBLIC_GA_TRACKING_ID=tracking-id
To run the project, you can use the following command:
npm run start:all
The project will be available at http://localhost:3000.