blank

mrfdn.com – Kalau sebelumnya saya sudah membagikan script untuk set thumbnail berdasarkan gambar pertama pada artikel markdown di hugo, kali ini saya ingin membuat agar salah satu tag menjadi category.

Ini dikarenakan karena pada saat convert artikel wordpress/blogger ke hugo, hugo tidak otomatis mengatur category.

Semua taxonomy (tag, category, label) disatukan ke dalam taxonomy (tag) di Hugo.

Jika anda ingin agar category tetap ada di Hugo, maka ini adalah triknya. Kita buatkan script untuk memindahkan keyword category tertentu yang terdapat pada baris tags, lalu memindahkannya ke baris baru yang diawali dengan category:.

Langsung saja script nya seperti ini :

#!/run/current-system/sw/bin/bashsetcategory () { kw="mycategory" category=$(grep -oE "'$kw'"\|", '$kw'"\|" '$kw', "\|"'$kw', " $1 | head -1) echo $1 [[ "$category" == "$kw" ]] && echo $1 || sed -i "s/$category//" $1 && sed -i "5 a\category: \n-$kw" $1}removeduplicatecategory(){ sed -i ':a;N;$!ba;s/\ncategory:*//2g' $1 sed -i "/$kw/d;s/category:/category:\n-$kw/" $1}for a in *.md ;dosetcategory "$a";removeduplicatecategory "$a";done

Script ini merupakan modifikasi dari script sebelumnya. Terdapat banyak penambahan fitur.

Penjelasan script#

Pertama, set keyword kategori yang ingin diganti. (misalnya anda memiliki kategori dengan nama mycategory).

Kemudian script akan mencari dan mendefinisikan keyword tersebut. Kemudian disimpan pada sebuah argumen $1.

Kemudian baris selanjutnya adalah logic, jika string category tidak sama dengan string keyword yang telah diset, maka simpan itu pada sebuah argumen $1.

Tapi jika sama maka lanjutkan dengan membuat category: kemudian pada baris ke 5 tulis keyword category di bawahnya dengan diawali tanda -.

Setelah itu hapus tulisan category: yang sama.

Kemudian hapus juga keyword category yang sama.

Selesai.

Saya sangat senang akhirnya bisa membuat sebuah bash script sendiri. Cerita dikit, saya seharian duduk di depan laptop hanya agar script ini berjalan dengan lancar.

Demikian artikel singkat tentang script set category tertentu di 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.

Jasa Backlink

Download Anime Batch

Leave a Reply

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

TOP