Git Pages
π‘ Β«Git. ΠΡΠ»ΠΈ ΡΡ ΡΠ΄Π΅Π»Π°Π» commit, Π½ΠΎ Π·Π°Π±ΡΠ» ΡΠ΄Π΅Π»Π°ΡΡ push - ΡΡ ΡΠ΅ΠΏΠ΅ΡΡ Π΅Π΄ΠΈΠ½ΡΡΠ²Π΅Π½Π½ΡΠΉ Ρ ΡΠ°Π½ΠΈΡΠ΅Π»Ρ ΠΌΡΠ΄ΡΠΎΡΡΠΈΒ»β John Dou
Π£ΡΡΠ°Π½ΠΎΠ²ΠΊΠ° Hugo Git Pages with Themes
hugo new site portfoliocd portfoliogit initgit branch -m maingit add .git commit -m "create structure for Git Pages"git branch developgit checkout developgit submodule add https://github.com/vaga/hugo-theme-m10c.git themes/m10cgit add .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