blank

mrfdn.com – Shortcode di hugo merupakan salah satu cara untuk memanggil elemen tertentu pada situs.

Misalnya kita ingin membuat toc (term of service) di dalam artikel hugo, maka kita bisa dengan mudah memanggilnya dengan shortcode.

Shortcode juga ditemukan di WordPress.

Tapi untuk membuat shortcode di WP cukup sulit, beda dengan HUGO dimana kita hanya perlu membuat file shortcode lalu memanggilnya di mana pun kita inginkan.

Membuat shortcode TOC di Hugo#

Pertama buat sebuah folder bernama shortcodes di dalam folder layouts theme kita.

Kemudian di dalalam folder shortcodes tersebut buatlah sebuah file html dengan nama toc.html.

File shortcode dibuat dengan format html.

Setelah itu isi file toc.html dengan kode berikut :

<div> <h2>Daftar Isi</h2> {{ .Page.TableOfContents }}</div>

TOC sudah dibuat, sekarang untuk membuatnya berfungsi kita tinggal panggil saja melalui artikel yang ingin ditampilkan TOC di dalamnya.

Silahkan edit salah satu file artikel anda, pastikan yang memiliki heading.

Setelah itu silahkan tulis baris berikut, tanpa spasi.

{{ <toc> }}

Maka pada lokasi tersebut TOC akan dirender oleh hugo secara otomatis.

Tentang shortcode di hugo#

Kemudian sebelumnya saya sudah coba membuat artikel tentang cara membuat shortcode untuk menampilkan elemen iframe di hugo.

Anda bisa membuat shortcode untuk menampilkan apapun.

Entah itu elemen div, paragraf, quote, share button, atau apa saja yang ingin ditampilkan.

Yang perlu diketahui hanyalah bagaimana bagaimana cara menulis shortcode dengan benar.

File name shortcode akan secara otomatis menjadi kode shortcode untuk dipanggil.

Misalnya anda membuat shortcode dengan nama toc.html maka akan dipanggil dengan toc juga.

Semoga artikel ini 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

Leave a Reply

Your email address will not be published. Required fields are marked *

TOP