It looks like this is very similar to another guide. As with that one, the strategies suggested in the OP are extremely out-of-date. The best thing going forward is going to be to build the functionality into a git-managed theme component, so that people don’t need to copy/paste code.
We’re looking at whether we can create an official theme-component to cover both use cases, and will update both the topics if/when that’s ready.