Pos Unggulan Set yang Terhormat oleh Hugo
3 mins read

Pos Unggulan Set yang Terhormat oleh Hugo

mrfdn.com – Ingin membuat postingan yang selalu muncul di bagian atas halaman blog Hugo Anda?

Kita bisa menggunakan fitur postingan “unggulan” atau “disematkan”!

Caranya mudah, cukup ikuti langkah-langkah di bawah ini.

Di file postingan Markdown yang ingin Anda tampilkan, tambahkan bagian berikut featured: true pertama. Contoh:

---
title: "Postingan Featured"
date: 2023-10-30
featured: true
---

Jika Anda menggunakan format TOML, tulis seperti ini:

+++
title = "Postingan Featured"
date = "2023-10-30"
featured = true
+++

2. Ubah template untuk menampilkan pesan yang dipilih#

Buka folder direktori umum, biasanya ditemukan di layouts/_default/list.html atau di layouts/posts/list.html. Pada template yang saya buat, saya mengedit filenya layouts/partials/featured.html.

Tambahkan kode ini untuk memfilter postingan featured: true.

{{/* Menampilkan Featured Posts */}}
{{ $featured := where .Site.Pages "Params.featured" true }}
{{ if $featured }}
  <h2>Featured Post</h2>
  <div class="featured-posts">
    {{ range $featured }}
      <article>
        <h3><a href="{{ .Permalink }}">{{ .Title }}</a></h3>
        <p>{{ .Summary }}</p>
      </article>
    {{ end }}
  </div>
{{ end }}

{{/* Post Lainnya */}}
<h2>Semua Post</h2>
<div class="all-posts">
  {{ range .Pages }}
    {{ if not (in .Params "featured") }}
      <article>
        <h3><a href="{{ .Permalink }}">{{ .Title }}</a></h3>
        <p>{{ .Summary }}</p>
      </article>
    {{ end }}
  {{ end }}
</div>

Dengan kode ini, postingan yang ada featured: true itu akan muncul di atas, di bawah judul “Postingan Unggulan”.

3. (Opsional) Tambahkan gaya di CSS#

Agar lebih bagus lagi, kita bisa menambahkan sedikit CSS pada bagian yang ditampilkan.

.featured-posts {
  background-color: #f9f9f9;
  padding: 20px;
  border: 1px solid #ddd;
}

.featured-posts h3 {
  color: #e63946;
}

4. Panggil template jika disetel sebagai parsial#

Buka berkas baseof.html lalu tempelkan baris ini di mana pun Anda ingin meletakkannya:

<main>
{{ if .IsHome }}
    {{ partial "featured" . }}
{{ end }}
</main>

4. Periksa hasilnya#

Jalankan perintah hugo serve dan mendeteksi perubahan di browser.

Sekarang, postingan yang Anda posting featured akan selalu muncul di bagian atas halaman.

Sudah berakhir!

Sekarang Anda dapat dengan mudah mengatur postingan yang ingin Anda tampilkan tanpa masalah.

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