Tampilkan iklan di antara paragraf Hugo Blog
mrfdn.com – Mungkin ada teman Anda yang menggunakan Hugo sebagai platform blogging.
Dan blog tersebut juga menampilkan iklan Adsense.
Sekarang saya ingin berbagi cara menampilkan iklan antar paragrafhugo.
Garis pemberitahuan akan muncul di setiap bagian.
Iklan akan ditayangkan dalam file html, tidak terlihat sebagai javascript.
Tanpa basa-basi lagi, berikut cara menampilkan iklan di antara paragraf blog Hugo.
Buat sebagian file#
Buat file di layouts/partials/iklan/iklan-tengah.html.
Lalu pastekan kode iklan yang diinginkan disana.
Edit file single.html#
File single.html adalah file yang digunakan untuk menampilkan konten.
File ini berisi baris {{.Content}} merender konten dalam file penurunan harga.
Temukan baris itu lalu ganti dengan kode ini.
{{ range $index, $element := split .Content "</p>" }}
{{ $element | safeHTML }}</p>
{{ if mod $index 3 | eq 0 }}
{{ partial "iklan/iklan-tengah" . }}
{{ end }}
{{ end }}
Keterangan:
Kode di atas akan menampilkan iklan setelah paragraf ke-3 setiap kali ditemukan 3 karakter berikutnya.
Oleh karena itu, ketika situs ditayangkan, iklan akan ditampilkan dan tidak akan terlihat sebagai kode javascript.
Inilah cara menampilkan kode iklan antar 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.