Add author pages

pull/5258/head
Kamran Ahmed 9 months ago
parent d958a29862
commit 44b62c2b2d
  1. BIN
      public/authors/peter-thaleikis.png
  2. 26
      src/components/VideoHeader.astro
  3. 8
      src/data/authors/ebrahim-bharmal.md
  4. 9
      src/data/authors/jesse-li.md
  5. 9
      src/data/authors/peter-thaleikis.md
  6. 5
      src/data/guides/proxy-servers.md
  7. 5
      src/data/guides/torrent-client.md
  8. 5
      src/data/guides/why-build-it-and-they-will-come-wont-work-anymore.md
  9. 5
      src/data/videos/acid-explained.md
  10. 5
      src/data/videos/all-about-http-caching.md
  11. 5
      src/data/videos/array-structure.md
  12. 5
      src/data/videos/arrays-and-objects-in-javascript.md
  13. 5
      src/data/videos/async-javascript.md
  14. 5
      src/data/videos/basic-authentication.md
  15. 5
      src/data/videos/basics-of-authentication.md
  16. 5
      src/data/videos/big-o-notation.md
  17. 5
      src/data/videos/content-delivery-networks.md
  18. 5
      src/data/videos/dns-explained.md
  19. 5
      src/data/videos/dns-records.md
  20. 5
      src/data/videos/floating-point-arithmetic.md
  21. 5
      src/data/videos/freeze-and-seal-objects-in-javascript.md
  22. 5
      src/data/videos/graph-data-structure.md
  23. 5
      src/data/videos/hash-table-data-structure.md
  24. 5
      src/data/videos/heap-data-structure.md
  25. 5
      src/data/videos/how-to-use-css-variables.md
  26. 5
      src/data/videos/how-to-use-github-actions.md
  27. 5
      src/data/videos/javascript-fetch-api.md
  28. 5
      src/data/videos/linked-list-data-structure.md
  29. 5
      src/data/videos/load-balancers-101.md
  30. 5
      src/data/videos/osi-model.md
  31. 5
      src/data/videos/practical-intro-to-react.md
  32. 5
      src/data/videos/promises-in-javascript.md
  33. 5
      src/data/videos/queue-data-structure.md
  34. 5
      src/data/videos/random-number-generators.md
  35. 5
      src/data/videos/scaling-the-unscalable.md
  36. 5
      src/data/videos/session-based-authentication.md
  37. 5
      src/data/videos/ssh-ssl-tls.md
  38. 5
      src/data/videos/stack-data-structure.md
  39. 5
      src/data/videos/system-design-101.md
  40. 5
      src/data/videos/tcp-ip-model.md
  41. 5
      src/data/videos/transport-protocols-tcp-vs-udp.md
  42. 5
      src/data/videos/tree-data-structure.md
  43. 5
      src/data/videos/what-are-data-structures.md
  44. 5
      src/data/videos/what-is-cap-theorem.md
  45. 5
      src/data/videos/what-is-dependency-injection.md
  46. 5
      src/data/videos/what-is-dom-shadow-dom-virtual-dom.md
  47. 5
      src/data/videos/what-is-eventual-consistency.md
  48. 5
      src/data/videos/yaml-in-depth.md
  49. 24
      src/lib/video.ts
  50. 11
      src/pages/authors/[authorId].astro

Binary file not shown.

After

Width:  |  Height:  |  Size: 150 KiB

