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.
* 1st vers of blog article import with basic cleanup * Added tags to meta table, removed inline metadata * Blog import --------- Co-authored-by: Chris Bohnert <[email protected]>
- Loading branch information
1 parent
06c03ca
commit cabd682
Showing
6 changed files
with
90 additions
and
1 deletion.
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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
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(); | ||
} | ||
} | ||
} | ||
} | ||
|
||
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 |
---|---|---|
@@ -0,0 +1,26 @@ | ||
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); | ||
|
||
|
||
} | ||
|
||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
function cleanBlog(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) { | ||
dts[i].remove(); | ||
dds[i].remove(); | ||
} | ||
} | ||
} | ||
|
||
export default cleanBlog; |
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