Skip to content

Commit

Permalink
Merge pull request #2293 from ORCID/9286-home-page-enable-assets-fing…
Browse files Browse the repository at this point in the history
…erprinting

9286 home page enable assets fingerprinting
  • Loading branch information
leomendoza123 authored Jul 4, 2024
2 parents 3f22bd4 + 97d32ef commit 92443b3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/app/core/wordpress/wordpress.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export class WordpressService {
const regex = new RegExp(find, 'g')
const updatedHtml = data.html.replace(
regex,
`${data.url.replace(/index\.html$/, '')}assets/`
`${data.url.replace(/index.*\.html$/, '')}assets/`
)
return updatedHtml
})
Expand All @@ -38,11 +38,11 @@ export class WordpressService {
const fallbackUrl = `${environment.WORDPRESS_S3_FALLBACK}/wordpress-homepage.css`
return this.fetchWithFallback(primaryUrl, fallbackUrl).pipe(
map((data: { html: string; url: string }) => {
const find = './assets/'
const find = 'assets/'
const regex = new RegExp(find, 'g')
const updatedHtml = data.html.replace(
regex,
`${data.url.replace(/wordpress-homepage\.css$/, '')}assets/`
`${data.url.replace(/wordpress-homepage.*\.css$/, '')}assets/`
)
return updatedHtml
})
Expand All @@ -58,7 +58,7 @@ export class WordpressService {
const regex = new RegExp(find, 'g')
let updateJs = data.html.replace(
regex,
`${data.url.replace(/wordpress-homepage\.js$/, '')}assets/`
`${data.url.replace(/wordpress-homepage.*\.js$/, '')}assets/`
)
// By default the script was intented to be executed after the event `DOMContentLoaded`
// but in Angular the event `DOMContentLoaded` is already fired, so we need to execute it
Expand Down

0 comments on commit 92443b3

Please sign in to comment.