mrfdn.com – Mungkin ada beberapa di antara teman-teman yang menggunakan Hugo sebagai platform untuk nge-blog.
Dan blog nya juga menampilkan iklan adsense.
Kali ini saya ingin share cara menampilkan iklan di antara paragraf hugo.
Baris iklan akan tampil setiap beberapa paragraf.
Iklan akan terender secara otomatis pada file html, bukan tampil sebagai javascript.
Tanpa berlama-lama, begini caranya menampikan iklan di antara paragraf hugo blog.
Buat file partial#
Buat file partial di layouts/partials/iklan/iklan-tengah.html.
Kemudian paste kode iklan yang diinginkan di sana.
Edit file single.html#
File single.html adalah file yang digunakan untuk menampilkan konten.
Pada file ini terdapat baris {{.Content}} untuk merender konden / isi file markdown.
Temukan baris itu lalu ganti dengan kodingan ini.
{{ range $index, $element := split .Content "</p>" }} {{ $element | safeHTML }}</p> {{ if mod $index 3 | eq 0 }} {{ partial "iklan/iklan-tengah" . }} {{ end }}{{ end }}Penjelasan:
Kodingan di atas akan menampilkan iklan setelah paragraf ke 3 dan tiap menemukan 3 tag berikutnya.
Sehingga nanti saat website dirender, maka iklan akan ikut terender secara otomatis dan tidak tampil sebagai kodingan javascript.
Demikian cara menampilkan kode iklan di antara paragraf untuk blog hugo.
Semoga bermanfaat.
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.

