Create a header that appears and disappears by scrolling

Headers can be animated easily by CSS and a few JavaScript, but the speed will be constant. I hate that, so I’ll create a header that works naturally like this. Sample code & Demo See the Pen Awesome header by Akimo (@akimon658) on CodePen. This script changes the value of top by scrolling....

How to save cookies as a file in Golang

Go’s cookiejar doesn’t have any function to persistence cookies, so you need to do something to save cookies to a local file. To make it easy, you can use juju/persistent-cookiejar instead. ...

Generate URL cards when building your Hugo site on GitHub Actions

Hugo is known as a super-fast static site generator. It also has many functionaries such as shortcodes. However, it’s not good at dynamic processing because it can’t use remote files other than JSON or CSV. So we need an API server to generate link cards from URLs. Although, it’s wasteful to use a rental server and I also want to run it locally....

Use Disqus on multilingual Hugo site

The answer window.disqus_config = function() { this.language = '{{ .Lang }}'; } Why use window.disqus_config? According to the Disqus’ help page, we can override the language by adding this. var disqus_config = function () { this.language = "ja"; }; So basically the following JavaScript works. var disqus_config = function () { this....

Hugo adds unnecessary whitespace after a link

I’m running this blog with Hugo. I love it because it’s super fast and functional, but I had a problem. Issue example This is [test](https://example.com), just a [sample](https://sample.test) This would output… like this. It rendered unnecessary space before comma or period. Cause It was because layouts/_default/_markup/render-link.html ended with a newline....

How to use the browser in Windows as WSL's default

How do you usually do when you need to authorize using the browser in WSL? Copy the token? Or use WSLg? These ways are not wrong, but it will be better to use the host’s browser. Here is how to set it: sudo update-alternatives --install /usr/bin/x-www-browser x-www-browser path/to/browser priority Example:...

How to replace home directory with "~" on PowerShell

PowerShell displays the current full path by default. It’s long, so I’d like to replace it with ~ like Bash. Prepare a profile You can customize your PowerShell with $profile. It doesn’t exist by default, so you need to run touch $profile. Customize To customize the prompt, use function prompt. Here is a built-in one....
menu
keyboard_arrow_up