Skip to content

Docusaurus

How to localhost

  • cd my-website
  • npm run start

If you want to add new blog, docs

  • You are gonna use main branch to add new pages.
  • gh-pages only using for static web view.
  • You need to build and deploy again.

How to use docusaurus with github pages?

  1. npx create-docusaurus@latest folder_name
  2. Change organization name, project name etc. - Add gh-pages deployment branch, trailingslah:true 3.Install
    yarn install
  1. Build
    yarn build
  1. Create personal access token or SSH setup for github.
  2. Deploy with SSH or token.
USE_SSH=true yarn deploy
# or
GIT_USER=<gh_personal_access_token> yarn deploy
  1. Change github repository page view main to gh-pages from repository settings -> pages(left sidebar) -> branch 'gh-pages and /root than save.

How to update?

  • yarn build
  • USE_SSH=true yarn deploy
  • or
  • GIT_USER=<gh_personal_access_token> yarn deploy or make a alias on the .zshrc:
alias dinodeploy="yarn build & USE_SSH=true yarn deploy"

and use only dinodeploy on your repository path

Front Matter

---
title: Github Token Setup
id: github-token-setup
last_update:
    date: 08.15.2025
    author: Cyber-Syntax
# This isn't working on the docusaurus front matter
# but I use to track outdated content for my website
publish:
    date: 08.15.2025
tags:
    - git
    - github
---

How to ?

How to update docusaurus?

Core updates

yarn upgrade @docusaurus/core@latest @docusaurus/preset-classic@latest @docusaurus/module-type-aliases@latest @docusaurus/types@latest

Specific updates

npx update-browserslist-db@latest

How to change some of the css?

[!INFO] css: https://infima.dev/

How to create multiple docs?

// docusaurus.config.js
{
to: "nixos",
position: "right",
label: "NixOS",
},

// sidebar.js
nixosSidebar: [{ type: "autogenerated", dirName: "nixos" }],

// Create file on `my-website/nixos` instead of `docs/`

Templates

Advanced Document Template

---
sidebar_position: 1
slug: /docs/Linux/Github/docusaurus
title: Docusaurus
id: docusaurus
last_update:
    date: 08.15.2025
    author: Cyber-Syntax
tags:
    - github
---

<!-- TOC -->

# Head1

## Head2

- content

<!-- /TOC -->

Blog Templates

Basic Template

[!NOTE] slug: makes the url blog/security

---
slug: security
title: Why pirate software is dangerous?
authors: cyber-syntax
tags: [security]
---

# Head1

Content

<!-- truncate -->

Content

# Head1

Content

Additional Resource