Skip to content

Commit

Permalink
Merge pull request #357 from PrajaktaPatil05/main
Browse files Browse the repository at this point in the history
blog page added #286
  • Loading branch information
PriyaGhosal authored Oct 9, 2024
2 parents b5c0632 + 365a0ec commit 04486fb
Show file tree
Hide file tree
Showing 3 changed files with 377 additions and 27 deletions.
39 changes: 39 additions & 0 deletions assets/js/blog.js
Original file line number Diff line number Diff line change
@@ -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 = `
<a href="${blog.link}">
<img src="${blog.image}" alt="${blog.title}" />
<h3>${blog.title}</h3>
<p>${blog.description}</p>
</a>
`;

blogList.appendChild(blogCard);
});
}

// Call the function to display blogs when the page loads
window.onload = displayBlogs;


11 changes: 6 additions & 5 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -64,22 +64,21 @@
<!--
- #HEADER
-->

<header class="header" data-header>


<div class="container" >

<a href="#">
<img src="./assets/images/Skillwise_logo-removebg-preview.png" width="50" height="10" alt="SkillWise home">
<img src="../assets/images/Skillwise_logo-removebg-preview.png" width="50" height="10" alt="SkillWise home">
</a>

<nav class="navbar" data-navbar>


<div class="navbar-top">

<img src="./assets/images/Skillwise_logo.jpg" width="50" height="10" alt="SkillWise home">
<img src="../assets/images/Skillwise_logo.jpg" width="50" height="10" alt="SkillWise home">
</a>

<button class="nav-close-btn" aria-label="close menu" data-nav-toggler>
Expand Down Expand Up @@ -107,7 +106,7 @@
</li>

<li class="navbar-item"></li>
<a href="./Faq.html" class="navbar-link title-sm" data-nav-link>FAQ</a>
<a href="../Faq.html" class="navbar-link title-sm" data-nav-link>FAQ</a>
</li>

</ul>
Expand Down Expand Up @@ -149,7 +148,7 @@



<a href="./signin.html" class="btn btn-secondary">Start Free Trial</a>
<a href="../signin.html" class="btn btn-secondary">Start Free Trial</a>

<button class="nav-open-btn" aria-label="open menu" data-nav-toggler>
<ion-icon name="menu-outline" aria-hidden="true"></ion-icon>
Expand Down Expand Up @@ -961,6 +960,7 @@ <h3 class="title-lg card-title">
</ul>

<a href="./pages/blog.html" class="btn btn-primary" data-aos="zoom-in">View All Blogs</a>

</div>
</section>

Expand Down Expand Up @@ -1210,6 +1210,7 @@ <h2 class="headline-md section-title" id="cta-label" data-aos="fade-right">
AOS.init();
</script>

<script src="./assets/js/blogs.js"></script>

<!--
- ionicon
Expand Down
Loading

0 comments on commit 04486fb

Please sign in to comment.