Skip to content

[Hinode] Set a baseURL when deploying PR previews #416

Closed

Description

@MasterKale

The --baseURL arg can be passed when calling hugo to build the site to override the base URL set in config/_default/hugo.toml. This is particularly useful when previewing changes in PRs because various links in the preview will link to the preview build instead of the main site.

There's a CF_PAGES_URL environment variable we should be able to reference when building the preview site:

https://developers.cloudflare.com/pages/configuration/build-configuration/#environment-variables

I'm going to experiment with this as preview builds have a different configuration section in Cloudflare, so it shouldn't impact production deployments.

Activity

  1. self-assigned this
    on Jan 2, 2025
  2. MasterKale commented on Jan 2, 2025

    @MasterKale
    ContributorAuthor

    I tweaked the Preview build process accordingly:

    Screenshot 2025-01-02 at 11 16 19 AM

    https://aa1c6407.passkeys-dev.pages.dev/ was the first PR preview build (see #387) with this change made. Clicking around no longer takes me to passkeys.dev sometimes so I'm considering this done.

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions