pelican icon indicating copy to clipboard operation
pelican copied to clipboard

Reduce commands of makefile

Open Saphyel opened this issue 2 years ago • 2 comments

The makefile has some duplicate commands that could be removed if we use some defaults, moving towards a conf first approach and using optional arguments we could reduce the list of commands making the final user memorize less commands.

The benefit of this is less commands to remember, less errors because we use the same commands and make it more easy to add more external front-ends for the commands (officially supported or not)

I'm using PDM and I only really need this commands in the pyproject.toml:

[tool.pdm.scripts]
build = "pelican -s pelicanconf.py"
server = "pelican -lr -s pelicanconf.py"
publish = "pelican -s publishconf.py"

So I don't really see the use case for other options (excluding the deployment options).

Just to clarify I'm not requesting to support other tools but to make the makefile rely more in the conf file and less on hard coded values so even the "invoke" tasks would benefit from this.

Saphyel avatar Sep 12 '22 11:09 Saphyel

Hi Carlos. I get the impression that this isn't exactly a neutral change. One set of commands uses localhost by default, while the "global" variants use 0.0.0.0, which can be accessible outside one's local workstation and which is either a benefit or a hazard, depending on one's perspective. Or I'm just tired and perhaps missing something obvious.

Put another way, if these changes were merged, how would someone who prefers to serve on localhost use the Make automation to do so?

justinmayer avatar Sep 13 '22 12:09 justinmayer

One option would be using the env var SERVER on the makefile

Or use the conf option "BIND" so in this way you can rerun the same command many times and if you want to change the conf file or edit that file (similar concept as using the .env file)

Saphyel avatar Sep 13 '22 13:09 Saphyel