From 228341d10c513ae0368dd0aa88850d494f8c3faa Mon Sep 17 00:00:00 2001 From: Patrick Murimi Date: Sun, 18 Feb 2024 13:46:55 +0300 Subject: [PATCH] fix: blog page descriptions --- .../latest-blog/latest-blog.component.html | 17 +++++++++++++---- .../latest-blog/latest-blog.component.ts | 1 + .../latest-blogs/latest-blogs.component.html | 6 +++++- src/app/services/blogs/blogs.service.ts | 2 +- 4 files changed, 20 insertions(+), 6 deletions(-) diff --git a/src/app/modules/blogs/main-content/latest-blogs/latest-blog/latest-blog.component.html b/src/app/modules/blogs/main-content/latest-blogs/latest-blog/latest-blog.component.html index 6d4cb54..c0472ea 100644 --- a/src/app/modules/blogs/main-content/latest-blogs/latest-blog/latest-blog.component.html +++ b/src/app/modules/blogs/main-content/latest-blogs/latest-blog/latest-blog.component.html @@ -2,6 +2,7 @@ class="flex justify-around items-center w-full h-full bg-secondaryBlue text-white rounded-[35px] p-8" routerLink="{{ blog.route }}" > +
-
- {{ blog.shortDescription }} +
+ {{ blog.shortDescription.split(" ").slice(0, 10).join(" ") + "..." }}
+ +
- {{ blog.longDescription }} + {{ + blog.longDescription + ?.split(" ") + ?.slice(0, longDescriptionCutOff) + ?.join(" ") + "..." + }}
+
Latest Blogs class="w-full hidden md:block w-1/2" > } @else { - + } }
diff --git a/src/app/services/blogs/blogs.service.ts b/src/app/services/blogs/blogs.service.ts index 1486291..a36eab8 100644 --- a/src/app/services/blogs/blogs.service.ts +++ b/src/app/services/blogs/blogs.service.ts @@ -11,7 +11,7 @@ export class BlogsService { return [ { title: 'Machine Learning', - shortDescription: 'Future Trends in Machine Learning. What’s Next?', + shortDescription: 'Future Trends in Machine Learning.', longDescription: 'Machine learning is the study of computer algorithms that improve automatically through experience.', image: 'assets/svgs/ml.svg',