Skip to main content

My Experience using Hugo and Firebase Hosting with Termux on Android

Edit - Read about Google Play version of Termux

https://wiki.termux.com/wiki/Termux_Google_Play


First thing I did was install Termux from Play Store

https://play.google.com/store/apps/details?id=com.termux


Next I installed nodejs which I had done before and documented here on this blog

https://trinbagotechie.blogspot.com/2020/04/experience-termux-nodejs-android.html


Next thing I did was install firebase-tools under Termux

npm install -g firebase-tools


Follow the steps from official Firebase documentation to create a new project

https://firebase.google.com/docs/hosting/quickstart


I got the following error - Failed to create project because there is already a project with ID. I was using web-test. Id must be unique globally across all users of firebase. Finally I was able to create a project, modify the index.html and deploy. This is the result.

https://trinbagotechie-web-test.web.app


This was simple enough so I decided to make it interesting by creating a hugo project

apt install hugo


Follow hugo getting started guide

https://gohugo.io/getting-started/quick-start/


Remember to modify baseURL in config.toml and this was my result.

https://trinbagotechie-hugo-test.web.app

Comments

Popular posts from this blog

Hobby project - Store and view exchange rates

The next step in my project was to test out being able store and display the rates in a database. I decided to use nodejs and supabase for this. Everything worked beautifully. Only hickup was the following error due to my package.json not being correct. SyntaxError: Cannot use import statement outside a module Added this to package.json   "type": "module" This works beautifully. Right now I am just testing fragments of what could be part of a bigger system to see what is possible and what works and how easy to code on a mobile. There is no fully functioning integrated end to end system just yet. This is also what I tested. A serverless append-only database using GitHub + Actions + Pages. That’s basically a lightweight backend system. This was the ChatGPT prompt I used. Guide me through each step. This is what I want. A manually run github actions that adds to docs/data.json with the current date and time. docs/index.html displays all the entries in data.json. Make s...

What is important

Every now and again, I get reminded of the why. Why I have handed my life over to God. It is 3:08 p.m. and I have decided to write. Honestly, I feel like I could end this blog post right here. What more is there to say? God above all else. God is our compass on this journey called life. Everything else can become a distraction. Maybe not everything, but certainly many things. You get the point. What is important? What do we prioritise? What do we make time for? The answers look different for everyone. Our lives are different. We are tested differently. We are all products of our circumstances, and those circumstances vary from person to person. Yet God is the common thread across humanity and throughout time. God always was and always will be. One day, we will answer to God. We will give account to God. We cannot live without food, water, and oxygen, but all of those things come from God. So how can we live without God? How timely. I just received a notification from the Quranly app: S...

Hobby coding project - Queries for play whe data

I have an interest in open data and being able to query that data and gain beautiful insights. One data set that would be interesting is the play whe results data. Our open data is lacking in Trinidad and I will try to contact NLCB to see if they can provide and maintain the data online. But in the meanwhile I will use randomised data to create the website and do my testing. First thing I did was install sqlite on termux pkg update && pkg upgrade pkg install sqlite sqlite3 --version Create my database in my project folder sqlite3 results.db Useful commands .exit .quit Exit from multiline prompt ; SQL to create my table (create_tbl_results.sql) CREATE TABLE DrawResults (     DrawNo INTEGER PRIMARY KEY,                           DrawDate DATE,     ResultNo INTEGER CHECK (ResultNo BETWEEN 1 AND 36),     DrawTime INTEGER CHECK (DrawTime BETWEEN 1 AND 4) ); SQL to create the random dat...