Skip to content

TienNHM/personal-blog-template

Repository files navigation

Personal blog template

GitHub Repo stars GitHub forks GitHub watchers GitHub contributors GitHub issues GitHub top language GitHub repo size GitHub code size in bytes

GitHub commit activity GitHub last commit GitHub Workflow Status (with event) GitHub deployments GitHub release (latest by date) npm

This website is built using Docusaurus 2, a modern static website generator. It is deployed on GitHub Pages. You can use this template to build your own personal blog.

Beside that, this website is integrated with some useful tools, such as GitHub Actions, GitCus, Algolia, Canny for GitHub, ... to help you manage your blog easily.

Installation

$ npm install 

Local Development

Update some information in the website:

  • Update the baseUrl in docusaurus.config.js to match your GitHub Pages URL (or custom domain). For example, if you are using GitHub Pages with a custom domain https://mywebsite.com, then baseUrl should be set to /.
  • Change all occurrences of YourName to your GitHub username. For example, if your GitHub username is TienNHM, then replace all occurrences of YourName with TienNHM.
  • Update your personal information, including name, title, url, image_url in authors.yml. Notice that, image_url is the URL to your GitHub avatar.
  • Please change your contact information in docusaurus.config.js and contact.md.
  • There are some process environment variables in .env file. You must update them to match your information.

After that, you can run the website in the development mode using:

$ npm run start

This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server.

Build

$ npm run build

This command generates static content into the build directory and can be served using any static contents hosting service.

Deployment

If there is the first time you deploy the website, you need to update permissions for Workflow permissions in Settings > Code and automation > Actions > General tab of your repository.

You must enable Read and write permissions permission for Workflows section, and check Allow GitHub Actions to create and approve pull requests.

If you are using GitHub pages for hosting, please ensure the gh-pages branch is existed. If not, please create it. After that, please enable GitHub pages in Settings > Pages tab of your repository, and choose gh-pages branch as the source.

Using SSH:

$ USE_SSH=true yarn deploy

Not using SSH:

$ GIT_USER=<Your GitHub username> yarn deploy

If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the gh-pages branch.

Demo

You can see the demo of this website at https://tiennhm.github.io.

Demo

References