Skip to content

Commit

Permalink
Correct loading path for fragments (#25)
Browse files Browse the repository at this point in the history
* Correct loading path for fragments
* Fix PR template.
  • Loading branch information
bstopp authored Nov 29, 2023
1 parent 453bb6d commit e9b6776
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ Please always provide the [GitHub issue(s)](../issues) your PR is for, as well a
Fix #<gh-issue-id>

Test URLs:
- Before: https://main--{repo}--{owner}.hlx.page/
- After: https://<branch>--{repo}--{owner}.hlx.page/
- Before: https://main--famous-smoke-cigaradvisor--hlxsites.hlx.page/cigaradvisor/
- After: https://<branch>--famous-smoke-cigaradvisor--hlxsites.hlx.page/cigaradvisor/
2 changes: 1 addition & 1 deletion cigaradvisor/blocks/footer/footer.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export default async function decorate(block) {
block.textContent = '';

// load footer fragment
const footerPath = footerMeta.footer || '/footer';
const footerPath = footerMeta.footer || '/cigaradvisor/footer';
const fragment = await loadFragment(footerPath);

// decorate footer DOM
Expand Down
2 changes: 1 addition & 1 deletion cigaradvisor/blocks/header/header.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ function toggleMenu(nav, navSections, forceExpanded = null) {
export default async function decorate(block) {
// load nav as fragment
const navMeta = getMetadata('nav');
const navPath = navMeta ? new URL(navMeta).pathname : '/nav';
const navPath = navMeta ? new URL(navMeta).pathname : '/cigaradvisor/nav';
const fragment = await loadFragment(navPath);

// decorate nav DOM
Expand Down

0 comments on commit e9b6776

Please sign in to comment.