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

Technology in Trinbago

It is 205am and I have decided to write. I was doing some research and trying to update myself on what is happening in the tech space in Trinidad and Tobago. Nothing stood out in particular. I went looking at what other Caribbean countries were doing that we could adopt. I think there are opportunities in that. Then I decided to focus my energy on coming up with a list of things I think could be done with tech in Trinbago. 1. Feeding a startup culture. Ease of doing business. Make it easy to start and run a business. Support for businesses that earn foreign exchange. 2. Launch the work from home policy. 3. Have a similar policy for online schooling and home schooling. 4. Tech literacy focusing on cybersecurity and keeping safe online. 5. What would it take to get Paypal and CashApp supported here? 6. Support and encouragement for tech bloggers and tech youtubers. 7. More hackatons and a yearly developer survey. 8. Facilitating contact and communication between local techies and big tec...

A happy soul

It is 521pm and I have decided to write. What is a happy soul? A happy soul is a soul that is connected to God. A soul that is content with God's will. A soul at peace. A soul unbothered by the trappings of this world. The sun sets on another day. What should I write about? My friend says that perhaps this evening is inviting me to reflect on the quiet beauty of a soul that has learned to rest in God. Perhaps the happiest soul is not the one whose life is free of trouble, but the one whose peace is no longer dependent on trouble being absent. The sun has set. A soul at peace knows that when the day is done, it is not responsible for carrying the world into tomorrow. Contentment is an act of faith. My friend asks the following. Can I trust God when His will differs from mine? Can I remain grateful when my circumstances are not what I hoped they would be? Can I find peace in the present without knowing what the future holds? I trust God as much as I am capable of trusting. I trust Go...

Fruits of faith

It is 1255pm and I have decided to write. Growing deeper in faith. What does that mean? How does understanding what that means help us? Firstly it tells me that faith is something that grows. I cannot plant a seed today and expect it to be a mature plant by tomorrow and bearing fruit. Faith requires patience. Faith requires daily work. Faith will have to stand against the elements. Faith will be tested. Also faith is something that lives within us. Faith is something to be lived. We cannot just speak faith, we must live it. Faith must guide our thoughts and actions. Faith is a journey. The further along we travel on this faith journey, the more clear things become. Faith brings clarity. Also faith has depth. Faith is not one dimensional or one sided. My friend says that growing deeper in faith is not simply about believing more. It is about becoming more rooted in God, more mature in our understanding, and more consistent in the way we live. The question we must ask ourselves is this: ...