Skip to content

Create Content

πŸš€ Get Started

Panduan ini menjelaskan cara membuat konten baru pada project Hugo menggunakan perintah hugo new content.

Setelah menyelesaikan panduan ini, Anda dapat membuat, mengubah, dan menampilkan konten melalui Hugo Development Server.


πŸ“‹ Prerequisites

Pastikan:

  • Hugo telah terinstal.
  • Project Hugo telah berhasil dibuat.
  • Development Server telah berjalan.

Apabila belum, lihat dokumen berikut.


▢️ Procedure

Create New Content

Masuk ke direktori project.

cd ~/git/personal-site
Buat konten baru.

hugo new content articles/my-first-post.md

Contoh output.

Content "/home/eddywiyatno/git/personal-site/content/articles/my-first-post.md" created

Isi kontek akan terlihat seperti dibawah ini"

vim content/articles/my-first-post.md

output.

+++
title = "My First Post"
date = 2026-07-17T00:00:00+07:00
draft = true
+++

# Introduction

Ini adalah artikel pertama pada Personal Site.

Preview Content

http://localhost:1313/articles/my-first-post/

Apabila menggunakan status draft = true, jalankan:

hugo server -D

βœ… Verification

content/articles/my-first-post.md
http://localhost:1313/articles/my-first-post/

Verification

Konten berhasil dibuat dan dapat ditampilkan.


πŸ’‘ Engineering Notes

Perintah:

hugo new content articles/my-first-post.md

akan membuat file Markdown beserta Front Matter secara otomatis.

Secara default:

draft = true

Status tersebut mencegah konten dipublikasikan sebelum siap.

Untuk mempublikasikan konten:

draft = false

atau gunakan:

hugo server -D

selama proses pengembangan.