Skip to content

Commit

Permalink
special case for /index links, remove prefixes from AEM tags
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanseifert committed May 16, 2024
1 parent 7e9f56a commit 30d8fd2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
8 changes: 7 additions & 1 deletion scripts/services/QueryIndexItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,13 @@ export default class QueryIndexItem {
* @returns {string[]} Tag values as array
*/
getTags() {
return parseJsonArray(this.tags);
return parseJsonArray(this.tags)
.map(item => {

Check failure on line 62 in scripts/services/QueryIndexItem.js

View workflow job for this annotation

GitHub Actions / build

Expected parentheses around arrow function argument

Check failure on line 62 in scripts/services/QueryIndexItem.js

View workflow job for this annotation

GitHub Actions / build

Expected parentheses around arrow function argument
if (item.startsWith('adaptto:')) {
return item.substring('adaptto:'.length);
}
return item;
});
}

/**
Expand Down
3 changes: 3 additions & 0 deletions scripts/utils/path.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,9 @@ export function externalizeXWalkPrefixLink(pathName) {
}
return url.toString();
}

Check failure on line 119 in scripts/utils/path.js

View workflow job for this annotation

GitHub Actions / build

Closing curly brace does not appear on the same line as the subsequent block

Check failure on line 119 in scripts/utils/path.js

View workflow job for this annotation

GitHub Actions / build

Closing curly brace does not appear on the same line as the subsequent block
else if (externalized.endsWith('/index')) {

Check failure on line 120 in scripts/utils/path.js

View workflow job for this annotation

GitHub Actions / build

Unnecessary 'else' after 'return'

Check failure on line 120 in scripts/utils/path.js

View workflow job for this annotation

GitHub Actions / build

Unnecessary 'else' after 'return'
return externalized.substring(0, externalized.length - 'index'.length);
}
return externalized;
}

Expand Down

0 comments on commit 30d8fd2

Please sign in to comment.