tdkyo

Clean and Undisturbed Space for Thoughts and Writing

    Setting Up Hugo

    In general, writing stuff down helps you to retain information. Also, hanging out in third-party social media websites affects productivity, creativity, and sanity.

    These two seemingly random thoughts are the reason why I decided to spend a few hours learning about website hosting and all the self-host options that could give me a clean and undisturbed space to collect my thoughts and write down useful information that I know I would revisit later.

    Although I used Pelican to setup a static website, I decided to give Hugo a try. As always, learning about a new system always takes time in the beginning, but I felt that learning about Hugo–including the incredible template system and its flexible customization option–would be worth my time. So far, I was able to install Hugo on my VPS server easily, and I spent a couple of hours figuring out the template system.

    I found the following features quite attractive for Hugo:

    • Static website generation
    • Markdown support
    • Live “preview” server support
    • Active development community

    Static website generation

    In the past, I ran a lot of Content Management Systems (CMS) that used a combination of PHP and MYSQL to run a dynamic website. Although CMS has its place under certain circumstances, the constant maintenance it requires created a liability risk for the potential that hackers would attempt to hijack the site via unpatched security vulnerabilities.

    In that regard, static website generators are wonderful, because there are only static files. I don’t have to worry about constantly patching PHP and MYSQL services while making sure that my CMS is up-to-date. Also, I am mostly hosting static content on this website (text and media files), so I do not require any interactive features that are available on a dynamic CMS.

    Markdown support

    Before I found out about Markdown, I dreaded my time trying to convert my draft writings from a Word Processor (or a text editor) to an HTML compliant form. Yes, there are various WYSIWYG editors out there, but those editors tend to either (1) produce a lot of junk HTML code (e.g., empty HTML tags that only clutter the source code, and (2) produce a lot of metadata junk HTML code whenever I paste something from Microsoft Word.

    Hugo and other static website generators allow drafting and publishing text content via Markdown format. This allows me to draft my text in whatever interface I prefer (Microsoft Word) and paste it on my favorite text editor (Notepad++) with very light formatting, and I am done. I can spend less time on formatting content and spend more time on writing.

    Live “preview” server support

    There are a lot of competing static website generators out in the open source community, and I think people should try multiple solutions before investing in one program. One feature that caught my attention while using Hugo was a live “preview” server mode, where you can have Hugo continuously render the website in the background while you make changes within your Hugo work directory. The preview mode actually does not publish your website with the latest changes. Instead, if you are looking to make a substantive change on the backend, the “preview” server feature can allow you to see those changes without having to publish the site at a temporary location.

    I personally used this feature while working on my custom template, and it really saved me a lot of time! The command for starting up Hugo’s live “preview” server is:

    hugo server

    By default, the preview server will bind to “127.0.0.1,” which would make it inaccessible if you are remotely administrating the server. Thus, if you want to use the preview feature and view the preview changes remotely, try:

    hugo server --bind yourserverurl.com

    where yourserverurl.com is your server’s address. After running this command, you can browse to the preview server via port 1313. (example: yourserverurl.com:1313 on your browser)

    Active Development Community

    Finally, Hugo seems to have a very active development community with a lot of premade templates available and a robust community to help users and inform developers. I had some issues while developing my template, and I was able to get answers to most of my questions by searching around past community posts.

    Moving Forward

    I have most of my barebone template files done. I am still learning the ins and outs of Hugo, but I think I have a good online writing setup ready to go.

    What’s next? I have an unorganized collection of website links, codes, and some random thoughts that I saved on my Google Keep account. I will start memorializing (a legal term meaning “to do something that helps people to remember.” See memoralize - TransLegal) my collection data via posts on this website.

    As I mentioned at the beginning of this post, the main purpose of this website is to provide a clean and undisturbed space for myself to collect my thoughts and write down useful information that I know I would revisit later. My secondary purpose is to continue to practice good writing and share my knowledge and thoughts with the rest of the world.

    Thanks for visiting!