Hello World
Welcome to my website! This is my first post, and it’s going to be about how I set up this website: how I got the dependencies and how I was able to publish to github pages.
Getting this website up and running required one night’s worth of work. So, if you want to dot the same for your github page, here’s how you can do it:
Getting dependencies and development container
hexo-icarus-theme is the main dependency of this site. To avoid accidentally breaking your website should the theme be updated AND for future customization-ility, we are going to fork the theme repo on Github and pull it locally.
1
2# dont forget to fork on GH first
gh repo clone <your-gh-username>/hexo-icarus-themeLet’s create a new repo to hold the website source tree. This will be the repo that you will push to Github Pages.
1
2
3mkdir $USER.github.io
cd $USER.github.io
git initYou might want to change
$USER
to your Github user or organization name.Next is a Dockerfile that will build your site locally in a “controlled environment”: no polluting your machine with node stuff, development isolation, etc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17# Dockerfile
## Base and dependencies
FROM node:22.5.1-alpine3.19 AS base
WORKDIR /workspace
RUN npm install -g hexo-cli
## Copy sources for build
FROM base AS build
COPY . /workspace
RUN hexo generate
## Deploy
FROM nginx:1.21.3-alpine
COPY --from=build /workspace/dist /usr/share/nginx/html
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]Add a .devcontainer for development purposes (things might break and you might want to debug why)
1 | # .devcontainer/compose.yml |
- You can now init the site, add icarus theme as a submodule, and start the server
1 | docker compose -f ./devcontainer/compose.yml up -d --build |
- Get the experimental dark theme and apply it
1 | cd themes/icarus |
add .gitignore for things like
node_modules
etcfix the
_config.yml
and_config.icarus.yml
to your liking.
Make sure to follow icarus docs. For more information.
Deploying to Github Pages
The easiest way to deploy to Github pages is to follow the example from deploy-pages action.
Checkout my workflow for this website.
install_url
to use ShareThis. Please set it in _config.yml
.