v0.0.0-...-4524d0c Latest Latest

This package is not in the latest version of its module.

Go to latest
Published: Nov 7, 2023 License: Unlicense


How to Develope

.. image::

.. image::

.. .. image::

.. image::

.. .. image::

.. image::

.. .. image::

.. image::

.. See how to add travis ci image from

Development Tool: Pelican_ (static site generator written in Python)

Development Environment: `Ubuntu 20.04`_

First-time Setup

1. On a fresh/clean installation of Ubuntu, update system first. Otherwise will
   get unable to locate package error.
   See `this SO answer <>`__.

   .. code-block:: bash

     $ sudo apt-get update

2. Install git_ and pip_:

   .. code-block:: bash

     $ sudo apt-get install git
     $ sudo apt-get install python3-pip

   From the `answer in Ask Ubuntu <>`_,
   we can use python-is-python3 and prevent Python 2 from being installed
   on Ubuntu 20.04

   .. code-block:: bash

     $ sudo apt-get install python-is-python3
     $ sudo apt-mark hold python2 python2-minimal python2.7 python2.7-minimal libpython2-stdlib libpython2.7-minimal libpython2.7-stdlib

3. Install language packages to add locale (English, Traditional Chinese, and

   .. code-block:: bash

     $ sudo apt-get install language-pack-en
     $ sudo apt-get install language-pack-zh-hant
     $ sudo apt-get install language-pack-th

   Or you can install languages in "Settings" -> "Region & Language", which
   installs more related packages such as fonts for languages.

4. git clone source code:

   .. code-block:: bash

     $ cd
     $ mkdir dev
     $ cd ~/dev/
     $ git clone --depth=1
     # or clone with full depth
     $ git clone

5. Install Python tools:

   .. code-block:: bash

     $ cd ~/dev/userpages/
     $ pip3 install -r requirements.txt

   Note that in `.travis.yml <.travis.yml>`_, pip is actually pip3 if bionic and
   python 3.8 is set in Travis CI config.

6. Install Pelican `i18n_subsites`_ plugin and download `normalize.css`_:

   .. code-block:: bash

     $ cd ~/dev/userpages/
     $ make download

7. Generate CSS file:

   .. code-block:: bash

     $ cd ~/dev/userpages/
     $ make scss

Daily Development

.. code-block:: bash

    # start edit and develope
    $ cd ~/dev/userpages/
    # re-generate the website and start dev server
    $ make
    # open your browser and preview the website at http://localhost:8000/

Auto-deploy by GitHub Actions

See `workflow file <.github/workflows/pelican.yml>`_

Auto-deploy by `Travis CI`_ (Obsoleted)

See `GitHub Pages Deployment - Travis CI`_.

First save your `personal access token`_ in `repository settings`_.

For User Pages, the following is sample config:

.. code-block:: yaml

    provider: pages
    repo: USERNAME/
    target_branch: master
    skip_cleanup: true
    github_token: $GITHUB_TOKEN
    local_dir: output
      branch: master

For Project Pages, the following is sample config:

.. code-block:: yaml

    provider: pages
    skip_cleanup: true
    github_token: $GITHUB_TOKEN
    local_dir: output
      branch: master

Deploy to `GitLab Pages`_ via `GitLab CI/CD`_

See `.gitlab-ci.yml <.gitlab-ci.yml>`_.

1. Use `Ubuntu image in Docker Hub <>`_.
   The *ubuntu:latest* tag points to the "latest LTS".

2. Need to update Ubuntu first to install Ubuntu packages.
   See `this SO answer <>`__.

3. `Travis CI`_ can deploy to any repository, but need `personal access token`_
   to do so.
   `GitLab CI/CD`_ can deploy to the repository where CI/CD runs without


All works, including posts and code, of Siong-Ui Te are released in public domain.
Please see UNLICENSE_.


.. [1] `pelican-edit-url <>`_
       inspires the *Edit on Github* link.

.. [2] | JINJA_FILTERS in `Settings — Pelican documentation <>`_
       | `Jinja custom filters documentation <>`_

.. [3] | Home Screen Icon on Android/iPhone & PWA support
       | `website icon on android home screen - Google search <>`_
       | `Tutorial: Home Screen Icons | Responsive Web Design Training Tutorial | Webucator <>`_
       | `pwa manifest - Google search <>`_
       | `WebPageTest - Website Performance and Optimization Test <>`_

.. [4] | `Add single page application support for Github pages · Issue #408 · isaacs/github · GitHub <>`_
       | `GitHub - rafgraph/spa-github-pages: Host single page apps with GitHub Pages <>`_
       | `S(GH)PA: The Single-Page App Hack For GitHub Pages — Smashing Magazine <>`_
       | `GitHub - dmsnell/gh-pages-404-redirect: Can I use a custom 404 handler on GitHub pages to host a routed single-page app? <>`_
       | `Redirect a GitHub Pages site with this HTTP hack | <>`_
       | `javascript - Is there a configuration in Github Pages that allows you to redirect everything to index.html for a Single Page App? - Stack Overflow <>`_

.. [5] | `github pages symbolic link - Google search <>`_
       | `Pages: allow symlinks · Issue #553 · isaacs/github · GitHub <>`_
       | `Added .nojekyll to workaround symlink issue in GitHub Pages. Ref: isaacs/github#553 · siongui/paligo@b9fe689 · GitHub <>`_

.. _Pelican:
.. _Ubuntu 20.04:
.. _git:
.. _pip:
.. _i18n_subsites:
.. _normalize.css:
.. _Travis CI:
.. _GitHub Pages Deployment - Travis CI:
.. _personal access token:
.. _repository settings:
.. _GitLab Pages:
.. _GitLab CI/CD:
.. _Google Adsense:


Path Synopsis
Handling JSON Post Request in Go
Handling JSON Post Request in Go
Sort file by size
Sort file by size
Google Search: html history api
Google Search: html history api
RSS: SQLite:
RSS: SQLite:

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL