As it turns out, we need to control the ruby version as well as the gem versions, since githup pages currently uses ruby 2.7.4. Seems the best way to do this is to use rbenv to have a project level ruby version. rbenv can be installed by following the instructions on the rbenv site or with the new "install-rbenv" target.
For setup convenience, add the "install-apt" and "install-dnf" targets to install ruby build depenencies. Remove the old target that installed ruby from packages. Remove the embedded sudo in these targets. The user must run make with sudo just for the install-apt and install-dnf targets.
Add the "install-rbenv" target install rbenv in your home directory and build ruby 2.7.4. The install-rbenv is optional, and is not invoked automatically. See the rbenv installation instructions to install rbenv with your package manager. (Note: If you are using a container, you should already have ruby 2.7.4 and the corrent gem versions installed in the container.)
Originally, the "build" target was used to generate a local build to preview the site by pointing your local webserver DocumentRoot to the DESTDIR. As it turns out, jekyll has a builtin server to preview the site, which does not require you to install and configure an exernal web server. Add 'make preview' to generate the site locally and start the jekyll http server, and open the url in a browser to preview the generated site. Thanks to Casey Wilson for pointing out the "jekyll server" command.
Rename "install" to "install-bundle" and make this a prereq of the run targets.
The Makefile.config file is not really needed at this point. If you need to change the DESTDIR, just add it to the make command line, as shown in the usage. The MAKEFLAGS environment can be used to set this everytime.
While here add "clean" and "reallyclean" targets.
The .PHONY names are out of sync with the target names. Instead of listing all the phony targets at the top of the makefile, put the special .PHONY just before the targets. Hopefully, it will make it easier to keep them correct.
As it turns out, we need to control the ruby version as well as the gem versions, since githup pages currently uses ruby 2.7.4. Seems the best way to do this is to use rbenv to have a project level ruby version. rbenv can be installed by following the instructions on the rbenv site or with the new "install-rbenv" target.
For setup convenience, add the "install-apt" and "install-dnf" targets to install ruby build depenencies. Remove the old target that installed ruby from packages. Remove the embedded sudo in these targets. The user must run make with sudo just for the install-apt and install-dnf targets.
Add the "install-rbenv" target install rbenv in your home directory and build ruby 2.7.4. The install-rbenv is optional, and is not invoked automatically. See the rbenv installation instructions to install rbenv with your package manager. (Note: If you are using a container, you should already have ruby 2.7.4 and the corrent gem versions installed in the container.)
Originally, the "build" target was used to generate a local build to preview the site by pointing your local webserver DocumentRoot to the DESTDIR. As it turns out, jekyll has a builtin server to preview the site, which does not require you to install and configure an exernal web server. Add 'make preview' to generate the site locally and start the jekyll http server, and open the url in a browser to preview the generated site. Thanks to Casey Wilson for pointing out the "jekyll server" command.
Rename "install" to "install-bundle" and make this a prereq of the run targets.
The Makefile.config file is not really needed at this point. If you need to change the DESTDIR, just add it to the make command line, as shown in the usage. The MAKEFLAGS environment can be used to set this everytime.
While here add "clean" and "reallyclean" targets.
The .PHONY names are out of sync with the target names. Instead of listing all the phony targets at the top of the makefile, put the special .PHONY just before the targets. Hopefully, it will make it easier to keep them correct.