Skip to content

Commit b43917d

Browse files
authored
refactor: make removing index.html from URL configurable (pattern-lab#1428)
* refactor: providing the configurability for whether to remove index.html from the URL pattern-lab#1427 * docs(configuration): added entry for noIndexHtmlremoval
1 parent f2a5e84 commit b43917d

File tree

1 file changed

+6
-2
lines changed
  • packages/uikit-workshop/src/scripts/lit-components/pl-viewport

1 file changed

+6
-2
lines changed

packages/uikit-workshop/src/scripts/lit-components/pl-viewport/pl-viewport.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,9 @@ class IFrame extends BaseLitComponent {
152152
: window.location.protocol +
153153
'//' +
154154
window.location.host +
155-
window.location.pathname.replace('index.html', '') +
155+
(window.config.noIndexHtmlremoval
156+
? window.location.pathname
157+
: window.location.pathname.replace('index.html', '')) +
156158
'?p=' +
157159
currentPattern;
158160

@@ -512,7 +514,9 @@ class IFrame extends BaseLitComponent {
512514
: window.location.protocol +
513515
'//' +
514516
window.location.host +
515-
window.location.pathname.replace('index.html', '') +
517+
(window.config.noIndexHtmlremoval
518+
? window.location.pathname
519+
: window.location.pathname.replace('index.html', '')) +
516520
'?p=' +
517521
currentPattern;
518522

0 commit comments

Comments
 (0)