Skip to content

Commit b37fb91

Browse files
committed
Revert "test"
This reverts commit db8a66c.
1 parent db8a66c commit b37fb91

File tree

2 files changed

+18
-22
lines changed

2 files changed

+18
-22
lines changed

assets/js/components/fetch.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,23 @@ async function navigateToDetailedPost() {
3232
news(tag_endpoint+data.tag[2].id)
3333

3434
postimageEl.innerHTML = `<img class="featured-image img-fluid" src="${data.image}" alt="">`
35+
36+
// Example dynamic content update with JavaScript
37+
const title = data.title
38+
const description = truncateWords(data.body, 8)
39+
const imageUrl = data.image
40+
const postUrl = post_url
41+
42+
// Update Open Graph meta tags
43+
document.getElementById("ogTitle").setAttribute("content", title);
44+
document.getElementById("ogDescription").setAttribute("content", description);
45+
document.getElementById("ogImage").setAttribute("content", imageUrl);
46+
document.getElementById("ogUrl").setAttribute("content", postUrl);
47+
48+
// Update Twitter meta tags
49+
document.getElementById("twitterTitle").setAttribute("content", title);
50+
document.getElementById("twitterDescription").setAttribute("content", description);
51+
document.getElementById("twitterImage").setAttribute("content", imageUrl);
3552
}
3653

3754
async function renderModelList(url, options) {

blog_detail.html

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<html lang="en">
33
<head>
44
<meta charset="utf-8">
5-
<meta name="description" content="Transforming Ideas into Immersive Experiences through Innovative Programming" id="mDescription">
5+
<meta name="description" content="Transforming Ideas into Immersive Experiences through Innovative Programming">
66
<meta name="keywords" content="pixtinifinty, pixet, pixt, infinity, category, blog, details">
77
<meta name="author" content="pixtinifinty">
88

@@ -54,24 +54,6 @@
5454
// 'X-CSRFToken': csrftoken,
5555
}
5656
}
57-
// Example dynamic content update with JavaScript
58-
const title = "data.title"
59-
const description = "truncateWords(data.body, 8)"
60-
const imageUrl = "data.image"
61-
const postUrl = "post_url"
62-
63-
// Update Open Graph meta tags
64-
document.getElementById("ogTitle").setAttribute("content", title);
65-
document.getElementById("ogDescription").setAttribute("content", description);
66-
document.getElementById("ogImage").setAttribute("content", imageUrl);
67-
document.getElementById("ogUrl").setAttribute("content", postUrl);
68-
69-
document.getElementById('mDescription').setAttribute('content', description)
70-
71-
// Update Twitter meta tags
72-
document.getElementById("twitterTitle").setAttribute("content", title);
73-
document.getElementById("twitterDescription").setAttribute("content", description);
74-
document.getElementById("twitterImage").setAttribute("content", imageUrl);
7557
</script>
7658
<style>
7759
/*----------------------------
@@ -221,7 +203,6 @@ <h2>Related Post</h2>
221203
================================================== -->
222204
</div>
223205
</div>
224-
225206
<script type="module">
226207
window.addEventListener('load', () => {
227208
setInterval(() => {
@@ -234,8 +215,6 @@ <h2>Related Post</h2>
234215
setTimeout(() => {
235216
hljs.highlightAll();
236217
}, 3000)
237-
238-
239218
</script>
240219

241220

0 commit comments

Comments
 (0)