corrections updated
This commit is contained in:
parent
56f1f07968
commit
ccb84b0277
@ -17,7 +17,7 @@ export default function Blog() {
|
||||
breadcrumbTitle="Blog"
|
||||
bgImage={"/assets/images/inner-banner/blog-banner.webp"}
|
||||
>
|
||||
<div className="sidebar-page-container pt-5">
|
||||
<div className="sidebar-page-container">
|
||||
<div className="auto-container">
|
||||
<div className="sec-title mb-4 centered">
|
||||
<div className="title">Our Blogs</div>
|
||||
|
||||
@ -4,11 +4,6 @@ import Link from "next/link";
|
||||
import Pagination from "./Pagination";
|
||||
import "public/assets/css/Pagination.css";
|
||||
|
||||
const truncateWords = (text, limit = 20) => {
|
||||
const words = text.split(" ");
|
||||
return words.length > limit ? words.slice(0, limit).join(" ") + " ..." : text;
|
||||
};
|
||||
|
||||
const stripHtml = (html) => {
|
||||
if (!html) return "";
|
||||
return html.replace(/<[^>]*>/g, "");
|
||||
@ -58,13 +53,21 @@ const BlogList = ({ blogs }) => {
|
||||
<div className="blog-content p-3">
|
||||
<h3 className="mb-2 text-lg font-semibold blog-title-hover">
|
||||
<Link href={`/blog/${blog.slug}`} className="blog-title-link">
|
||||
{truncateTitle(stripHtml(blog.title), 40)}
|
||||
{truncateTitle(stripHtml(blog.title), 35)}
|
||||
</Link>
|
||||
</h3>
|
||||
|
||||
{/* Blog Excerpt */}
|
||||
<p className="text-gray-700 mb-3">
|
||||
{truncateWords(stripHtml(blog.para))}
|
||||
<p
|
||||
className="text-gray-700 mb-3"
|
||||
style={{
|
||||
display: '-webkit-box',
|
||||
WebkitLineClamp: 3,
|
||||
WebkitBoxOrient: 'vertical',
|
||||
overflow: 'hidden'
|
||||
}}
|
||||
>
|
||||
{stripHtml(blog.para)}
|
||||
</p>
|
||||
|
||||
{/* Read More Button */}
|
||||
|
||||
@ -36,13 +36,21 @@ export default function Blog() {
|
||||
<div className="blog-content p-3">
|
||||
<h3 className="mb-2 text-lg font-semibold blog-title-hover">
|
||||
<Link href={`/blog/${blog.slug}`} className="blog-title-link">
|
||||
{truncateWords(stripHtml(blog.title), 6)}
|
||||
{truncateWords(stripHtml(blog.title), 7)}
|
||||
</Link>
|
||||
</h3>
|
||||
|
||||
{/* Blog Excerpt */}
|
||||
<p className="text-gray-700 mb-3">
|
||||
{truncateWords(stripHtml(blog.para), 28)}
|
||||
<p
|
||||
className="text-gray-700 mb-3"
|
||||
style={{
|
||||
display: '-webkit-box',
|
||||
WebkitLineClamp: 3,
|
||||
WebkitBoxOrient: 'vertical',
|
||||
overflow: 'hidden'
|
||||
}}
|
||||
>
|
||||
{stripHtml(blog.para)}
|
||||
</p>
|
||||
|
||||
{/* Read More Button */}
|
||||
|
||||
@ -10,7 +10,7 @@
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
margin-top: 60px;
|
||||
margin-bottom: 40px;
|
||||
/* margin-bottom: 40px; */
|
||||
}
|
||||
|
||||
.pagination-container {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user