Skip to content

Add abs paths to site yml - #315

Closed
virginiascarlett wants to merge 3 commits into
mainfrom
add_abs_paths_to_site_yml
Closed

Add abs paths to site yml#315
virginiascarlett wants to merge 3 commits into
mainfrom
add_abs_paths_to_site_yml

Conversation

@virginiascarlett

Copy link
Copy Markdown
Collaborator

I'm, like, pretty sure this PR won't break the website.

I've swapped the relative paths in site.yml and footer.md for absolute paths. This allows the playbook repo (and perhaps, someday, other subprojects) that are inheriting stuff through MyST's "extends" functionality to find the assets mentioned in those files.

The only path I kept as a relative path is footer.md. I'll change that later, in a separate PR, for convoluted reasons. (Basically, because the absolute path contains the branch name, if I put main/footer.md in this PR, we won't actually get to see whether my modified footer file works because it will be pointing to the one that's currently live, not the one here.)

This is all copied from the workflow described in the JupyterBook blog here. I'm basing this new site.yml file on the site.yml file from their "core repo" (the one subprojects inherit from).

I added the "internal_domains" key (like they did) to indicate that links from ucospo.net should be treated as internal, and should not open a new tab or have this little symbol next to them:
image
Without this, both the playbook and the core site will treat the "ABOUT", "EVENTS", "BLOG", etc. links in the footer as external links.

The pro of this is, as I said earlier, it allows for inheritance. The major con is that if you are a developer deploying a local preview, you might be surprised to find that if you click, e.g., "EVENTS" in the footer, you'll find yourself on ucospo.net/events instead of localhost:nnnn/events. JupyterBook also has this problem and as far as I can tell they just live with it.

Please double-check that I am not breaking the website. Try clicking all the stuff in the footer, especially the RSS feed link. It looks okay to me but I have no idea how that works.

Also let me know if you hate this, lol. To me, it seems more elegant than maintaining duplicate code and images in two repos, but I can see the case for ditching this inheritance thing, since it is a little more complicated.

@netlify

netlify Bot commented May 20, 2026

Copy link
Copy Markdown

Deploy Preview for ucospo-net ready!

Name Link
🔨 Latest commit fb27bd8
🔍 Latest deploy log https://app.netlify.com/projects/ucospo-net/deploys/6a0e3aa4e247770007ef97ee
😎 Deploy Preview https://deploy-preview-315--ucospo-net.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@virginiascarlett
virginiascarlett force-pushed the add_abs_paths_to_site_yml branch from 692d4f9 to a761dee Compare May 20, 2026 22:46
@virginiascarlett

Copy link
Copy Markdown
Collaborator Author

(FYI that force push was just me re-naming the commit to something more informative.)

@LauraLangdon

Copy link
Copy Markdown
Contributor

Aside from the tiny typo edit that I proposed above, this seems good to me! I don't love the quirk with the footer links in local previews, but that's not a big thing as long as we remember that it's a thing at all (maybe add it to the docs?), so I think this approach is better than duplicating everything.

I'm going to tag in @jarrodmillman to give final approval, though, since this approach is new to me.

@virginiascarlett

Copy link
Copy Markdown
Collaborator Author

I'll add that another major "con" is that if someone wants to edit the core site assets, such as the favicon, logo, socials, or they want to edit the footer's "ABOUT" button to say "ABOUT US", for example, they will need to remember that the hard-coded URLs point to the main branch. So they might make a change and then be confused as to why it's not updating--it's because they made changes on a feature branch, but the URLs point to main.

@jarrodmillman

Copy link
Copy Markdown
Member

What is the reason that the playbook is a separate repo? My sense is that it adds extra complexity for something that may end up being maintained by volunteers.

@jarrodmillman

Copy link
Copy Markdown
Member

@stefanv Do you have any thoughts about this?

@stefanv

stefanv commented May 28, 2026

Copy link
Copy Markdown

My general approach to these things is: do not generalize unless you absolutely need to. It sounds like you want to build two websites using one configuration, but it comes with some obvious downsides—like not being able to adjust the CSS and try it out, not being able to click on footers in the preview, several remote fetches occurring during build, etc.

So, on this repo (which contain your reference source files) I would probably leave it as is, and then you can go to some effort on the child site to reference the original.

There are several ways to do this, e.g.: the cookie-cutter approach we follow with Scientific Python Myst theme (although really only necessary if you're going to do many websites that look the same), or simply having a make sync target in the child site that fetches the footer from here and prepend static URLs to various fields.

Regardless, I'd start with duplication, see what happens—and if you're lucky avoid the complexity of extended configurations. Could be that you never need to update anything again :)

@virginiascarlett

Copy link
Copy Markdown
Collaborator Author

Thanks for weighing in @jarrodmillman and @stefanv!

As to Jarrod's question, the impetus for using a separate repo is (1) simple separation of concerns, and (2), because if the playbook were just a series of pages within the site, the parent ucospo.net webpages would be cluttering up both the table of contents and the PDF export for playbook readers.

I really like Stefan's make sync suggestion. I've implemented it at the nascent playbook repo and it seems to be working at ucospo.net/playbook (website still looks goofy, but it's progress). So, we have some duplicate files at the subproject repo, but maintaining them is really easy with this script.

Closing this PR as I am happy with this solution.

@LauraLangdon
LauraLangdon deleted the add_abs_paths_to_site_yml branch June 30, 2026 23:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants