Guides listing

pull/1331/head
Kamran Ahmed 3 years ago
parent ec0cd4692c
commit 0e90d53b8e
  1. 12
      content/guides.json
  2. 2
      lib/guide.ts

@ -1,16 +1,6 @@
[ [
{ {
"title": "WebStorm — Project History", "title": "What is CI and CD?",
"description": "Learn how to peek through the history of any git repository to learn how it grew.",
"url": "/guides/project-history",
"fileName": "project-history",
"isPro": false,
"author": "kamranahmedse",
"updatedAt": "2020-07-16T19:59:14.191Z",
"createdAt": "2020-07-16T19:59:14.191Z"
},
{
"title": "CI and CD",
"description": "Learn the basics of CI/CD and how to implement that with GitHub Actions.", "description": "Learn the basics of CI/CD and how to implement that with GitHub Actions.",
"url": "/guides/ci-cd", "url": "/guides/ci-cd",
"fileName": "ci-cd", "fileName": "ci-cd",

@ -16,7 +16,7 @@ export type GuideType = {
formattedUpdatedAt: string; formattedUpdatedAt: string;
}; };
export function getAllGuides(limit: number = undefined): GuideType[] { export function getAllGuides(limit: number = 0): GuideType[] {
return (guides as GuideType[]) return (guides as GuideType[])
.filter(guide => !guide.isDraft) .filter(guide => !guide.isDraft)
.sort((a, b) => (new Date(b.updatedAt) as any) - (new Date(a.updatedAt) as any)) .sort((a, b) => (new Date(b.updatedAt) as any) - (new Date(a.updatedAt) as any))

Loading…
Cancel
Save