I want to stay in the dream from the night we met. It’s the wildest fantasy I’ve ever had. Can we meet there again? Just to kiss you one last time, and hold you once more after a million embraces.
Slash pages in Hugo
In Hugo, creating different slash pages (like /about/, /uses/, etc.) involves creating specific content files for each page and customizing templates as needed.
- Create individual markdown files for each slash page under
content/.
If you want to create an/about/page in your blog, add a markdown page with below front matter in thecontent/page.
//content/about.md
---
title: "About"
date: 2024-10-16
---
This is the About page content.
- Optionally create a template for the page.
Hugo uses thesingle.htmltemplate from thelayouts/_default/folder to render pages by default. However, you can create custom templates in thelayouts/page/ folderto format specific pages as needed.
//layouts/page/about.html
<h1>{{ .Title }}</h1>
<div class="content">
{{ .Content }}
</div>
You can check my slash pages like uses, credits, and changelog.
References
Hugo Troubleshooting
Hugo is fast, but ineffecinet templates can make it slower. For checking the performance you can use the below commands.
Use
hugo --logLevel debugto display debug information, warning, and error message.Use
hugo --templateMetricsto check for slow templates. This will show the time it takes to render each template.Use
hugo --gc(garbage collection) to clean up unused files, which might help reduce build time.Use
debug.Timerto determine the execution time of a block of code. And use thehugo --logLevel infoinfo command line flag when you build the site.
{{ $t := debug.Timer "TestSqrt" }}
{{ range seq 2000 }}
{{ $f := math.Sqrt . }}
{{ end }}
{{ $t.Stop }}
References
Walking
Walking brings clarity to your thoughts.
Answers
Create your own answers.
Write it down
By writing down your problems, you’ll be able to see the solutions clearly.
ഭ്രമണം
പ്രകാശത്തിന്റെ പകലിൽ
മഞ്ഞവെളിച്ചങ്ങളുടെ ഇരുട്ടിൽ
ഓർമ്മകളുടെ പെയ്ത്തിൽ
നിശ്വാസങ്ങളുടെ ഇടന്നേരങ്ങളിൽ
നിങ്ങളിലാണ് ഞാൻ
ഭ്രമണം ചെയ്യുന്നത്.
Higher order functions
A higher order function is a function that takes one or more functions as arguments, or returns a function as its result.
These functions are powerful because they allow you to abstract and compose operations in a flexible and reusable way. They are a fundamental concept in functional programming.
Common examples of higher order functions are .map(), .filter(), and reducer().
.map(): Takes a function as an argument and applies it to each element in an array, returning a new array with the results.
const numbers = [1, 2, 3, 4];
const doubled = numbers.map(num => num * 2);
console.log(doubled); // [2, 4, 6, 8]
References
Scar
There’s a scar etched on my heart,
Forged by love from ages past.
Yet it makes me brave in the battle,
Brings hope amidst despair,
And guides me forward.
And I want you to know this:
Love is the wound where light flows in.