Menampilkan iklan di paragraf Hugo Blog

mrfdn.com – Mungkin Anda punya beberapa teman yang menggunakan Hugo sebagai platform blogging.

Dan blog tersebut juga menampilkan iklan adsense.

Kali ini saya ingin berbagi cara menampilkan iklan di paragraf Hugo.

Baris iklan akan muncul setiap beberapa paragraf.

Iklan akan otomatis ditampilkan dalam file html, tidak ditampilkan sebagai javascript.

Tanpa basa-basi lagi, berikut cara menampilkan iklan dalam paragraf Hugo Blog.

buat sebagian file#

Buat sebagian file layouts/partials/iklan/iklan-tengah.html.

Lalu pastekan kode iklan yang diinginkan disana.

Edit satu file.html#

File single.html adalah file yang digunakan untuk menampilkan konten.

Ada baris di file ini .Content Untuk merender konten file Markdown.

Temukan baris tersebut lalu ganti dengan kode ini.

 range $index, $element := split .Content "</p>" 
         safeHTML </p>
         if mod $index 3 
         partial "iklan/iklan-tengah" . 
         end 
 end 

Penjelasan:

Kode di atas akan menampilkan iklan setelah paragraf ke-3 dan setiap kali akan menemukan 3 tag berikutnya.

Sehingga ketika website di-render nanti, iklan akan otomatis dirender dan tidak ditampilkan sebagai kode JavaScript.

Cara menampilkan kode iklan dalam paragraf Hugo Blog.

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.

Jasa Backlink

Download Anime Batch

Tinggalkan Komentar

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