Skip to content

Commit 601f212

Browse files
committed
iframe update
1 parent 303aa75 commit 601f212

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

index.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2231,14 +2231,18 @@ function parseBlockHTML(block, pageHTML, prevType) {
22312231
case 'heading_1':
22322232
// For a heading
22332233
let h1Text = formatRichText(block['heading_1'].text)
2234-
console.log(h1Text)
22352234
return pageHTML += `<h2>${h1Text}</h2>`
22362235
case 'heading_2':
22372236
// For a heading
22382237
let h2Text = formatRichText(block['heading_2'].text)
22392238
return pageHTML += `<h2>${h2Text}</h2>`
22402239
case 'heading_3':
22412240
// For a heading
2241+
console.log(block['heading_3'])
2242+
if(block['heading_3']?.text[0].plain_text?.indexOf("http") == 0){
2243+
console.log("URL DETECTED")
2244+
return pageHTML += `<iframe src='${block['heading_3'].text[0].href}'></iframe>`
2245+
}
22422246
let h3Text = formatRichText(block['heading_3'].text)
22432247
return pageHTML += `<h6>${h3Text}</h6>`
22442248
case 'image':

public/templates/blog/post.hbs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,14 @@
2222
<link id="mode" rel="stylesheet" type="text/css" href="/crt.css" />
2323
<link rel="shortcut icon" type="image/png" href="https://sfpc.study/images/sessions/favicon.ico" />
2424
<link rel="stylesheet" href="https://use.typekit.net/thn3crj.css">
25+
<style>
26+
iframe {
27+
width:90%;
28+
height:40vh;
29+
margin-bottom: 2em;
30+
background-color: white;
31+
}
32+
</style>
2533

2634
<script src="/jquery-3.6.0.min.js"></script>
2735

0 commit comments

Comments
 (0)