Creating a custom GitHub profile page
There's a new feature on GitHub to display a custom README file on your profile page. Despite this feature not being officially documented, it gained a lot of popularity over the last few weeks. Let's see how it's done:
- Create a new GitHub repository. The repository name has to match your GitHub username. For me it's darekkay/darekkay.
- Create a
README.mdfile and include any content to be displayed on your profile page.
If all you want to show is static content, you're done 🎉
It didn't take long for people to start automating things to display dynamic information, like stats, badges or latest tweets. View the works from Simon Willison, Zhi Yang and Katie McLaughlin for some inspiration.
I decided to display the last 3 posts from my blog. A GitHub Action runs a
sync.js script on every
git push and once a day via
cron. The script fetches my RSS feed, extracts the title and URL for the last 3 posts, and updates the "latest posts" section in the README. Finally, the GitHub action commits any changes and pushes them back to the repository.
Check out the code and feel free to reuse it any way you want. Be creative 🎨
Want to leave a comment?
Join the discussion at Twitter or Mastodon. Feel free to drop me an email. 💌