skip to main content

My blogging workflow


I use VS Code for writing blog posts.

VS Code is a fantastic editor that was needed on Linux. I have been using Visual Studio Code since day 1 of its release. I used Adobe brackets for almost two and half years before that for all my frontend editing needs, but ever since Visual Studio caught up to Brackets, I made it my sole editor for web development.

I still think Brackets is a great editor, but I can't miss the brilliance of VS Code. Now that almost all the plugins exist for VS Code, there is no need to look back. VS Code has a fantastic release cadence and brings great features with each release. What's not to like?

I just wish there was more support for templating languages like Jinja2, Django. I manually indent code whenever HTML is mixed with templating languages.

I set a build task for this site to run the command lektor server. For Visual Studio users, Ctrl-Shift-B is the build command. VS Code has the same action for this keybinding. When you press Ctrl-Shift-B for the first time in a project, VS Code will prompt you to configure a build task.

VS CodeVS Code Configure Build Task

Press Configure Build Task and select the Others task runner for manual configuration and add the following configuration.

    "version": "2.0.0",
    "tasks": [
            "taskName": "lektor-run",
            "command": "lektor",
            "type": "shell",
            "args": ["server"],
            "group": {
                "kind": "build",
                "isDefault": true

If you want to serve on another port, update the args property like this: ["server", "-p", "5001"]. That is it, your Ctrl-Shift-B is ready.

Version Control

I do content authoring on and push commits off the master branch. I also use another experimental branch to add new features to the static site. I try not to do major style changes on the experimental branch to reduce merge conflicts.

Here are my commits for this quickstart example. I group changes of one feature into a commit:

Aug 15, 2017    Configure build task
                Add categories and update posts with categories
Aug 14, 2017    Add table of contents to posts that have headings
                Add atom feed
                Add post excerpt
Aug 13, 2017    Initial configuration
                First commit

I use gitlab for hosting my git repository. Every push triggers a CI job which builds and deploys the content to the server.

If you decide to use Gitlab, you can learn the process of deploying to Gitlab pages using these two articles.

  1. Getting Started with Gitlab Pages
  2. Lektor with Gitlab Pages

Website Checklists

Once the job finishes, I verify the blog manually on the desktop and one or two mobiles and the Chrome emulator. After this, I use a few tools to make sure the performance is good and the mobile friendliness is intact.

  1. Google Pagespeed Insights
  2. Varvy
  3. GTMetrix
  4. WebPageTest

Based on the advice from these sites, I adjust things to control site performance after the push of a new article and/or a feature.