Skip to content

infra: make build auto reload changes#158

Merged
alamb merged 1 commit intoapache:mainfrom
kevinjqliu:kevinjqliu/local-preview-autoreload
Mar 16, 2026
Merged

infra: make build auto reload changes#158
alamb merged 1 commit intoapache:mainfrom
kevinjqliu:kevinjqliu/local-preview-autoreload

Conversation

@kevinjqliu
Copy link
Contributor

@kevinjqliu kevinjqliu commented Mar 16, 2026

When running make build, this will automatically refresh any changes made locally. Previously, we had to stop and restart the container.

This is done by using the --autoreload from pelican and keeping it running as a background process (in docker)
Also updated the README.
This only affects local preview, we do not use make build when deploying the site

Here's the pelican options (took me a while to find)

uvx pelican --help

usage: pelican [-h] [-t THEME] [-o OUTPUT] [-s SETTINGS] [-d] [-v] [-q] [-D] [--version] [-r]
               [--print-settings [SETTING_NAME ...]] [--relative-urls] [--cache-path CACHE_PATH]
               [--ignore-cache] [--fatal errors|warnings] [--log-handler {plain,rich}]
               [--logs-dedup-min-level {DEBUG,INFO,WARNING,ERROR}] [-l] [-p PORT] [-b BIND]
               [-e [OVERRIDES ...]]
               [path]

A tool to generate a static blog, with restructured text input files.

positional arguments:
  path                  Path where to find the content files. (default: None)

options:
  -h, --help            show this help message and exit
  -t, --theme-path THEME
                        Path where to find the theme templates. If not specified, it will use the default
                        one included with pelican. (default: None)
  -o, --output OUTPUT   Where to output the generated files. If not specified, a directory will be created,
                        named "output" in the current path. (default: None)
  -s, --settings SETTINGS
                        The settings of the application, this is automatically set to pelicanconf.py if a
                        file exists with this name. (default: None)
  -d, --delete-output-directory
                        Delete the output directory. (default: None)
  -v, --verbose         Show all messages. (default: None)
  -q, --quiet           Show only critical errors. (default: None)
  -D, --debug           Show all messages, including debug messages. (default: None)
  --version             Print the pelican version and exit.
  -r, --autoreload      Relaunch pelican each time a modification occurs on the content files. (default:
                        False)
  --print-settings [SETTING_NAME ...]
                        Print current configuration settings and exit. Append one or more setting name
                        arguments to see the values for specific settings only. (default: None)
  --relative-urls       Use relative urls in output, useful for site development (default: False)
  --cache-path CACHE_PATH
                        Directory in which to store cache files. If not specified, defaults to "cache".
                        (default: None)
  --ignore-cache        Ignore content cache from previous runs by not loading cache files. (default:
                        False)
  --fatal errors|warnings
                        Exit the program with non-zero status if any errors/warnings encountered. (default:
                        )
  --log-handler {plain,rich}
                        Which handler to use to format log messages. The `rich` handler prints output in
                        columns. (default: rich)
  --logs-dedup-min-level {DEBUG,INFO,WARNING,ERROR}
                        Only enable log de-duplication for levels equal to or above the specified value
                        (default: WARNING)
  -l, --listen          Serve content files via HTTP and port 8000. (default: False)
  -p, --port PORT       Port to serve HTTP files at. (default: 8000) (default: None)
  -b, --bind BIND       IP to bind to when serving files via HTTP (default: 127.0.0.1) (default: None)
  -e, --extra-settings [OVERRIDES ...]
                        Specify one or more SETTING=VALUE pairs to override settings. VALUE must be in JSON
                        notation: specify string values as SETTING='"some string"'; booleans as
                        SETTING=true or SETTING=false; None as SETTING=null. (default: {}

@kevinjqliu
Copy link
Contributor Author

cc @alamb whenever you have a chance, could you take a look.
this has been a annoyance for me to always restart the container 😄 finally fixed

Copy link
Contributor

@alamb alamb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @kevinjqliu -- I have also been annoyed about this.

I tried the PR out locally and it works great!

@alamb alamb merged commit c4b0bb2 into apache:main Mar 16, 2026
4 checks passed
@kevinjqliu kevinjqliu deleted the kevinjqliu/local-preview-autoreload branch March 16, 2026 21:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants