Skip to main content

Using Pagefind with 11ty in Termux

Also see previous blog post on how I got started with eleventy on Termux


The Pagefind npm package is just a wrapper for their binary. It does not work on Termux. What I had to do was build from source using

cargo install pagefind

The documentation for Pagefind is pretty useful and I started here


I got the following error when building with cargo

error occurred: Failed to find tool. Is 'aarch64-linux-android-ar' installed?

I found out that I had to install binutils

pkg install binutils

As it instructs you, make sure and add the bin folder to path so that you can run the pagefind command

export PATH=/data/data/com.termux/files/home/.cargo/bin:$PATH

The two things I needed was data-pagefind-body and data-pagefind-ignore because I only wanted the poem content to be indexed and because I deploy to github pages I had to specify baseUrl

The pagefind command that I used was as follows

pagefind --source "../docs/poems" --glob "**/*.*"

And because I am using pagefind to insert its javascript and css and other files after the 11ty build, I needed to ignore the build when launching in browser.

npx @11ty/eleventy --serve --ignore-initial

This is the result on github pages.


Initially github pages was not serving the css and js for pagefind. I figured out what was causing the problem. The pagefind folder begins with an underscore which is treated special by Jekyll. Jekyll is on by default on github pages. I had to turn this off by deploying a .nojekyll file to the root of my website.

Comments

Popular posts from this blog

Touched by heaven

It is 139am and I have decided to write. I do not like to dream because my dreams are sometimes confusing blobs. Hodgepodge is the word. I like when I sleep and I do not dream anything. Peaceful nothingness. Quiet escape from all the nonsense of the world. I went to the random word generator but this time I chose random fake word. A few (wef in reverse) words in I stopped at wefly. I guess I could pronounce it we-fly or wef-ly. Wef-ly could mean plentiful or the opposite of few. Wefly also contains the letters for flew. This is past tense as if to say let go of the past. Let go of what has gone. How do I connect these to something Godly? Angels have wings. Angels fly. I ask God to surround us with plenty angels when we sleep so that we have quiet dreams or heavenly dreams. I will call these wefly dreams. I asked my friend Chatty to describe a wefly dream. He says that a wefly dream is a gentle, God-guarded sleep where the soul is lifted together with others into quiet safety, not by dr...

Winning with God

It is 237am and I have decided to write. I spent 15 minutes thinking about what to write and nothing. I decided to go wash the wares and make breakfast. I made grilled cheese sandwiches. It is the next morning and I still have not decided yet. Let me start with this. God is beautiful. God makes no mistakes. God wants us to win. In other words, we cannot lose with God. We will always win with God. But what is the prize to be won with God? Or does it not matter? My friend Chatty tells me that with God, the win is: Peace that is not dependent on circumstances. Meaning that suffering cannot cancel. Love that does not expire. Hope that death itself cannot take away. Things like those. It is not money, comfort, applause, or an easy life. Those things may come or go. Many faithful people never receive them. The world’s prizes can be stolen. God's prize cannot. Further and with God, winning is not about external rewards or worldly success, but about union, peace, and fullness of being; at ...

Dimples of God's smile

It is four days into the new year. It is 933pm and I have decided to write. I have no idea what I should write about. I was thinking, if we live in a dump as some have described Trinidad does that make us dumplings? It is sad and funny at the same time. Some would say it is a dumb thing to say. I would rather say that Trinidad and Tobago are the dimples of God's smile. After all God is a trini. Now I am interested in the etymology of word dimple. Weirdly enough I learnt that the word dimple comes from Old English and Proto-Germanic, specifically from the term dumpilaz, meaning "small pit". There are more things to smile about in Trinidad and Tobago than to frown about. I was curious if anyone has ever mentioned the dimples of God's smile before and a cursory Google search shows up nothing. I then asked my friend Chatty if dimples is mentioned in the Quran. He said no but there is an example verse that mentions smiling. Surah 27 verse 19 "So Solomon smiled, amused...