How to present your latest blog posts and YouTube videos on your GitHub profile

Stefan Natter 🇦🇹👨🏻‍💻 - Feb 22 '21 - - Dev Community

GitHub profiles got a big update in 2020. A GitHub profile can do more than just show your public repositories and your activities. You can add more information about yourself and your work to your profile. I show you how to do this in another article. Today I'll show you how to turn your GitHub profile into a promoter of your YouTube videos and blog posts in just a few minutes.

How to create a GitHub Profile Page

The very first thing you need to do is set up your GitHub profile. To do this, you need to create a new repository with the same name as your username. This looks something like this for my account: https://github.com/natterstefan/natterstefan. All you need now is a "README.md" file in which you enter the content. Push the changes into the repository and you will see the new data on your page. Here is my profile: https://github.com/natterstefan.

How to add blog posts and more to your GitHub profile

To do this we need to set up a GitHub action. As the name suggests, an action performs one or more tasks. In this case, we want the action to take an RSS feed as input and render the content on the profile as a list. Fortunately, we don't have to set this up ourselves but can use ready-made GitHub actions. For my profile, I use the following action: gautamkrishnar/blog-post-workflow. It also contains further documentation and setup notes.

First, you create a new folder .github/workflows in your repository. In this folder, we now create a file blog-post-workflow.yml. This tells GitHub that we want to set up a workflow. All that is missing is the content, and this one is also very simple.

name: Blog Posts

on:
  # Run workflow automatically
  schedule:
    # Runs every hour, on the hour
    - cron: '0 * * * *'

jobs:
  update-readme-with-blog:
    name: Update this repo's README with latest blog posts
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: gautamkrishnar/blog-post-workflow@master
        with:
          # comma-separated list of RSS feed urls
          feed_list: "https://blog.natterstefan.me/rss.xml"
Enter fullscreen mode Exit fullscreen mode

The GitHub Action must now know where to place the result in the README. To do this, insert this snippet into your README.md.

## 📕 Latest Blog Posts

<!-- BLOG-POST-LIST:START -->
<!-- BLOG-POST-LIST:END -->
Enter fullscreen mode Exit fullscreen mode

All we have to do now is commit the change, push it and wait for the action to run. The result will look similar to the one you'll see on my page:

GitHub Action Result

How to use Hashnode's RSS Feed

Each blog on Hashnode has an RSS feed attached automatically. Just add /rss.xml to the domain to view it (e.g. https://blog.natterstefan.me/rss.xml).

How to set up YouTube

As for YouTube, you can either use a YouTube Playlist or the YouTube Channel Video list as an input.

  • https://www.youtube.com/feeds/videos.xml?playlist_id=<playlistId>
  • https://www.youtube.com/feeds/videos.xml?channel_id=<channelId>

Share 💛

Do you like this article? Do you want to support me? Tell your friends on Twitter about it. Thank you!

Questions and Feedback

You got any questions or want to add your thoughts? Let me know in the comments below, please.

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .