Giter VIP home page Giter VIP logo

gismo-stack / userpages Goto Github PK

View Code? Open in Web Editor NEW

This project forked from siongui/userpages

0.0 0.0 0.0 145.23 MB

https://github.com/gismo-stack/userpages/blob/master/content/articles/2017/12/04/frontend-programming-in-go%25en.rst

Home Page: https://siongui.github.io/

License: The Unlicense

Shell 0.55% JavaScript 12.71% Python 9.41% C 0.31% Java 0.42% Go 36.59% Dart 2.32% CSS 3.09% Makefile 5.12% HTML 24.91% SCSS 4.58%

userpages's Introduction

How to Develope

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.

    $ sudo apt-get update
  2. Install git and pip:

    $ 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

    $ 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 Thai):

    $ 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:

    $ cd
    $ mkdir dev
    $ cd ~/dev/
    $ git clone https://github.com/siongui/userpages.git --depth=1
    # or clone with full depth
    $ git clone https://github.com/siongui/userpages.git
  5. Install Python tools:

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

    Note that in .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:

    $ cd ~/dev/userpages/
    $ make download
  7. Generate CSS file:

    $ cd ~/dev/userpages/
    $ make scss

Daily Development

# 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

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:

deploy:
  provider: pages
  repo: USERNAME/USERNAME.github.io
  target_branch: master
  skip_cleanup: true
  github_token: $GITHUB_TOKEN
  local_dir: output
  on:
    branch: master

For Project Pages, the following is sample config:

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

See .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 credentials.

UNLICENSE

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

References

[1]pelican-edit-url inspires the Edit on Github link.
[2]
[3]
[4]
[5]

userpages's People

Contributors

siongui avatar paritystsai8 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.