generated from adobe/aem-boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into adding-author-index
- Loading branch information
Showing
5 changed files
with
36 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,18 @@ | ||
function createBlogArticle(main, document) { | ||
// Try to remove dts and dds that are not needed | ||
const dts = document.querySelectorAll('dt'); | ||
const dds = document.querySelectorAll('dd'); | ||
if ( dts ) { | ||
for( let i = 0; i < dts.length; i += 1) { | ||
if( dts[i].textContent === 'Text') | ||
{ | ||
const div = document.createElement('div'); | ||
div.innerHTML = dds[i].innerHTML; | ||
dts[i].closest('article').appendChild(div); | ||
dts[i].remove(); | ||
dds[i].remove(); | ||
} | ||
} | ||
// Try to remove dts and dds that are not needed | ||
const dts = document.querySelectorAll('dt'); | ||
const dds = document.querySelectorAll('dd'); | ||
if (dts) { | ||
for (let i = 0; i < dts.length; i += 1) { | ||
if (dts[i].textContent === 'Text') { | ||
const div = document.createElement('div'); | ||
div.innerHTML = dds[i].innerHTML; | ||
dts[i].closest('article').appendChild(div); | ||
dts[i].remove(); | ||
dds[i].remove(); | ||
} | ||
} | ||
} | ||
} | ||
|
||
export default createBlogArticle; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,17 @@ | ||
function blogBanner(main, document) { | ||
|
||
// Banner image is in mainContent element | ||
const bannerImage = main.querySelector('#mainContent img'); | ||
|
||
if( bannerImage ){ | ||
|
||
// Create div to hold image | ||
const div = document.createElement('div'); | ||
const img = document.createElement('img'); | ||
const imgSrc = bannerImage.getAttribute('src'); | ||
img.setAttribute('src', imgSrc); | ||
div.append(img); | ||
|
||
main.prepend(div); | ||
|
||
} | ||
|
||
// const p = document.createElement('p'); | ||
// p.textContent = 'Hello world!'; | ||
// main.append(p); | ||
|
||
|
||
// Banner image is in mainContent element | ||
const bannerImage = main.querySelector('#mainContent img'); | ||
|
||
if (bannerImage) { | ||
// Create div to hold image | ||
const div = document.createElement('div'); | ||
const img = document.createElement('img'); | ||
const imgSrc = bannerImage.getAttribute('src'); | ||
img.setAttribute('src', imgSrc); | ||
div.append(img); | ||
|
||
main.prepend(div); | ||
} | ||
} | ||
|
||
export default blogBanner; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters