Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Creating Static Sites with Pelican at LIPN

Sponsored · Your Podcast. Everywhere. Effortlessly. Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.

Creating Static Sites with Pelican at LIPN

Avatar for Jaime Arias Almeida

Jaime Arias Almeida

April 09, 2026

More Decks by Jaime Arias Almeida

Other Decks in Programming

Transcript

  1. Creating Static Sites with Pelican B Jaime Arias [email protected] Laboratoire

    d’Informatique de Paris Nord (LIPN) April 9, 2026 Jaime Arias Creating Static Sites with Pelican B 1 /27
  2. Table of contents 1. Installation 2. Creating a New Project

    3. Creating Pages 4. Generating the Site 5. Plugins 6. Themes 7. Publishing the Site Jaime Arias Creating Static Sites with Pelican B 2 /27
  3. Installation • Language → Python • Some features: ◦ Articles

    → blog posts ◦ Pages → About, Contact, etc. ◦ Plugins → Disqus, Bibtex, etc. ◦ Theming support → Jinja2 templates ◦ Code syntax highlighting ◦ Integration with external tools → Google, Twitter, etc. Jaime Arias Creating Static Sites with Pelican B 4 /27
  4. Installation • Official Website → https://getpelican.com • Git Repository →

    https://github.com/getpelican/pelican • Documentation → https://docs.getpelican.com Installing Pelican > # Use a virtual environment (Best Practice) > python -m venv pelican > source pelican/bin/activate > > # Pelican with Markdown support > pip install "pelican[markdown]" typogrify > > # Create a requirements.txt file for deployment > pip freeze > requirements.txt Jaime Arias Creating Static Sites with Pelican B 5 /27
  5. Creating a New Project Quickstart Wizard > mkdir mysite &&

    cd mysite > pelican-quickstart • Follow the prompts to set up your site configuration ◦ For the question Do you want to specify a URL prefix? use: https://sites.lipn.univ-paris13.fr/<group>/<project> • This creates a basic directory structure and a sample article Project Structure > mysite/￿￿￿ > content￿￿￿ > Makefile￿￿￿ > output￿￿￿ > pelicanconf.py￿￿￿ > publishconf.py￿￿￿ > tasks.py Jaime Arias Creating Static Sites with Pelican B 7 /27
  6. Creating Pages Trick If you create a folder named pages

    inside the content folder, all the files in it will be used to generate static pages, such as About or Contact pages. Creating an About Page > mkdir -p content/pages > echo "Title: About" >> content/pages/about.md Project Structure with Pages > mysite/￿￿￿ > content￿￿￿￿ > pages￿￿￿￿ > about.md￿￿￿ > Makefile￿￿￿ > output￿￿￿ > pelicanconf.py￿￿￿ > publishconf.py￿￿￿ > tasks.py Jaime Arias Creating Static Sites with Pelican B 9 /27
  7. Generation of the Site • From your site directory, run

    the pelican command to generate your site. It will generate your site and save it in the output/ folder. Generating the Site > pelican content • Preview your site by navigating to http://localhost:8000/ in your browser Serving the Site Locally > pelican --autoreload --listen Jaime Arias Creating Static Sites with Pelican B 11 /27
  8. Plugins • Repository → https://github.com/getpelican/pelican-plugins Installation: 1. Create a plugins/

    directory in your project 2. Clone the plugin repository into this directory and remove the .git folder Cloning the Plugins > cd plugins > git clone https://github.com/VorpalBlade/pelican-cite > rm -rf pelican-cite/.git 3. Update your pelicanconf.py to use the new plugin # Specify the plugins you want to use and their paths PLUGIN_PATHS = ["plugins"] PLUGINS = ['pelican-cite'] 4. Read the documentation of the plugin to know how to configure it Jaime Arias Creating Static Sites with Pelican B 14 /27
  9. Plugins pelican-cite Plugin • Installation of dependencies (update the requirements.txt

    file): Installing Dependencies > pip install pybtex • Create a data/ directory in your project and add your BibTeX file there Adding a BibTeX File > mkdir -p data > cp /path/to/your/publications.bib data/ • Update your pelicanconf.py to load the BibTeX file # Specify the path to your BibTeX file PUBLICATIONS_SRC = 'data/publications.bib' Jaime Arias Creating Static Sites with Pelican B 15 /27
  10. Themes • Jinja2 templates → https://jinja.palletsprojects.com • Repository → https://github.com/getpelican/pelican-themes

    • Live demos → https://pelicanthemes.com/ Installation: 1. Create a themes/ directory in your project 2. Clone the theme repository into this directory and remove the .git folder Cloning a Theme > cd themes > git clone https://github.com/jvanz/pelican-hyde > rm -rf pelican-hyde/.git 3. Update your pelicanconf.py to use the new theme # Specify name of a theme installed THEME = 'themes/pelican-hyde' 4. Read the documentation of the theme to know how to configure it Jaime Arias Creating Static Sites with Pelican B 18 /27
  11. Publishing the Site GitLab Pages • You need to activate

    the runners in GitLab to publish your site Jaime Arias Creating Static Sites with Pelican B 22 /27
  12. Publishing the Site GitLab Pages • You need to configure

    Gitlab Pages to no use unique domains Jaime Arias Creating Static Sites with Pelican B 23 /27
  13. Publishing the Site GitLab Pages • You need to create

    a .gitlab-ci.yml file in the root of your project with the following content: 1 image: python:3.13-alpine 2 3 pages: 4 stage: deploy 5 script: 6 - apk add --update --no-cache make 7 - pip install -r requirements.txt 8 - make publish 9 - mv output public # GitLab Pages expects the site to be in "public" 10 artifacts: 11 paths: 12 - public/ Jaime Arias Creating Static Sites with Pelican B 24 /27
  14. Publishing the Site LIPN – public_html • You can publish

    your site using the public_html folder on the server • Your site will be available at https://lipn.univ-paris13.fr/~user • To publish your site, you need to follow these steps: 1. Modify the publishconf.py file to set the correct URL prefix SITEURL = 'https://lipn.univ-paris13.fr/~user' 2. Generate your site locally for production Generating the Site for Production > make publish 3. Copy the generated site to the public_html directory on the server Publishing to LIPN Server > scp -r output/* [email protected]:~/public_html/ Jaime Arias Creating Static Sites with Pelican B 26 /27
  15. Creating Static Sites with Pelican B Jaime Arias [email protected] Laboratoire

    d’Informatique de Paris Nord (LIPN) April 9, 2026 Jaime Arias Creating Static Sites with Pelican B 27 /27