Our new website is located at https://chinacomx.github.io
and build using GitHub pages. We use a custom-made theme for Jekyll by damianodamiani with GPT-4o.
To preview and work on the website on your computer you need to have a recent version of ruby
and and of jekyll
installed. If you run into issues with your installation please check the full installation instructions by jekyll.
On macOS 13 or higher, you also need to have 'Xcode' or 'Command Line Tools for Xcode' installed. As the full version of Xcode is quite heavy, having the command line tools installed is also sufficient. You can download the installation files here.
If you maintain multiple sites, we recommend using rbenv to manage the parallel installation of mutliple ruby environments.
You only need to do this once. Use homebrew
to install the latest ruby.
-
Either install the latest ruby for your system
brew install ruby
or use
rbenv
:rbenv install 2.7.2
(rbenv is recommended for macOS on apple silicon)
-
Then add ruby to your path (not necessary with
rbnev
)echo 'export PATH="/usr/local/opt/ruby/bin:$PATH"' >> ~/.zshrc
-
Now install jekyll
gem install bundler jekyll
Note: If you are still using bash
instead of zsh
type brew info ruby
to see the correct command for your system.
For rbenv
users drop the --user-install
flag when installing gems.
The current stable version of ruby is 3.3.3. You can check your ruby version with:
ruby -v
To upgrade to the latest rbenv and update ruby-build with newly released Ruby versions, upgrade the Homebrew packages:
brew upgrade rbenv ruby-build
Upon first installation or upgrading ruby to a new version, you should run:
bundle install
and then
bundle update
If you have the necessary tools installed, check out this repo in GitHub Desktop then open it in your Terminal and type the following:
bundle exec jekyll serve
You should see something like this:
...
Server address: http://127.0.0.1:4000
Server running... press ctrl-c to stop.
Open the server address in your browser and you can see what your changes will look like on the webpage.
You would normally press ctrl-c
to stop the server in the terminal window. If you can no longer locate that terminal here is a handy shortcut to stop the local server from a new terminal.
ps aux |grep jekyll |awk '{print $2}' | xargs kill -9
As a rule, we do not add edits directly onto the main branch. Always create a new branch and name it in such a way that tracing it back is esay. Add all the changes to the branch locally, run locally to see if all works fine. If you're satisfied, you can proceed to publishing and commiting the chagnes.
As you are most likely to mainly work on adding new posts, please make sure to follow a correct naming pattern for new posts:
2024-10-01-exciting-news.md
And also make sure to always include this header - with accordingly adjusted title
date
and image
fields - in each new post too:
---
layout: post
title: "Exciting News"
date: 2024-10-01
categories: jekyll update
image: /assets/images/AddImageHere.jpg
---
To publish you changes commit them into their own branch and open a pull request against the main
branch. A GitHub workflow will build the site and push to gh-pages
automatically after your PR has been merged. Do not commit changes to gh-pages
directly.