My personal site, forked from: al-folio
Assuming you have Ruby and Bundler installed on your system (hint: for ease of managing ruby gems, consider using rbenv), first fork the theme from github.com:alshedivat/al-folio
to github.com:<your-username>/<your-repo-name>
and do the following:
$ git clone [email protected]:<your-username>/<your-repo-name>.git
$ cd <your-repo-name>
$ bundle install
$ bundle exec jekyll serve
Now, feel free to customize the theme however you like (don't forget to change the name!). After you are done, commit your final changes.
Deploying your website to GitHub Pages is the most popular option. Starting version v0.3.5, al-folio will automatically re-deploy your webpage each time you push new changes to your repository! ✨
For personal and organization webpages:
- Rename your repository to
<your-github-username>.github.io
or<your-github-orgname>.github.io
. - In
_config.yml
, seturl
tohttps://<your-github-username>.github.io
and leavebaseurl
empty. - Set up automatic deployment of your webpage (see instructions below).
- Make changes, commit, and push!
- After deployment, the webpage will become available at
<your-github-username>.github.io
.
For project pages:
- In
_config.yml
, seturl
tohttps://<your-github-username>.github.io
andbaseurl
to/<your-repository-name>/
. - Set up automatic deployment of your webpage (see instructions below).
- Make changes, commit, and push!
- After deployment, the webpage will become available at
<your-github-username>.github.io/<your-repository-name>/
.
To enable automatic deployment:
- Click on Actions tab and Enable GitHub Actions; do not worry about creating any workflows as everything has already been set for you.
- Make any other changes to your webpage, commit, and push. This will automatically trigger the Deploy action.
- Wait for a few minutes and let the action complete. You can see the progress in the Actions tab. If completed successfully, in addition to the
master
branch, your repository should now have a newly builtgh-pages
branch. - Finally, in the Settings of your repository, in the Pages section, set the branch to
gh-pages
(NOT tomaster
). For more details, see Configuring a publishing source for your GitHub Pages site.
(click to expand) Manual deployment to GitHub Pages:
If you need to manually re-deploy your website to GitHub pages, run the deploy script from the root directory of your repository:
$ ./bin/deploy
uses the master
branch for the source code and deploys the webpage to gh-pages
.
(click to expand) Deployment to another hosting server (non GitHub Pages):
If you decide to not use GitHub Pages and host your page elsewhere, simply run:
$ bundle exec jekyll build
which will (re-)generate the static webpage in the _site/
folder.
Then simply copy the contents of the _site/
foder to your hosting server.
Note: Make sure to correctly set the url
and baseurl
fields in _config.yml
before building the webpage. If you are deploying your webpage to your-domain.com/your-project/
, you must set url: your-domain.com
and baseurl: /your-project/
. If you are deploing directly to your-domain.com
, leave baseurl
blank.
(click to expand) Deployment to a separate repository (advanced users only):
Note: Do not try using this method unless you know what you are doing (make sure you are familiar with publishing sources). This approach allows to have the website's source code in one repository and the deployment version in a different repository.
Let's assume that your website's publishing source is a publishing-source
sub-directory of a git-versioned repository cloned under $HOME/repo/
.
For a user site this could well be something like $HOME/<user>.github.io
.
Firstly, from the deployment repo dir, checkout the git branch hosting your publishing source.
Then from the website sources dir (commonly your al-folio fork's clone):
$ bundle exec jekyll build --destination $HOME/repo/publishing-source
This will instruct jekyll to deploy the website under $HOME/repo/publishing-source
.
Note: Jekyll will clean $HOME/repo/publishing-source
before building!
The quote below is taken directly from the jekyll configuration docs:
Destination folders are cleaned on site builds
The contents of
<destination>
are automatically cleaned, by default, when the site is built. Files or folders that are not created by your site will be removed. Some files could be retained by specifying them within the<keep_files>
configuration directive.Do not use an important location for
<destination>
; instead, use it as a staging area and copy files from there to your web server.
If $HOME/repo/publishing-source
contains files that you want jekyll to leave untouched, specify them under keep_files
in _config.yml
.
In its default configuration, al-folio will copy the top-level README.md
to the publishing source. If you want to change this behaviour, add README.md
under exclude
in _config.yml
.
Note: Do not run jekyll clean
on your publishing source repo as this will result in the entire directory getting deleted, irrespective of the content of keep_files
in _config.yml
.
If you installed al-folio as described above, you can upgrade to the latest version as follows:
# Assuming the current directory is <your-repo-name>
$ git remote add upstream https://github.com/alshedivat/al-folio.git
$ git fetch upstream
$ git rebase upstream/v0.3.5
If you have extensively customized a previous version, it might be trickier to upgrade.
You can still follow the steps above, but git rebase
may result in merge conflicts that must be resolved.
See git rebase manual and how to resolve conflicts for more information.
If rebasing is too complicated, we recommend to re-install the new version of the theme from scratch and port over your content and changes from the previous version manually.