Automatic Dynamic Sidebars in Vuepress

How can you get automatic sidebars to be generated in Vuepress depending on the page? The Situation Vuepress is simple. Being simple is rather difficult. In the case of Vuepress, the difficulty can show up in unexpected places. Starting with Vuepress is simple enough. Equally simple is enabling navigation on your site at multiple levels through a “sidebar” and/or a “navbar”. Specifically for the sidebar - you can enable in by adding a couple of lines in /docs/.vuepress/config.js. ...

Using Vuepress and other stories

I am a big fan of Vue and cannot breathe without static sites. So, it is only natural that I play around and implement Vue-based static sites for fun and profit. Here’s a distilled-down version of my experience with Vuepress. The Situation I create static sites that are “real” websites. Typically the following factors in a static site generator help - A cool, easy-to-customise home page Themes/starter projects that make life easy Plugins that can extend functionality of core software Although I had played around Vuepress quite a bit, I always ended up choosing non-Vue technologies like Hugo, or Vue-based static site generators like Gridsome or Saber.land. ...

Simple Site Summary in Hugo

Here’s a simple way to organize your taxonomies and have a bird’s eye view of the number of posts per category/tag in Hugo. The Problem As techformist.com grew, I became more and more disorganised in maintaining taxonomies. I had some interesting situations - a “static-site” category coexist with “static sites” category confusion b/w why I chose a few terms to be tags rather than categories in their own right the recurring need to “rethink taxonomy structure” depending on the flavour of the month and time of the day This often required me to go back and change a few taxonomy terms, or to reorganize site structure in order to provide better visibility to chosen topics. ...

Host your own site - 2020 edition

Medium, Dev.to, Hashnode, Wordpress? Or, why should you invest in yourself rather than in platforms? The Problem Developers should write and write often. It may be anything - code snippets, ideas, thoughts, design principles, standards and what not. I have found that writing down things often forces me to solidify abstractions and get more clarity. But, where to write? The Options Wordpress is the past. Though I continue to host a few of my blogs - it is just laziness preventing me from migrating over to better things. Wordpress is often slow, theme design is frustrating (if you are not in WP/PHP world that is), and in general does not carry itself quite well nowadays. ...

Include full content in site feed in Hugo

Include all content of your posts in your site feed when using Hugo static site generator. By default Hugo will include only summary in your website feed (e.g. in /index.xml). Your theme may already provide a way to provide full content instead of just the summary. If it doesn’t, you can make those simple changes yourself. Create a new file rss.xml in layouts\_default\ folder in your site root directory. Include following content (as of v0.58) - ...

Crazy space utilization in VSCode

Running out of space? You have VSCode and love tinkering with it? Then do this. Well the introductory line is cheesy and shows desperation for clicks. So, I had to have them. And - no, this is not even a secret. VSCode stays sane until it goes insane with storage space. But somehow I did not know my own drive utilization for a long, long time. Caution: Before you start deleting things. ...

Commit to blog daily - it's smart and stupid

Daily blogging by itself is not a bad thing. I changed tracks a year back to get back to development after a million years of doing something else. I thought through the idea of blogging daily, what I was going to write about, and how that would pan out through days and months. The premise was simple - learn something, and record that for yourself. The world may benefit from it if it chooses to. ...

2019-09-30 5 min

Add PWA to your Hugo site

Adding PWA to your Hugo static site is quite easy. What is PWA and why should I add it? Progressive web applications (PWA) are a nice way to give your websites an “app makeover”. Using PWAs your sites are perceived to load faster, are available offline, and in general improve user experience. PWAs are supported by all web browsers. Using PWAs on single page applications have shown remarkable improvement in site speed and have provided us the ability to continuing to serve static content even when the connectivity is down. ...

Prevent test emails going out to users in AdonisJS

Here’s a quick way to prevent emails from going out in test environments in AdonisJS. We typically end up getting production data in part or in whole to test environments for a “proper” round of testing on real data. But all the data attributes cannot be so “real”. We typically end up changing fields like emails so that customers do not start receiving emails from non-production environments. In addition to the above change, we try to specify an explicit opt-in to communications so that people who are not associated with testing do not get confused with test transactions - even when the said people are within the client organization. ...

Production to test migration strategy

While we love to have production-like environments for user testing, managing data and the test environments can present unique challenges. In today’s enterprises it is fairly common to have multiple test environments including staging, system / user testing environments and so on. These environments expect production-like features but only for specified users. For example - Validations have to work as they are in production Document templates and document merge has to work Email and SMS communications have to work for select users Logins have to work for select users A few staging environments may need data in volume - what better data can you find outside of your own production environment? As is the norm for typical enterprise applications, I tend to - ...