Tạo Github Pages dựa trên template Just the Docs

Result

Tách biệt 2 nhánh (nhánh main & gh-pages )

Installation

title: Audio Steganography
description: A collection of labs for learning audio steganography techniques.
theme: just-the-docs

url: https://tutran21195.github.io/steg-labs/ # sửa thành link github.io của mình

aux_links: # cái này là link hiển thị ở góc phải bên trên (cạnh thanh search của site github.io). Xóa hẳn nó đi nếu ko cần đến.
  Labs Repository: https://github.com/TuTran21195/steg-labs
aux_links_new_tab: true

# ci.yml
name: CI
on:
  push:
    branches: ["gh-pages"] # chỉnh sửa cái này thành nhánh mà chứa template Just the Doc để nó build khi có gì đó push lên nhánh này. Theo hướng dẫn này thì để nguyên là "gh-pages" là oke.
  pull_request:
# pages.yml
# This workflow uses actions that are not certified by GitHub.

# They are provided by a third-party and are governed by

# separate terms of service, privacy policy, and support

# documentation.

  

# Sample workflow for building and deploying a Jekyll site to GitHub Pages

name: Deploy Jekyll site to Pages

on:
  push:
    branches: ["gh-pages"] # chỉnh sửa cái này thành nhánh mà chứa template Just the Doc để nó build khi có gì đó push lên nhánh này. Theo hướng dẫn này thì để nguyên là "gh-pages" là oke.

  # Allows you to run this workflow manually from the Actions tab

  workflow_dispatch:
version: 2
updates:
  - package-ecosystem: bundler
    directory: /
    schedule:
      interval: daily
    allow:
      - dependency-type: direct
    target-branch: gh-pages # Thêm dòng này để Dependabot tạo Pull Request cho nhánh gh-pages
  - package-ecosystem: "github-actions"
    directory: "/"
    schedule:
      interval: daily
      time: "10:00"
    open-pull-requests-limit: 10
    target-branch: gh-pages # Thêm dòng này để Dependabot tạo Pull Request cho nhánh gh-pages

Ultilized

Thêm trang đơn lẻ vào thanh điều hướng

Tạo nhóm (menu con) trong thanh điều hướng

Nếu bạn muốn nhóm các trang thành một mục menu con (parent-child hierarchy), hãy thêm parent vào front matter:

Note

Các trang con không nhất thiết phải set giá trị cho nav_order, nó sẽ tự sắp xếp theo alpabet của title của các trang con đó.
Các trang lẻ, trang cha,... thì nên set giá trị nav_order một cách tường minh và tránh trùng nhau để không gây ra lỗi.

  1. Tạo một trang cha (parent) nếu cần:

    # docs/parent-page.md
    ---
    title: Hướng Dẫn
    layout: default
    nav_order: 2
    has_children: true  # Bật menu con
    ---
    
  2. Tạo các trang con:

    # docs/child-page1.md
    ---
    title: Hướng Dẫn 1
    layout: default
    parent: Hướng Dẫn  # Liên kết với trang cha bằng title của trang cha
    nav_order: 1
    ---
    
    Nội dung hướng dẫn 1.
    
    # docs/child-page2.md
    ---
    title: Hướng Dẫn 2
    layout: default
    parent: Hướng Dẫn # Liên kết với trang cha bằng title của trang cha
    nav_order: 2 
    ---
    
    Nội dung hướng dẫn 2.
    
    • Kết quả: Thanh điều hướng sẽ hiển thị mục “Hướng Dẫn” với hai trang con “Hướng Dẫn 1” và “Hướng Dẫn 2”.

TOC

1. TOC
{:toc}

The {:toc} line must follow the 1. TOC line, which begins a list.

For an unordered table of contents, instead use the following markdown code:

- TOC
{:toc}

Callout

callouts_level: quiet # or loud
callouts:
  highlight:
    color: yellow
  important:
    title: Important # nếu để thêm trường title thì title của nó sẽ luôn là chữ này
    color: blue
  new:
    title: New
    color: green
  note:
    title: Note
    color: purple
  warning:
    title: Warning
    color: red
  tip:
    title: Tips
    color: green
  info:
    title: Info
    color: blue
{: .highlight }
> A paragraph in callout.....
> 
> ...

Related