Skip to content

Add a Makefile for Ruby/bundle/Jekyll commands that I always forget.#551

Merged
samcunliffe merged 3 commits into
mainfrom
sc/add-makefile-for-jekyll-commands-thaat-i-always-forget
Jun 10, 2025
Merged

Add a Makefile for Ruby/bundle/Jekyll commands that I always forget.#551
samcunliffe merged 3 commits into
mainfrom
sc/add-makefile-for-jekyll-commands-thaat-i-always-forget

Conversation

@samcunliffe

@samcunliffe samcunliffe commented Jun 10, 2025

Copy link
Copy Markdown
Member

I can never remember how to build the pages. Perhaps make helps? Certainly, it will positively affect all the carbon I'm wasting by Googling this: Every. Single. Time.

With no arguments it shows help:

❯ make

help     Show this help
serve    Start a local server and serve the site
build    Build the site
install  Pull all jekyll dependencies
clean    Remove build files
check    Check ruby (bundle) is installed

And make serve does what 90% of developers are going to want for checking local changes.

Inspired by (and a little bit stolen from) @t-young31 and @milanmlft (who are both very cool).

@samcunliffe samcunliffe requested a review from Copilot June 10, 2025 08:04
@samcunliffe samcunliffe self-assigned this Jun 10, 2025
@samcunliffe samcunliffe added enhancement New feature or request question Further information is requested labels Jun 10, 2025

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull Request Overview

Adds a Makefile under docs/ to streamline common Jekyll tasks and updates the contributing guide to use make serve instead of manual bundle commands.

  • Introduces docs/Makefile with targets: help, serve, build, install, clean, check
  • Updates CONTRIBUTING.md to reference make serve for local builds

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
docs/Makefile New Makefile providing shortcuts for Jekyll commands
CONTRIBUTING.md Switched manual bundle commands to make serve instructions
Comments suppressed due to low confidence (2)

docs/Makefile:23

  • [nitpick] The error message suggests installing Ruby but the check is for the bundle command; consider clarifying it to mention installing Bundler or including a check for Jekyll itself.
@command -v bundle &> /dev/null || { echo >&2 "Please install ruby >= 2.7 to use Jekyll"; exit 1; }

docs/Makefile:4

  • Ensure all Makefile command lines are indented with a tab character (not spaces) to avoid parsing errors.
@echo

Comment thread docs/Makefile
@@ -0,0 +1,23 @@
SHELL := /bin/bash

help: ## Show this help

Copilot AI Jun 10, 2025

Copy link

Choose a reason for hiding this comment

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

Add a .PHONY declaration (e.g., .PHONY: help serve build install clean check) after the SHELL assignment to prevent conflicts if files with matching names exist.

Copilot uses AI. Check for mistakes.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Thanks, @copilot. Good bot.

@samcunliffe samcunliffe requested a review from a team June 10, 2025 08:07

@paddyroddy paddyroddy left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@milanmlft milanmlft left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

make FTW 🤘

@samcunliffe

Copy link
Copy Markdown
Member Author

Can I offer a simpler solution? https://github.com/paddyroddy/paddyroddy.github.io/blob/main/_deploy.sh

But then I have to remember the name of the script. Is it deploy.sh serve.sh do-everything.sh? make is a standard thing since the 70s.

@samcunliffe samcunliffe merged commit 96b4fe3 into main Jun 10, 2025
17 checks passed
@samcunliffe samcunliffe deleted the sc/add-makefile-for-jekyll-commands-thaat-i-always-forget branch June 10, 2025 09:27
@samcunliffe samcunliffe added website Related to https://github-pages.arc.ucl.ac.uk/python-tooling and removed question Further information is requested labels Jun 10, 2025
@paddyroddy

paddyroddy commented Jun 10, 2025

Copy link
Copy Markdown
Member

But then I have to remember the name of the script. Is it deploy.sh serve.sh do-everything.sh? make is a standard thing since the 70s.

make is the worst, human-readable FTW. Also, the script I wrote I'd claim you only need one command…

@dstansby

Copy link
Copy Markdown
Contributor

For an n+1 option that scientific python folks are using, see https://pypi.org/project/spin/

@samcunliffe

Copy link
Copy Markdown
Member Author

Oh wow. I didn't realise this would be a controversial one. Sorry for the merge without two reviewers.

Talk at FOSDEM Python session about how cool Makefiles can be.

@dstansby

Copy link
Copy Markdown
Contributor

FWIW I'm 👍 for make, just thought I'd share spin in case folks hadn't come across it. I haven't actually used it, or worked on a project that uses it myself.

@milanmlft

Copy link
Copy Markdown
Member

But then I have to remember the name of the script. Is it deploy.sh serve.sh do-everything.sh? make is a standard thing since the 70s.

make is the worst, human-readable FTW. Also, the script I wrote I'd claim you only need one command…

In what world is make deploy not more readable than ./_deploy.sh??

@paddyroddy

Copy link
Copy Markdown
Member

In what world is make deploy not more readable than ./_deploy.sh??

Editing the file. The _ is just so that it doesn't display in a gh-pages branch. Also, one can do bash _deploy.sh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request website Related to https://github-pages.arc.ucl.ac.uk/python-tooling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants