Closed gumaerc closed 7 months ago
@ibrahimjaved12 Thanks for your review. I looked into home page links, and I believe it's a bit beyond the scope of what this PR is doing. This PR simply sets the Hugo --baseUrl
parameter to include the prefix. This means that links generated by Hugo (.Permalink
, .RelPermalink
, pageRef
) will contain the prefix and work as expected. However, The links to the search page are mostly hard coded in ocw-hugo-themes
to be relative to the root of the site. I think that in order to support this, we would need a PR in ocw-hugo-themes
to be able to pull the prefix from an env variable and set it where necessary. This especially applies to the links within the search page itself, as the search page is a separate React app not generated by Hugo.
I created an issue here for adding support to the www
theme for prefixed deployments: https://github.com/mitodl/ocw-hugo-themes/issues/1365
What are the relevant tickets?
Closes https://github.com/mitodl/ocw-studio/issues/2113
Description (What does it do?)
This PR takes the
prefix
argument being sent toSitePipelineDefinition
and in addition to prefixing the S3 path with it, the HugobaseURL
argument is now also prefixed. This means that links rendered inside of sites deployed at a prefix URL will correctly link you to the prefixed page, at least for content generated by Hugo.How can this be tested?
ocw-studio
and can publish sites locallydocker compose exec web ./manage.py upsert_mass_build_pipeline --prefix test-prefix
across
step, find of of the sites it published and copy theurl_path
. Browse to the site by appending theurl_path
and the prefix to http://localhost:8045/. It should be something likehttp://localhost:8045/test-prefix/courses/site-name
test-prefix