Build an academic website with the stylish look of the popular al-folio template, but using Python, not Ruby. This is a port of the al-folio template for the Pelican static site generator and the Jinja templating engine. All credit to the original authors of this fantastic template!
Want to see what the result looks like? It's almost identical to al-folio, and you can see an active version on my personal website.
Building this template has been tested (at a cursory level) on Mac OSX, Windows, and Linux.
-
Click "Use this template" at the top of the Github page to create a repository with a fresh copy of the template and a blank history.
-
Clone the new repository to your computer and
cd
into it.git clone <repo_name> cd <repo_name>
-
Install dependencies via
pip
. For interactive local development, also installinvoke
:pip install -r requirements.txt pip install invoke
-
Build the website:
python -m invoke livereload
This command will compile the site and open a browser window that dynamically updates as you edit the content of your website.
-
Edit the content of your website. You can change
config.yml
, the contents of each page in thepages
directory, blog posts in thearticles
directory, and add your list of publications inpages/publications.bib
.
Got a cryptic error message? Try running
python -m pelican --debug
which will build the website and prints log messages and a detailed stack trace for errors.
To deploy your website to Github Pages, follow the following steps:
-
Set up a remote repo on Github to host your website, and make sure it has the same name as your Github handle followed by
.github.io
. For example, my username isvbharadwaj-bk
, so I would upload my files to a remote repository calledvbharadwaj-bk.github.io
-
Browse to
Settings
above the repo and clickPages
on the left pane. Set up Github Pages; under theBuild and Deployment
tab, selectGithub Actions
as the source for the build. -
Check your work! Locally on your machine,
python -m invoke livereload
should return no errors. After that, you're ready to deploy! -
Browse to
al-folio-python/.github/workflows/publish-gh-pages.yml
, and uncomment lines 3 and 4 (the ones that read#push: # branches: [ "main" ]
Push your changes. After the push, the Github Action workflow should trigger, and you can visit your site at the repository URL. Enjoy, and please file an issue if there are problems with this set of instructions!