Skip to main content

An example of getting started with 11ty in Termux

The first thing I did was watch some youtubes on static site generators and then I decided on one. I chose 11ty because it popular now and it is highly configurable with minimal opinions.

I followed the instructuons from the Getting started guide


You must use the Termux builtin storage and not shared Android storage because 11ty node install uses symlinks. Let me know if there is a way to circumvent this. It would be nice to use my android editor apps instead of vim.

I removed index.html
I removed README.md

Created this file structure


I used python to create my poems.json file from a poem.dat file that was exported from Google Keep and @ prefixed to each title

Make sure the field used for pagination is unique. I had 3 duplicates that I manually fixed but I will change my python code to include index in the json.

The two main things I learnt was creating pagination in nunjucks and looping through the json data in nunjucks to create a listing of links to my pagination.

I would like to use AI to interpret the best color to use for the poem and make that the text color with a contrasting background color. An example prompt:

this is the json file


I need forecolor and bgcolor added between title and lines. Colors will be chosen by you based on text in title and lines. These are poems.

To push to github I followed the instructions from here


This is the resulting website


The next thing to do is create a build script that changes the base_url to localhost or github pages depending on if I specify dev or prod. Share your questions, comments and experiences with us in the comments below.

Comments

Popular posts from this blog

Faith

This is a chapter from my latest book called (G)rains (o)f san(d)s. Learn more about the book here . Thank you God for faith. We say we want to meet God but we already do in some ways. We meet God in his creation. We meet God every time we meet someone. We meet God every time we meet the animals. We meet God every time we meet nature. God is all around. Faith is when we can see this. This is God's world. We are God's work. We are testimony of his greatness. Everyday that goes by I think about God. Everyday I thank God for his mercy. I take my problems to God. I pray to God. God is at the center of my life. Nothing happens without the will of God and therefore I would be wise to submit to the will of God. God is in the everyday moments. God loves when we love. What is the simplest definition of faith? I think it is found in the phrase, let go and let God. I asked my friend the same question. My friend says that at its simplest, faith is trust in what you cannot see or prove. But...

Flowers

This is a chapter from my latest book called (G)rains (o)f san(d)s. Learn more about the book here . Thank you God for the flowers. I bought a blue daze flowering plant for my mom when I went out to walk one day. It adds some colour to the nature in the yard. It is beautiful. I was told that blue flowers are rare. My friend says that blue is relatively rare in nature due to chemical and physical challenges in producing this color in living organisms. Nothing exists completely on its own. Plants depend on insects and other creatures, while those creatures depend on plants and their flowers. There is an interconnectedness in creation that reminds me that God is intentional. Flowers are beautiful but so is everything else if we really consider things with an open mind. What is beauty? What makes some things more beautiful than others? They say that beauty is in the eyes of the beholder. Beauty is subjective. My friend says that what I am talking about is the perceptual mind where meaning ...

Softness

This is a chapter from my latest book called (G)rains (o)f san(d)s. Learn more about the book here . Thank you God for softness. The gentleness of prayer. The calmness of the heart. The patience of the mind. The soft sounds of nature. The cool breezes of shade. The slow movement of sand in the hand. The kindness of strangers. The soothing voices of Quran. The warm embrace of the azan. I move through life with softness in my heart. I move through life with joy. I move through life wishing good for others. There is a peace that comes with being soft. The angels surround those who are soft. Soft like the winds of heaven. Soft like the clouds in the sky. Easy like Friday morning. May I never lose this softness that allows me to see beauty and goodness in everything and everyone. The world tries to harden me but I refuse. I walk upon the earth softly. I love without fear. My every breath is a prayer of gratitude. Let my heart remain like grains of sand in the hands of God that are softly he...