#4: Cara Membuat Tema Hugo dari Awal – Single.html

mrfdn.com – Pada artikel sebelumnya kita berhasil menampilkan daftar artikel/konten blog Hugo yang sedang dibuat.

Pada artikel ini saya ingin menunjukkan cara menampilkan konten setiap artikel melalui file tunggal.html.

Single.html adalah file yang bertanggung jawab untuk merender setiap halaman postingan dalam folder Isi.

Silakan edit file tersebut layouts/_default/single.html Kemudian tempelkan baris ini.

{{ define "main" }}
<section>
  <h1>{{ .Title }}</h1>
  <div>
    <article>
      {{ .Content }}
    </article>
  </div>
</section>
<aside>
  <div>
    <section>
      <h4>{{ .Date.Format "Mon Jan 2, 2006" }}</h4>
      <h5>{{ .WordCount }} Words</h5>
    </section>
  </div>
  <div>
    {{ with .PrevInSection }}
    <a class="previous" href="{{ .Permalink }}">{{.Title}}</a>
    {{ end }}
    {{ with .NextInSection }}
    <a class="next" href="{{ .Permalink }}"> {{.Title}}</a>
    {{ end }}
  </div>
</aside>
{{ end }}

Jadi hasilnya akan seperti ini.

Satu halaman halaman Hugo

Penjelasan:

  • Pertama kita tentukan judul artikelnya {{.Title}}
  • Lalu kita punya {{.Content}} yang merupakan konten yang dibungkus dengan tag <article>.
  • Kemudian kami memiliki bagian berbeda untuk menampilkan meta data tentang kapan artikel itu dibuat.
  • Meta word count juga kami atur untuk menghitung jumlah kata dalam artikel {{.Wordcount}}
  • Selanjutnya kita juga bisa mengatur artikel berikutnya sebelumnya untuk memudahkan navigasi.

Seberapa mudahnya?

Yang penting hanya ada 2 halaman tunggal, yakni kita hanya perlu menentukan judul dan isi artikel. Selebihnya terserah Anda untuk menampilkan apa pun yang Anda inginkan.

Selanjutnya silahkan tambahkan CSS untuk mempercantik blog anda.

Anda dapat menambahkan CSS Anda langsung melalui folder static/css/ Kemudian tambahkan filenya style.css kamu di sana

Atau Anda bisa langsung berintegrasi dengan framework CSS favorit Anda seperti Bulma, Tachyons, Bootstrap dan tag lainnya. <head> dalam file index.html yang telah dilakukan sebelumnya.

Kemudian setup PostCSS + PurgeCSS untuk mengecilkan kelas CSS yang digunakan sehingga file CSS menjadi lebih kecil dari sebelumnya.

Selanjutnya saya akan membahas arketipe file di Hugo.

PakarPBN

A Private Blog Network (PBN) is a collection of websites that are controlled by a single individual or organization and used primarily to build backlinks to a “money site” in order to influence its ranking in search engines such as Google. The core idea behind a PBN is based on the importance of backlinks in Google’s ranking algorithm. Since Google views backlinks as signals of authority and trust, some website owners attempt to artificially create these signals through a controlled network of sites.

In a typical PBN setup, the owner acquires expired or aged domains that already have existing authority, backlinks, and history. These domains are rebuilt with new content and hosted separately, often using different IP addresses, hosting providers, themes, and ownership details to make them appear unrelated. Within the content published on these sites, links are strategically placed that point to the main website the owner wants to rank higher. By doing this, the owner attempts to pass link equity (also known as “link juice”) from the PBN sites to the target website.

The purpose of a PBN is to give the impression that the target website is naturally earning links from multiple independent sources. If done effectively, this can temporarily improve keyword rankings, increase organic visibility, and drive more traffic from search results.

Jasa Backlink

Download Anime Batch

Tinggalkan Komentar

Alamat email Anda tidak akan dipublikasikan. Ruas yang wajib ditandai *