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