Skip to main content

Part 2 - An Example of Using Next.js for Static Site Generation on Android with Termux

See also part 1 - https://trinbagotechie.blogspot.com/2023/06/part-1-example-of-using-nextjs-for.html


It turned out to be as simple as importing the json file directly. What pointed me in that direction was this Stack Overflow 


I also discovered basePath config option which is useful for github pages. I also read that getStaticProps uses caching so it would be a better option in that sense rather than importing the json file directly. But that would apply if I was running my app as a server app.

A lot of places tell you JSX expressions must have one parent element and show you how to use fragments and short syntax with empty tags but they don't explain why there is this "limitation". This blog post explains it.


I found this React explainer video useful


And this is the end result I wanted to achieve. A listing of all my blog posts deployed to github pages


Share your thoughts 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...