@ -1,40 +1,38 @@
---
import type { VideoFileType } from '../lib/video';
import YouTubeAlert from "./YouTubeAlert.astro";
import YouTubeAlert from './YouTubeAlert.astro';
export interface Props {
video: VideoFileType;
}
const { video } = Astro.props;
const { frontmatter } = video;
const { author } = frontmatter;
const { frontmatter, author } = video;
---
<div class='bg-white border-b py-5 sm:py-12'>
<div class='border-b bg-white py-5 sm:py-12'>
<div class='container text-left sm:text-center'>
<p
class='text-gray-400 hidden sm:flex items-center justify-start sm:justify-center'
class='hidden items-center justify-start text-gray-400 sm:flex sm:justify-center'
>
<a
href={author.url}
target='_blank'
class='font-medium hover:text-gray-600 inline-flex items-center hover:underline'
href={`/authors/${author.id}`}
class='inline-flex items-center font-medium hover:text-gray-600 hover:underline'
>
<img
alt={author.name}
src={author.imageUrl}
class='w-5 h-5 inline mr-2 rounded-full'
alt={author.frontmatter.name}
src={author.frontmatter.imageUrl}
class='mr-2 inline h-5 w-5 rounded-full'
/>
{author.name}
{author.frontmatter.name}
</a>
<span class='mx-1.5'>&middot;</span>
<span class='capitalize'>Illustrated Video</span>
</p>
<h1 class='text-2xl sm:text-5xl my-0 sm:my-3.5 font-bold'>
<h1 class='my-0 text-2xl font-bold sm:my-3.5 sm:text-5xl'>
{frontmatter.title}
</h1>
<p class='hidden sm:block text-gray-400 text-md'>
<p class='text-md hidden text-gray-400 sm:block'>
{frontmatter.description}
</p>
</div>

@ -0,0 +1,8 @@
---
name: 'Ebrahim Bharmal'
imageUrl: '/authors/ebrahimbharmal007.png'
social:
twitter: 'https://twitter.com/BharmalEbrahim'
---
Full-stack developer interested in all things web development.

@ -0,0 +1,9 @@
---
name: 'Jesse Li'
imageUrl: '/authors/jesse.png'
social:
twitter: 'https://twitter.com/__jesse_li'
github: 'https://github.com/veggiedefender'
---
Jesse has made several [interesting open-source projects](https://github.com/veggiedefender) and wrote some interesting [articles on his blog](https://blog.jse.li/) including the one he wrote on roadmap.sh.

@ -0,0 +1,9 @@
---
name: 'Peter Thaleikis'
imageUrl: '/authors/peter-thaleikis.png'
social:
twitter: 'https://twitter.com/spekulatius1984'
website: 'https://peterthaleikis.com/'
---
Peter Thaleikis a software engineer and business owner. He has been developing web applications since around 2000. Before he started his own software development company [Bring Your Own Ideas Ltd.](https://bringyourownideas.com/), he has been a Lead Developer for multiple organizations.

@ -1,10 +1,7 @@
---
title: 'Proxy Servers'
description: 'How do proxy servers work and what are forward and reverse proxies?'
author:
name: 'Ebrahim Bharmal'
url: 'https://twitter.com/BharmalEbrahim'
imageUrl: '/authors/ebrahimbharmal007.png'
authorId: 'ebrahim-bharmal'
seo:
title: 'Proxy Servers - roadmap.sh'
description: 'How do proxy servers work and what are forward and reverse proxies?'

@ -1,10 +1,7 @@
---
title: 'Building a BitTorrent Client'
description: 'Learn everything you need to know about BitTorrent by writing a client in Go'
author:
name: 'Jesse Li'
url: 'https://twitter.com/__jesse_li'
imageUrl: '/authors/jesse.png'
authorId: 'jesse-li'
seo:
title: 'Building a BitTorrent Client - roadmap.sh'
description: 'Learn everything you need to know about BitTorrent by writing a client in Go'

@ -1,10 +1,7 @@
---
title: 'Build it and they will come?'
description: 'Why “build it and they will come” alone won’t work anymore'
author:
name: 'Peter Thaleikis'
url: 'https://twitter.com/spekulatius1984'
imageUrl: '/authors/spekulatius.jpg'
authorId: 'peter-thaleikis'
seo:
title: 'Build it and they will come? - roadmap.sh'
description: 'Why “build it and they will come” alone won’t work anymore'

@ -4,10 +4,7 @@ description: 'Learn what it means for a database to be ACID compliant with examp
duration: '5 minutes'
isNew: false
date: 2021-09-26
author:
name: 'Kamran Ahmed'
url: 'https://twitter.com/kamrify'
imageUrl: '/authors/kamranahmedse.jpeg'
authorId: 'kamran'
sitemap:
priority: 0.7
changefreq: 'weekly'

@ -4,10 +4,7 @@ description: 'Learn what is HTTP caching, places for caching and different cachi
duration: '13 minutes'
isNew: false
date: 2020-10-04
author:
name: 'Kamran Ahmed'
url: 'https://twitter.com/kamrify'
imageUrl: '/authors/kamranahmedse.jpeg'
authorId: 'kamran'
sitemap:
priority: 0.7
changefreq: 'weekly'

@ -4,10 +4,7 @@ description: 'Learn everything you need to know about array data structure'
duration: '10 minutes'
isNew: false
date: 2022-01-09
author:
name: 'Kamran Ahmed'
url: 'https://twitter.com/kamrify'
imageUrl: '/authors/kamranahmedse.jpeg'
authorId: 'kamran'
sitemap:
priority: 0.7
changefreq: 'weekly'

@ -4,10 +4,7 @@ description: 'Learn how to manipulate arrays and objects in JavaScript.'
duration: '12 minutes'
isNew: false
date: 2020-05-09
author:
name: 'Kamran Ahmed'
url: 'https://twitter.com/kamrify'
imageUrl: '/authors/kamranahmedse.jpeg'
authorId: 'kamran'
sitemap:
priority: 0.7
changefreq: 'weekly'

@ -4,10 +4,7 @@ description: 'Learn how to write asynchronous JavaScript using Async/Await'
duration: '15 minutes'
isNew: false
date: 2021-11-14
author:
name: 'Kamran Ahmed'
url: 'https://twitter.com/kamrify'
imageUrl: '/authors/kamranahmedse.jpeg'
authorId: 'kamran'
sitemap:
priority: 0.7
changefreq: 'weekly'

@ -4,10 +4,7 @@ description: 'Learn everything you need to know about basic authentication'
duration: '5 minutes'
isNew: false
date: 2022-10-01
author:
name: 'Kamran Ahmed'
url: 'https://twitter.com/kamrify'
imageUrl: '/authors/kamranahmedse.jpeg'
authorId: 'kamran'
sitemap:
priority: 0.7
changefreq: 'weekly'

@ -4,10 +4,7 @@ description: 'Learn everything you need to know about authentication with this A
duration: '5 minutes'
isNew: false
date: 2022-09-21
author:
name: 'Kamran Ahmed'
url: 'https://twitter.com/kamrify'
imageUrl: '/authors/kamranahmedse.jpeg'
authorId: 'kamran'
sitemap:
priority: 0.7
changefreq: 'weekly'

@ -4,10 +4,7 @@ description: 'Learn what the Big-O notation is and how to calculate the time com
duration: '8 minutes'
isNew: false
date: 2021-10-25
author:
name: 'Kamran Ahmed'
url: 'https://twitter.com/kamrify'
imageUrl: '/authors/kamranahmedse.jpeg'
authorId: 'kamran'
sitemap:
priority: 0.7
changefreq: 'weekly'

@ -4,10 +4,7 @@ description: 'Learn what the CDNs are and the difference between push CDN vs pul
duration: '4 minutes'
isNew: false
date: 2020-09-26
author:
name: 'Kamran Ahmed'
url: 'https://twitter.com/kamrify'
imageUrl: '/authors/kamranahmedse.jpeg'
authorId: 'kamran'
sitemap:
priority: 0.7
changefreq: 'weekly'

@ -4,10 +4,7 @@ description: 'Learn what the DNS is and how a website is found on the internet.'
duration: '5 minutes'
isNew: false
date: 2020-08-17
author:
name: 'Kamran Ahmed'
url: 'https://twitter.com/kamrify'
imageUrl: '/authors/kamranahmedse.jpeg'
authorId: 'kamran'
sitemap:
priority: 0.7
changefreq: 'weekly'

@ -4,10 +4,7 @@ description: 'Learn what the DNS is and how a website is found on the internet.'
duration: '6 minutes'
isNew: false
date: 2020-08-31
author:
name: 'Kamran Ahmed'
url: 'https://twitter.com/kamrify'
imageUrl: '/authors/kamranahmedse.jpeg'
authorId: 'kamran'
sitemap:
priority: 0.7
changefreq: 'weekly'

@ -4,10 +4,7 @@ description: 'Learn how ow the arithmetic operations work on floating-point numb
duration: '4 minutes'
isNew: false
date: 2021-10-10
author:
name: 'Kamran Ahmed'
url: 'https://twitter.com/kamrify'
imageUrl: '/authors/kamranahmedse.jpeg'
authorId: 'kamran'
sitemap:
priority: 0.7
changefreq: 'weekly'

@ -4,10 +4,7 @@ description: 'Learn what is object freeze and seal in JavaScript and how to use
duration: '6 minutes'
isNew: false
date: 2020-10-16
author:
name: 'Kamran Ahmed'
url: 'https://twitter.com/kamrify'
imageUrl: '/authors/kamranahmedse.jpeg'
authorId: 'kamran'
sitemap:
priority: 0.7
changefreq: 'weekly'

@ -4,10 +4,7 @@ description: 'Learn everything you need to know about the graph data structure'
duration: '13 minutes'
isNew: false
date: 2022-09-08
author:
name: 'Kamran Ahmed'
url: 'https://twitter.com/kamrify'
imageUrl: '/authors/kamranahmedse.jpeg'
authorId: 'kamran'
sitemap:
priority: 0.7
changefreq: 'weekly'

@ -4,10 +4,7 @@ description: 'Learn everything you need to know about the hash table data struct
duration: '8 minutes'
isNew: false
date: 2022-02-21
author:
name: 'Kamran Ahmed'
url: 'https://twitter.com/kamrify'
imageUrl: '/authors/kamranahmedse.jpeg'
authorId: 'kamran'
sitemap:
priority: 0.7
changefreq: 'weekly'

@ -4,10 +4,7 @@ description: 'Learn everything you need to know about the heap data structure'
duration: '11 minutes'
isNew: false
date: 2022-08-24
author:
name: 'Kamran Ahmed'
url: 'https://twitter.com/kamrify'
imageUrl: '/authors/kamranahmedse.jpeg'
authorId: 'kamran'
sitemap:
priority: 0.7
changefreq: 'weekly'

@ -4,10 +4,7 @@ description: 'Learn how to write scalable CSS using CSS Variables.'
duration: '5 minutes'
isNew: false
date: 2020-07-03
author:
name: 'Kamran Ahmed'
url: 'https://twitter.com/kamrify'
imageUrl: '/authors/kamranahmedse.jpeg'
authorId: 'kamran'
sitemap:
priority: 0.7
changefreq: 'weekly'

@ -4,10 +4,7 @@ description: 'Learn how to implement CI/CD with GitHub Actions'
duration: '6 minutes'
isNew: false
date: 2020-07-13
author:
name: 'Kamran Ahmed'
url: 'https://twitter.com/kamrify'
imageUrl: '/authors/kamranahmedse.jpeg'
authorId: 'kamran'
sitemap:
priority: 0.7
changefreq: 'weekly'

@ -4,10 +4,7 @@ description: "Learn how to use JavaScript's Fetch API to interact with remote AP
duration: '3 minutes'
isNew: false
date: 2020-08-02
author:
name: 'Kamran Ahmed'
url: 'https://twitter.com/kamrify'
imageUrl: '/authors/kamranahmedse.jpeg'
authorId: 'kamran'
sitemap:
priority: 0.7
changefreq: 'weekly'

@ -4,10 +4,7 @@ description: 'Learn everything you need to know about linked list data structure
duration: '11 minutes'
isNew: false
date: 2022-01-31
author:
name: 'Kamran Ahmed'
url: 'https://twitter.com/kamrify'
imageUrl: '/authors/kamranahmedse.jpeg'
authorId: 'kamran'
sitemap:
priority: 0.7
changefreq: 'weekly'

@ -4,10 +4,7 @@ description: 'Learn the basics of load balancers, types and different algorithms
duration: '9 minutes'
isNew: false
date: 2020-09-18
author:
name: 'Kamran Ahmed'
url: 'https://twitter.com/kamrify'
imageUrl: '/authors/kamranahmedse.jpeg'
authorId: 'kamran'
sitemap:
priority: 0.7
changefreq: 'weekly'

@ -4,10 +4,7 @@ description: 'Learn what is OSI Model and the different layers involved.'
duration: '7 minutes'
isNew: false
date: 2020-10-24
author:
name: 'Kamran Ahmed'
url: 'https://twitter.com/kamrify'
imageUrl: '/authors/kamranahmedse.jpeg'
authorId: 'kamran'
sitemap:
priority: 0.7
changefreq: 'weekly'

@ -4,10 +4,7 @@ description: 'Learn how to create a React Application with practical example.'
duration: '40 minutes'
isNew: false
date: 2020-07-09
author:
name: 'Kamran Ahmed'
url: 'https://twitter.com/kamrify'
imageUrl: '/authors/kamranahmedse.jpeg'
authorId: 'kamran'
sitemap:
priority: 0.7
changefreq: 'weekly'

@ -4,10 +4,7 @@ description: 'Learn how to write asynchronous code in JavaScript using promises.
duration: '8 minutes'
isNew: false
date: 2020-07-20
author:
name: 'Kamran Ahmed'
url: 'https://twitter.com/kamrify'
imageUrl: '/authors/kamranahmedse.jpeg'
authorId: 'kamran'
sitemap:
priority: 0.7
changefreq: 'weekly'

@ -4,10 +4,7 @@ description: 'Learn everything you need to know about the queue data structure'
duration: '4 minutes'
isNew: false
date: 2022-02-14
author:
name: 'Kamran Ahmed'
url: 'https://twitter.com/kamrify'
imageUrl: '/authors/kamranahmedse.jpeg'
authorId: 'kamran'
sitemap:
priority: 0.7
changefreq: 'weekly'

@ -4,10 +4,7 @@ description: 'How do random number generators work?'
duration: '8 minutes'
isNew: false
date: 2021-11-03
author:
name: 'Kamran Ahmed'
url: 'https://twitter.com/kamrify'
imageUrl: '/authors/kamranahmedse.jpeg'
authorId: 'kamran'
sitemap:
priority: 0.7
changefreq: 'weekly'

@ -4,10 +4,7 @@ description: 'Learn the basics of System Design and understand how to build a sc
duration: '10 minutes'
isNew: false
date: 2020-07-26
author:
name: 'Kamran Ahmed'
url: 'https://twitter.com/kamrify'
imageUrl: '/authors/kamranahmedse.jpeg'
authorId: 'kamran'
sitemap:
priority: 0.7
changefreq: 'weekly'

@ -4,10 +4,7 @@ description: 'Learn everything you need to know about session authentication'
duration: '2 minutes'
isNew: false
date: 2022-11-02
author:
name: 'Kamran Ahmed'
url: 'https://twitter.com/kamrify'
imageUrl: '/authors/kamranahmedse.jpeg'
authorId: 'kamran'
sitemap:
priority: 0.7
changefreq: 'weekly'

@ -4,10 +4,7 @@ description: 'Learn the difference between SSH, TLS and SSL'
duration: '3 minutes'
isNew: false
date: 2021-11-25
author:
name: 'Kamran Ahmed'
url: 'https://twitter.com/kamrify'
imageUrl: '/authors/kamranahmedse.jpeg'
authorId: 'kamran'
sitemap:
priority: 0.7
changefreq: 'weekly'

@ -4,10 +4,7 @@ description: 'Learn everything you need to know about the stack data structure'
duration: '5 minutes'
isNew: false
date: 2022-02-07
author:
name: 'Kamran Ahmed'
url: 'https://twitter.com/kamrify'
imageUrl: '/authors/kamranahmedse.jpeg'
authorId: 'kamran'
sitemap:
priority: 0.7
changefreq: 'weekly'

@ -4,10 +4,7 @@ description: 'Learn about all the bits and pieces of system design.'
duration: '7 minutes'
isNew: false
date: 2020-08-08
author:
name: 'Kamran Ahmed'
url: 'https://twitter.com/kamrify'
imageUrl: '/authors/kamranahmedse.jpeg'
authorId: 'kamran'
sitemap:
priority: 0.7
changefreq: 'weekly'

@ -4,10 +4,7 @@ description: 'Learn what is TCP/IP Model and the different layers involved.'
duration: '5 minutes'
isNew: false
date: 2020-11-06
author:
name: 'Kamran Ahmed'
url: 'https://twitter.com/kamrify'
imageUrl: '/authors/kamranahmedse.jpeg'
authorId: 'kamran'
sitemap:
priority: 0.7
changefreq: 'weekly'

@ -4,10 +4,7 @@ description: 'Learn about the Transport Layer of the TCP/IP model and different
duration: '10 minutes'
isNew: false
date: 2020-11-21
author:
name: 'Kamran Ahmed'
url: 'https://twitter.com/kamrify'
imageUrl: '/authors/kamranahmedse.jpeg'
authorId: 'kamran'
sitemap:
priority: 0.7
changefreq: 'weekly'

@ -4,10 +4,7 @@ description: 'Learn everything you need to know about the tree data structure'
duration: '8 minutes'
isNew: false
date: 2022-08-11
author:
name: 'Kamran Ahmed'
url: 'https://twitter.com/kamrify'
imageUrl: '/authors/kamranahmedse.jpeg'
authorId: 'kamran'
sitemap:
priority: 0.7
changefreq: 'weekly'

@ -4,10 +4,7 @@ description: 'Learn about the different data structures in this illustrated seri
duration: '1 minute'
isNew: false
date: 2021-12-12
author:
name: 'Kamran Ahmed'
url: 'https://twitter.com/kamrify'
imageUrl: '/authors/kamranahmedse.jpeg'
authorId: 'kamran'
sitemap:
priority: 0.7
changefreq: 'weekly'

@ -4,10 +4,7 @@ description: 'An illustrated explanation to CAP theorem with examples and proof.
duration: '8 minutes'
isNew: false
date: 2021-10-05
author:
name: 'Kamran Ahmed'
url: 'https://twitter.com/kamrify'
imageUrl: '/authors/kamranahmedse.jpeg'
authorId: 'kamran'
sitemap:
priority: 0.7
changefreq: 'weekly'

@ -4,10 +4,7 @@ description: 'Learn what is dependency injection and how to write better code wi
duration: '3 minutes'
isNew: false
date: 2020-07-04
author:
name: 'Kamran Ahmed'
url: 'https://twitter.com/kamrify'
imageUrl: '/authors/kamranahmedse.jpeg'
authorId: 'kamran'
sitemap:
priority: 0.7
changefreq: 'weekly'

@ -4,10 +4,7 @@ description: 'Learn what is DOM, Shadow DOM and Virtual DOM and how they work.'
duration: '6 minutes'
isNew: false
date: 2020-07-20
author:
name: 'Kamran Ahmed'
url: 'https://twitter.com/kamrify'
imageUrl: '/authors/kamranahmedse.jpeg'
authorId: 'kamran'
sitemap:
priority: 0.7
changefreq: 'weekly'

@ -4,10 +4,7 @@ description: 'Learn about the different consistency models in distributed system
duration: '5 minutes'
isNew: false
date: 2021-11-30
author:
name: 'Kamran Ahmed'
url: 'https://twitter.com/kamrify'
imageUrl: '/authors/kamranahmedse.jpeg'
authorId: 'kamran'
sitemap:
priority: 0.7
changefreq: 'weekly'

@ -4,10 +4,7 @@ description: 'Everything you need to know about YAML'
duration: '8 minutes'
isNew: false
date: 2021-10-18
author:
name: 'Kamran Ahmed'
url: 'https://twitter.com/kamrify'
imageUrl: '/authors/kamranahmedse.jpeg'
authorId: 'kamran'
sitemap:
priority: 0.7
changefreq: 'weekly'

@ -1,14 +1,13 @@
import type { MarkdownFileType } from './file';
import type {AuthorFileType} from "./author.ts";
import type { AuthorFileType } from './author.ts';
import { getAllAuthors } from './author.ts';
import type {GuideFileType} from "./guide.ts";
import {getAllGuides} from "./guide.ts";
export interface VideoFrontmatter {
title: string;
description: string;
author: {
name: string;
url: string;
imageUrl: string;
};
authorId: string;
seo: {
title: string;
description: string;
@ -40,6 +39,14 @@ function videoPathToId(filePath: string): string {
return fileName.replace('.md', '');
}
export async function getVideosByAuthor(
authorId: string,
): Promise<VideoFileType[]> {
const allVideos = await getAllVideos();
return allVideos.filter((video) => video.author?.id === authorId);
}
/**
* Gets all the videos sorted by the publishing date
* @returns Promisifed video files
@ -49,10 +56,15 @@ export async function getAllVideos(): Promise<VideoFileType[]> {
eager: true,
});
const allAuthors = await getAllAuthors();
const videoFiles = Object.values(videos);
const enrichedVideos = videoFiles.map((videoFile) => ({
...videoFile,
id: videoPathToId(videoFile.file),
author: allAuthors.find(
(author) => author.id === videoFile.frontmatter.authorId,
)!,
}));
return enrichedVideos.sort(

@ -2,9 +2,10 @@
import BaseLayout from '../../layouts/BaseLayout.astro';
import AstroIcon from '../../components/AstroIcon.astro';
import { getGuidesByAuthor } from '../../lib/guide';
import { getAllVideos } from '../../lib/video';
import {getAllVideos, getVideosByAuthor} from '../../lib/video';
import GuideListItem from '../../components/GuideListItem.astro';
import { getAuthorById, getAuthorIds } from '../../lib/author';
import VideoListItem from "../../components/VideoListItem.astro";
interface Params extends Record<string, string | undefined> {}
@ -18,10 +19,13 @@ export async function getStaticPaths() {
const { authorId } = Astro.params;
console.log(authorId);
const author = await getAuthorById(authorId);
console.log(author);
const guides = await getGuidesByAuthor(authorId);
const videos = await getAllVideos();
const videos = await getVideosByAuthor(authorId);
---
<BaseLayout
@ -35,7 +39,7 @@ const videos = await getAllVideos();
<div class='container pt-4 pb-0 md:pb-16 md:pt-8'>
<div class=''>
<div class='mb-5 flex items-center gap-8 rounded-3xl py-0 md:py-8'>
<div>
<div class="flex-grow">
<h1 class='text-2xl md:text-3xl font-bold'>{author.frontmatter.name}</h1>
<div
class='mt-1 mb-4 md:mt-4 md:mb-6 flex flex-col gap-3 text-gray-800 [&>p>a]:font-semibold [&>p>a]:underline leading-normal'
@ -105,6 +109,7 @@ const videos = await getAllVideos();
class='rounded-t-xl bg-gradient-to-b from-gray-100 to-white px-3 py-2 md:px-6 md:py-3 [&>*:last-child]:border-b-0'
>
{guides.map((guide) => <GuideListItem guide={guide} />)}
{videos.map((video) => <VideoListItem video={video} />)}
</div>
</div>
</BaseLayout>

Loading…
Cancel
Save