-
-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Na podstawie linka do artykułu lub/i tytułu bloga, określa czy jest podcastem, kanałem na YT czy zwykłym blogiem #89
Conversation
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/typeofweb/polskifrontend/1sjugfr9d |
utils/creator-utils.ts
Outdated
import type { ArticlePageProps } from '../pages/artykuly/[slug]'; | ||
|
||
// Detect YouTube videos by the article URL | ||
const ytRegex = /youtu(\.be|be\.com)\//g; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Po co /g?
utils/creator-utils.ts
Outdated
const ytRegex = /youtu(\.be|be\.com)\//g; | ||
|
||
// Detect podcasts by the anchor.fm in article URL (most popular hosting) or podcast name (common words like talk or podcast) | ||
const podcastRegex = /(anchor\.fm\/ | talk | podcast)/i; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Po co spacje?
utils/creator-utils.ts
Outdated
} else if (podcastRegex.exec(article.href) || podcastRegex.exec(article.blog.name)) { | ||
return 'podcast'; | ||
} else { | ||
return 'blog'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dodałbym as const do tych zwracanych wartości
…ontend into redirect-creator-type
Resolves #86
Na podstawie linku do artykułu lub/i tytułu bloga, określa czy jest podcastem, kanałem na YT czy zwykłym blogiem