Deploy aplikasi Hugo kamu
Hugo builds a full site in well under a second and writes it to public — there's genuinely not much more to say. It was static-first before that was the default expectation.
- 01
Build the site
Run "hugo" from your project root. It compiles every content file and template into static HTML, CSS, and JS in a "public" folder — usually in well under a second.
- 02
Set the right base URL
Hugo bakes "baseURL" from hugo.toml into every generated link. Set it to your harvis.page address before building, or links to other pages on the site will point at the wrong place.
- 03
Deploy
Jalankan "npx harvis deploy public" dari root proyek kamu. Tanpa konfigurasi dan tanpa login untuk deploy pertama ini — kamu langsung mendapat URL live, plus link klaim pribadi untuk menghubungkan situs itu ke akun gratis kapan pun kamu siap.
Deploy Hugo dengan satu perintah
Build proyek kamu, lalu serahkan folder output ke harvis. Tidak perlu akun untuk deploy pertama — kamu akan mendapat link live dan link klaim pribadi untuk mengelolanya nanti.
hugo npx harvis deploy public
Lebih suka menyeret file daripada terminal? Build proyek kamu, lalu lepas folder output di sini dan publikasikan dengan cara yang sama.
Deploy Hugo on every git push
The command above is one you will run again after every change. A git hook runs it for you: this one already points at public, the folder Hugo builds into.
The folder holding the finished site. "." is the repo root, which is right for hand-written HTML; a static-site generator writes somewhere else.
pre-push fires on every branch and every remote, so a feature branch would publish over your live site. With this on, a push from anywhere else exits early and goes through untouched.
cat > .git/hooks/pre-push <<'EOF' #!/bin/sh set -e hugo harvis deploy public EOF chmod +x .git/hooks/pre-push
The options, the gotchas and how to share a hook with your team are on the git hook page.
Pertanyaan deploy Hugo
I changed baseURL after already deploying. Do I need to redeploy?
Yes — baseURL is compiled into the HTML at build time, not read at request time. Update "hugo.toml", rebuild, and run "npx harvis deploy public" again; it updates the same site.
Does Hugo's pagination and taxonomy pages (tags, categories) work?
Yes — they're all generated as static HTML files at build time like every other Hugo page, so they deploy and serve exactly the same way.
Apakah men-deploy aplikasi Hugo ke harvis benar-benar gratis?
Ya, tanpa kartu kredit. Batas gratisnya adalah 500 file dan 50 MB per situs, yang lebih dari cukup untuk build statis Hugo dengan banyak ruang tersisa. Situs yang dipublikasikan tidak kedaluwarsa — situs itu tetap live sampai kamu menghapusnya.
Bisakah saya memakai domain sendiri untuk situs Hugo yang di-deploy?
Setiap situs mendapat alamat harvis.page gratis, dan kamu bisa memilih subdomain sendiri dari dashboard setelah mengklaimnya — my-app.harvis.page, bukan yang acak. Mengarahkan domain yang sudah kamu miliki (seperti mytoko.com) ke situs itu belum didukung.
Apa bedanya ini dengan men-deploy Hugo ke Vercel atau Netlify?
Vercel dan Netlify dibangun di sekitar menghubungkan repo Git dan menjalankan build kamu di server mereka, dengan dashboard untuk mengonfigurasinya. harvis melewati semua itu: kamu build secara lokal (atau di CI kamu sendiri), jalankan satu perintah CLI terhadap folder output, dan dapatkan link — tanpa setup proyek, dan tanpa perlu akun sampai kamu ingin mempertahankan situs itu.
Men-deploy sesuatu yang lain?
Caranya sama di mana pun — build, lalu npx harvis deploy hasil outputnya.