Skip to content

feat: Allow configuring the LiveReload port as an option in the configuration file #9605

@alexwlchan

Description

@alexwlchan

Summary

When you run jekyll serve with LiveReload, you can configure most of the LiveReload behaviour as a configuration file option or a command-line flag (see config documentation).

e.g. you can enable LiveReload with the livereload: BOOL config option or the -l, --livereload command-line flag.

You can only choose the port for LiveReload to listen on with the --livereload-port PORT command-line flag. I'd like to be able to set this as an option in my config file.

Motivation

For Jekyll in general: completeness with the existing options.

For me specifically: I have a couple of Jekyll sites I work on, and I set different server ports in each of their config files so they don't clash, e.g.:

port: 5959
livereload: true

That way I can switch to any project, run jekyll serve and get the “right” behaviour: a new Jekyll server with live reloading, and on a port dedicated to this project.

But every project tries to run LiveReload on 35729, and they clash – I have to add it as a command-line flag to my jekyll serve command. I’d like it if I could also specify the LiveReload port in the config file, to ensure they don't clash, e.g.

port: 5959
livereload: true
livereload_port: 35959

Guide-level explanation

Not necessary for this feature.

Reference-level explanation

I assume this would be similar to other config options.

Drawbacks

Can't think of any.

Unresolved Questions

I can't think of any.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions