Hugo is created based on go. A respected and fast programming language.
So, the technology stack is nice. beside that, it is based on Markdown. There are few alternatives of Hugo.
Like pelican, based on Python: No hard feelings. I found a lots of prebuilt themes, which make the boring task easy.
and you know what , when I know what hugo can do.
I need
proper code formatting in the blog
proper user commenting in each posts
google analytics
animation stuff
tags
categories
search
—— blah blah , and I dont need write any html and css. That’s awesome.
baseURL="http://example.org/"# [en, zh-cn, fr, ...] determines default content languagedefaultContentLanguage="en"# language codelanguageCode="en"title="My New Hugo Site"# Change the default theme to be use when building the site with Hugotheme="LoveIt"[params]# LoveIt theme versionversion="0.2.X"[menu][[menu.main]]identifier="posts"# you can add extra information before the name (HTML format is supported), such as iconspre=""# you can add extra information after the name (HTML format is supported), such as iconspost=""name="Posts"url="/posts/"# title will be shown when you hover on this menu linktitle=""weight=1[[menu.main]]identifier="tags"pre=""post=""name="Tags"url="/tags/"title=""weight=2[[menu.main]]identifier="categories"pre=""post=""name="Categories"url="/categories/"title=""weight=3# Markup related configuration in Hugo[markup]# Syntax Highlighting (https://gohugo.io/content-management/syntax-highlighting)[markup.highlight]# false is a necessary configuration (https://github.com/dillonzq/LoveIt/issues/158)noClasses=false
# Home page config[params.home]# LoveIt NEW | 0.2.0 amount of RSS pagesrss=10# Home page profile[params.home.profile]enable=true# Gravatar Email for preferred avatar in home pagegravatarEmail=""# URL of avatar shown in home pageavatarURL="/images/avatar.png"# LoveIt CHANGED | 0.2.7 title shown in home page (HTML format is supported)title=""# subtitle shown in home pagesubtitle="Personal Blog / Scribbles"# whether to use typeit animation for subtitletypeit=true# whether to show social linkssocial=true# LoveIt NEW | 0.2.0 disclaimer (HTML format is supported)disclaimer=""# Home page posts[params.home.posts]enable=true# special amount of posts in each home posts pagepaginate=6# LoveIt DELETED | 0.2.0 replaced with hiddenFromHomePage in params.page# default behavior when you don't set "hiddenFromHomePage" in front matterdefaultHiddenFromHomePage=false
Now lets share what we have created here. But to do that we need to create static site from this markdown.
Because only static site is get hosted on the github. No worries, all handled by Hugo.
Create a repo in the github based on your <username>/github.io and add it as submodule in the folder.
1
git submodule add -b master https://github.com/<username>/<username>.github.io.git public
As, suggested by our mighty Hugo, create a deploy.sh file and it here.
#!/bin/sh
# If a command fails then the deploy stopsset -e
printf"\033[0;32mDeploying updates to GitHub...\033[0m\n"# Build the project.hugo -t loveit # if using a theme, replace with `hugo -t <YOURTHEME>`# Go To Public foldercd public
# Add changes to git.git add .
# Commit changes.msg="rebuilding site $(date)"if[ -n "$*"];thenmsg="$*"figit commit -m "$msg"# Push source and build repos.git push origin master
Basically, it generate static site push the code to github. make sure everything working.Now make the script executable.