Git Pages

- 2 mins read
πŸ’‘ Β«Git. Если Ρ‚Ρ‹ сдСлал commit, Π½ΠΎ Π·Π°Π±Ρ‹Π» ΡΠ΄Π΅Π»Π°Ρ‚ΡŒ push - Ρ‚Ρ‹ Ρ‚Π΅ΠΏΠ΅Ρ€ΡŒ СдинствСнный Ρ…Ρ€Π°Π½ΠΈΡ‚Π΅Π»ΡŒ мудрости»
β€” John Dou
Установка Hugo Git Pages with Themes
  1. hugo new site portfolio
  2. cd portfolio
  3. git init
  4. git branch -m main
  5. git add .
  6. git commit -m "create structure for Git Pages"
  7. git branch develop
  8. git checkout develop
  9. git submodule add https://github.com/vaga/hugo-theme-m10c.git themes/m10c
  10. git add .
  11. git commit -m "install theme m10c"
Активация эмодзи

1. Π›ΠΎΠΊΠ°Π»ΡŒΠ½ΠΎ создаСм сайт ΠΈ ΠΈΠ½ΠΈΡ†ΠΈΠ°Π»ΠΈΠ·ΠΈΡ€ΡƒΠ΅ΠΌ Ρ€Π΅ΠΏΠΎΠ·ΠΈΡ‚ΠΎΡ€ΠΈΠΉ

hugo new site my-site && cd my-site && git init

2. Π‘ΠΊΠ°Ρ‡ΠΈΠ²Π°Π΅ΠΌ Ρ‚Π΅ΠΌΡƒ ΠΊΠ°ΠΊ Git-ΠΏΠΎΠ΄ΠΌΠΎΠ΄ΡƒΠ»ΡŒ ΠΈ Π°ΠΊΡ‚ΠΈΠ²ΠΈΡ€ΡƒΠ΅ΠΌ Π΅Ρ‘

git submodule add https://github.com/theNewDynamic/gohugo-theme-ananke.git themes/ananke echo “theme = ‘ananke’” » hugo.toml

3. НастраиваСм GitHub Actions для автоматичСского дСплоя

mkdir -p .github/workflows && cat « ‘EOF’ > .github/workflows/hugo.yml name: Deploy Hugo site to Pages on: push: branches: [“main”] permissions: contents: read pages: write id-token: write jobs: deploy: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 with: submodules: true fetch-depth: 0 - name: Setup Hugo uses: peaceiris/actions-hugo@v3 with: hugo-version: ’latest’ extended: true - name: Build run: hugo –gc –minify - name: Deploy uses: peaceiris/actions-gh-pages@v4 with: github_token: ${{ secrets.GITHUB_TOKEN }} publish_dir: ./public EOF

4. ΠŸΡƒΠ±Π»ΠΈΠΊΡƒΠ΅ΠΌ ΠΊΠΎΠ΄ (Π·Π°ΠΌΠ΅Π½ΠΈ <ΡŽΠ·Π΅Ρ€Π½Π΅ΠΉΠΌ> Π½Π° свой Π»ΠΎΠ³ΠΈΠ½ GitHub)

Π’Π°ΠΆΠ½ΠΎ: Π’ настройках рСпозитория (Settings -> Pages) Π²Ρ‹Π±Π΅Ρ€ΠΈ Π²Π΅Ρ‚ΠΊΡƒ gh-pages для дСплоя

git add . git commit -m “Initial Hugo setup” git branch -M main git remote add origin https://github.com/<ΡŽΠ·Π΅Ρ€Π½Π΅ΠΉΠΌ>/<ΡŽΠ·Π΅Ρ€Π½Π΅ΠΉΠΌ>.github.io.git git push -u origin main

enableEmoji = true - прописываСтся Π² Π²Π΅Ρ€Ρ…Π½Π΅ΠΌ Π±Π»ΠΎΠΊΠ΅ config.tolm