1
0 Comments

Your blog's 'front page' is now working

If you go to a blog, it'll show article previews - starting with the newest. This is based on the order articles are added to the database - oldest to newest (top/down). Then we reverse the array of articles to have the newest ones first.

It's taken a bit of time to get this page working. Previously, I wasn't storing article content in the database - it was in GitHub. Because of this, there didn't seem to be a good way to display articles on the front page of a blog.

Now, when you upload a new article to your repo, we parse the markdown, gather some data/content, and store a copy in our database.

Slightly off-topic:

This also saves API requests to GitHub. As an authenticated GitHub app, we are allowed 5,000 requests per hour per repo.

Since a copy of the content is now in the database, I can begin refactoring code to pull individual article requests from there too. Right now, when you go to an article (not the main blog page), it pulls the data from the cache if it can, then grabs it from GitHub.

Once this refactoring is complete, the only time we should be making a request to GitHub for content is when you add or update an article.

Trending on Indie Hackers
Best Gumroad Day Ever 18 comments 4 of my biggest mistakes from 2 years of building 👎 16 comments Uncomfortable = Learning 12 comments "all that can be invented has been invented" syndrome, how do you deal with it? 11 comments From 13 followers to 1000 in less than 2 weeks 😱 9 comments My Newsletter Mention Brought More Traffic Than Product Hunt 3 comments