Skip to main content

Vidhi Mody

Coding? I do it for the cookies! 🍪

3 min read · January 22nd 2021

git: committed for life

GitHub had released a new feature: profile READMEs for quite some time now. Though, writing the file entirely in Github Markdown has it’s limitations, it didn’t stop me from playing around and exploring various possibilities. Sprinkle some Algolia DocSearch magic on Node.js, mix it with Github Actions and voilà, we have a self-updating profile README.

Algolia DocSearch

DocSearch is an awesome open source utility scrapper to create a search index for your website. All you need to do is create an account on Algolia and drop in a config.yaml which tells DocSearch which sections of your website to scrape and index. You can read more about it here.

Fetching Recent Posts

All the code for generating the README file exists in the index.js. This file contains a getRecentPosts() function which uses algoliasearch to get the posts scraped by DocSearch and returns an array of objects;

    url: //post url,
    title: //post title,

You can replace the logic in this function with that of your own using an RSS parser, database query or whatever method you prefer.

Generating the README using EJS

EJS is a simple templating language that lets you generate HTML markup with plain JavaScript. If you’re someone coming from Django, it is very similar to Django’s default templating engine.

Generating a markdown file is very simple with ejs. All you need to do is define a template and populate it with data. In our case, this data is sourced from the config.toml file.

This is what my toml file looks like:

firstName = "Vidhi"
lastName = "Mody"
role = "Software Developer"
about = """My career is developing software, but my life is adventuring. I am a curious person who enjoys figuring out the building blocks of the world, and rearranging them to build something even better. ¯\ (ツ) /¯ """

city = "Mumbai"
country = "India"
logo = ""

name = "github"
url = ""
logo = ""

name = "linkedin"
url = ""
logo = ""

name = ""
url  = ""
stars = ""
forks = ""

name = "Apply By AI"
url = ""
stars = ""
forks = ""

python = ""
go = ""
java = ""
javascript = ""
typescript = ""
npm = ""

There is a handy npm package for parsing toml files.

Defining the Github Actions

Take a look at the GitHub Action in my main.yml file. It’s configured to run everyday at 00:00 UTC.


Visit to have a look at the end result. It is really easy to build this auto updating profile page. Do share with me the other ideas y’all come up with! 😇


Tagged with git | secret | github actions