Skip to content

[WIP-DNMY]Test preview in ci push from branch#18

Closed
ncclementi wants to merge 1 commit into
mainfrom
add-preview-in-ci-test-branch
Closed

[WIP-DNMY]Test preview in ci push from branch#18
ncclementi wants to merge 1 commit into
mainfrom
add-preview-in-ci-test-branch

Conversation

@ncclementi

@ncclementi ncclementi commented Feb 24, 2026

Copy link
Copy Markdown
Contributor

There were some hard-coded paths, that were breaking being able to render well the preview. Claude suggested using relative paths.

Some of the changes needed to make this work:

┌────────────────────────┬─────────────────────────────────────────────────────────────────────────────────┐                                              
  │          File          │                                       Fix                                       │                                              
  ├────────────────────────┼─────────────────────────────────────────────────────────────────────────────────┤                                              
  │ _layouts/homepage.html │ Logo src, event.image src, event-interest-form link, /blog/ link, /donate/ link │                                              
  ├────────────────────────┼─────────────────────────────────────────────────────────────────────────────────┤
  │ _layouts/donate.html   │ Logo src                                                                        │                                              
  ├────────────────────────┼─────────────────────────────────────────────────────────────────────────────────┤                                              
  │ _includes/header.html  │ Logo src                                                                        │
  ├────────────────────────┼─────────────────────────────────────────────────────────────────────────────────┤                                              
  │ _includes/footer.html  │ Root href="/", /donate/ link                                                    │                                              
  ├────────────────────────┼─────────────────────────────────────────────────────────────────────────────────┤                                              
  │ community.markdown     │ Event-interest-form link                                                        │
  └────────────────────────┴─────────────────────────────────────────────────────────────────────────────────┘

Every hardcoded /path is now wrapped with {{ '...' | relative_url }}, so they'll respect baseurl in both production and previews. The data file paths in
_data/event_highlights.yml are handled at the template level (the {{ event.image | relative_url }} fix in homepage.html), so they don't need to change.

{{ '...' | relative_url }}

In Jekyll's Liquid templating language:

  • {{ }} — outputs a value into the HTML
  • '...' — a string literal (the path you're providing)
  • | — a pipe that passes the value on the left into a filter on the right
  • relative_url — a Jekyll filter that prepends site.baseurl to the path

So {{ '/blog/' | relative_url }} works like this:

  • When baseurl: "" (production): outputs /blog/
  • When baseurl: "/pr-preview/pr-17" (preview): outputs /pr-preview/pr-17/blog/

For the data file case, {{ event.image | relative_url }} does the same thing but reads the path from a variable instead of a string literal.

@github-actions

github-actions Bot commented Feb 24, 2026

Copy link
Copy Markdown
PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-02-24 02:32 UTC

@ncclementi ncclementi changed the title Test preview in ci push from branch [WIP-DNMY]Test preview in ci push from branch Feb 24, 2026
@ncclementi ncclementi closed this Feb 24, 2026
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.

1 participant