핸드북 로컬 빌드
hugo는 반드시 v0.98을 설치해야 한다.

핸드북 로컬 빌드 #

  • 툴 설치

    • powershell terminal을 admin모드로 오픈
    • chocolatey 설치
    Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
    
    • git, hugo 설치
    choco install git hugo hugo-extended -confirm
    
    brew install go
    go install --tags extended github.com/gohugoio/hugo@v0.98
    echo export PATH='$PATH':~/go/bin >> ~/.zprofile
    

  • 터미널을 새로 연다

  • 작업 디렉토리를 만들고 handbook clone, submodule update

PS c:\_repo\localley>git clone https://github.com/git-localley/localley-handbook.git
PS c:\_repo\localley>git submodule update --init --recursive
PS c:\_repo\localley>cd localley-handbook
PS c:\_repo\localley\localley-handbook>hugo server
Start building sites  
hugo v0.97.1-04efcb2a6807b527d9fbcc3e365c63bcba26f4b1 windows/amd64 BuildDate=2022-04-16T16:57:30Z VendorInfo=gohugoio
...

                   | KO
-------------------+-----
  Pages            | 57
  Paginator pages  |  0
  Non-page files   |  0
  Static files     | 90
  Processed images |  0
  Aliases          |  2
  Sitemaps         |  1
  Cleaned          |  0

Total in 341 ms
  Aliases          |  2
  Sitemaps         |  1
  Cleaned          |  0

Built in 318 ms
Watching for changes in C:\_repo\localley\localley-handbook\{archetypes,assets,content,layouts,static,themes}
Watching for config changes in C:\_repo\localley\localley-handbook\config.toml
Environment: "development"
Serving pages from memory
Running in Fast Render Mode. For full rebuilds on change: hugo server --disableFastRender
Web Server is available at http://localhost:1313/ (bind address 127.0.0.1)
Press Ctrl+C to stop
  • http://localhost:1313/ 를 브라우저로 연다
  • 원하는 페이지를 직접 수정하면 실시간으로 로컬 사이트에 반영된다
  • branch를 새로 따서 PR을 만들어 요청한다

핸드북 작업 with vscode #

vscode를 사용하여 작업하는 방법

준비 작업 #

  • 툴 설치

    • powershell terminal을 admin모드로 오픈
    • chocolatey 설치
    Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
    
    • git, hugo, vscode 설치
    choco install git hugo hugo-extended vscode -confirm
    
    • 터미널 새로 열기
    code --install-extension donjayamanne.githistory
    code --install-extension eamodio.gitlens
    code --install-extension mhutchie.git-graph
    

    Linux Content #

    MacOS Content #

  • 작업 디렉토리를 만들고 handbook clone, submodule update

PS c:\_repo\localley>git clone https://github.com/git-localley/localley-handbook.git
PS c:\_repo\localley>git submodule update --init --recursive

문서 작업 #

  • vscode 열고 작업 폴더 열기 (Open Folder)

  • localley-handbook\content

    • company (회사)
    • dept (부서)
    • docs
  • localley-handbook\static

    • images
  • 파일 추가는 그냥 해당 위치에 추가하면 되고 폴더와 파일을 이용하여 왼쪽 네비 트리에 자동으로 추가 된다.

  • .md 파일 상단의 title이 실제 이름이 된다.

---
title: 가치
type: docs
---

커밋 #

  • 왼쪽에 source control 탭을 연다.
  • Changes에 변경사항들을 확인하고 ‘Stage All Changes’를 한다.
  • 메세지를 적고 Commit 한다.
  • Sync Changes를 눌러서 push 한다.
임시 워크플로우 당분간은 임시로 직접 main branch에 push한다.

핸드북 작업 with forking gitflow #

본 문서에서는 forking workflow를 사용한다.

준비 작업 #

git remote rename origin upstream
git remote add origin https://github.com/{github아이디}/localley-handbook.git

작업 #

  1. upstream에서 소스 받아오기 (메인 repo)
cd C:\_repo\localley\localley-handbook
git pull upstream main
  1. 작업 브랜치 만들기
git checkout -b fix1
  1. 수정
  • 파일 수정
  • 파일 추가
  1. 커밋
git add .
git commit -a -m "수정"
  1. PR 만들기
PS C:\_repo\temp\localley-handbook> git push origin fix1
Enumerating objects: 7, done.
Counting objects: 100% (7/7), done.
Delta compression using up to 24 threads
Compressing objects: 100% (4/4), done.
Writing objects: 100% (4/4), 355 bytes | 355.00 KiB/s, done.
Total 4 (delta 3), reused 0 (delta 0), pack-reused 0
remote: Resolving deltas: 100% (3/3), completed with 3 local objects.
remote: 
remote: Create a pull request for 'fix1' on GitHub by visiting:
remote:      https://github.com/icedac/localley-handbook/pull/new/fix1
remote:
To https://github.com/icedac/localley-handbook
 * [new branch]      fix1 -> fix1

cf functions test #

npm install wrangler
npx wrangler pages dev ./public --binding WEBHOOK=\"xxx\"