This makes a small change to the way that the .env environment configuration file is validated: the variable RESOURCE_BASE_URL can now be an empty string, which is required for testing this PR.
The primary change in this PR is that it updates the og:image tag to use a fully-qualified URL.
How can this be tested?
To test this locally, ensure that RESOURCE_BASE_URL= is set to any empty string in the .env file. Replace the content of the partial located at /base-theme/layouts/partials/extra_metadata.html with the content currently on the main branch, namely:
Run yarn start <course-id> for any course. Inspect the page source, and verify that the <meta property="og:image" content=/some_relative_url> tag has only a relative URL in it.
Now, revert this update to /base-theme/layouts/partials/extra_metadata.html, and run yarn start <course-id> again. Verify that the <meta property="og:image" content=some_url> tag now has a fully-qualified URL.
What are the relevant tickets?
Closes https://github.com/mitodl/hq/issues/1616.
Description (What does it do?)
This makes a small change to the way that the
.env
environment configuration file is validated: the variableRESOURCE_BASE_URL
can now be an empty string, which is required for testing this PR.The primary change in this PR is that it updates the
og:image
tag to use a fully-qualified URL.How can this be tested?
To test this locally, ensure that
RESOURCE_BASE_URL=
is set to any empty string in the.env
file. Replace the content of the partial located at/base-theme/layouts/partials/extra_metadata.html
with the content currently on themain
branch, namely:Run
yarn start <course-id>
for any course. Inspect the page source, and verify that the<meta property="og:image" content=/some_relative_url>
tag has only a relative URL in it.Now, revert this update to
/base-theme/layouts/partials/extra_metadata.html
, and runyarn start <course-id>
again. Verify that the<meta property="og:image" content=some_url>
tag now has a fully-qualified URL.