From a28e0d59f587d9d1fd2e6788ef3b28c9365cc697 Mon Sep 17 00:00:00 2001 From: PrajaktaPatil05 Date: Wed, 9 Oct 2024 09:20:09 +0530 Subject: [PATCH 1/2] blog page added --- assets/js/blog.js | 39 +++++ index.html | 11 +- pages/blog.html | 354 +++++++++++++++++++++++++++++++++++++++++++--- pages/footer.html | 207 +++++++++++++++++++++++++++ pages/header.html | 101 +++++++++++++ 5 files changed, 685 insertions(+), 27 deletions(-) create mode 100644 assets/js/blog.js create mode 100644 pages/footer.html create mode 100644 pages/header.html diff --git a/assets/js/blog.js b/assets/js/blog.js new file mode 100644 index 00000000..3ba8547c --- /dev/null +++ b/assets/js/blog.js @@ -0,0 +1,39 @@ +const blogs = [ + { + title: "Blog Title 1", + description: "Short description of Blog 1.", + image: "../assets/images/blog1.jpg", // Path to your image + link: "/pages/blog1.html", // Link to the full blog post + }, + { + title: "Blog Title 2", + description: "Short description of Blog 2.", + image: "../assets/images/blog2.jpg", // Path to your image + link: "/pages/blog2.html", // Link to the full blog post + }, + // Add more blog entries as needed + ]; + + // Function to display blogs + function displayBlogs() { + const blogList = document.querySelector(".grid-list"); + blogs.forEach(blog => { + const blogCard = document.createElement("li"); + blogCard.classList.add("blog-card"); + + blogCard.innerHTML = ` + + ${blog.title} +

${blog.title}

+

${blog.description}

+
+ `; + + blogList.appendChild(blogCard); + }); + } + + // Call the function to display blogs when the page loads + window.onload = displayBlogs; + + \ No newline at end of file diff --git a/index.html b/index.html index f68136ab..a23dbf66 100644 --- a/index.html +++ b/index.html @@ -63,14 +63,13 @@ -
- SkillWise home + SkillWise home