Initial setup for hugo (2)

Date: 2019/02/09 (initial publish), 2021/08/02 (last update)

Source: en/note-00002.md

Previous Post Top Next Post

TOC

Costomization wishlist

Let’s customize web site contents.

  1. I want to have 2 separate directories for English and Japanese contents.
  2. Main menu should have link to the list of contents dedicated for English and Japanese contents
  3. The list of contents needs to be customized.

The following pages gave me good starting points.

Customization example

Here are what I did:

Then create a github repository osamuaoki-hugo via github GUI and commit this source for hugo.

 $ git add -A .
 $ git commit -m "updated webpage source"
 $ git remote add origin git@github.com:osamuaoki/osamuaoki-hugo.git
 $ git push -u origin master

See published source of this site at https://github.com/osamuaoki/osamuaoki-hugo

Publishing HTML pages

At /path/to/<webbuildtree>, execute hugo to build HTML files under /path/to/<webbuildtree>/publish directory.

Then create a github repository osamuaoki.github.io via github GUI and commit this generated HTML files.

 $ hugo
 $ cd public
 $ git init
 $ git add .
 $ git commit -m "built webpages"
 $ git remote add origin git@github.com:osamuaoki/osamuaoki.github.io.git
 $ git push -u origin master

This publishes web page at https://osamuaoki.github.io/

Let’s use git submodule to manage these 2 repositories.

 $ cd ..
 $ rm -rf public
 $ git submodule add git@github.com:osamuaoki/osamuaoki.github.io.git public
 $ git add .
 $ git commit -m "add submodule"

Here, publication of github pages is realized by committing static HTML pages to a certain branch of a certain github repository to enable github pages.

repository branch URL used to publish web pages
<username>.github.io master https://<username>.github.io
<project> gh-pages https://<username>.github.io/<project>

For more, follow Host on GitHub

Updating webpages

 $ cd /path/to/<webbuildtree>/content
  ... hack source
 $ cd /path/to/<webbuildtree>
 $ git add -A .
 $ git commit -m "updated source"
 $ hugo
 $ cd publish
 $ git add -A .
 $ git commit -m "updated webpages"
 $ cd ..
 $ git commit -a -m "updated submodule for webpages"

Date

Normally, hugo doesn’t publish future date unless -F is specified.

So please consider to include date: to include full date --iso=sec output as follows.

title: Initial setup for hugo (2)
date: 2019-02-09T11:15:56+09:00
categories:
  - web
  - english
tags:
  - hugo
slug: initial-setup02
date: 2019-02-09T00:00:00+09:00
date: 2019-02-09T23:59:59+09:00

If time zone is omitted, hugo seems to use UT.

Draft

Add following to the header of the source.

date: 2999-12-31
draft: true

Check the resulting page with hugo -F -D server to include darft and future dated page.

salsa (debian) page

TODO

For more, follow Host on GitLab while using pages.debian.net instead of gitlab.io and Web page hosting.

Previous Post Top Next Post