mirror of
https://github.com/kamranahmedse/developer-roadmap.git
synced 2025-08-15 05:34:05 +02:00
Add tns link
This commit is contained in:
@@ -1,5 +1,8 @@
|
||||
{
|
||||
"devToolbar": {
|
||||
"enabled": false
|
||||
},
|
||||
"_variables": {
|
||||
"lastUpdateCheck": 1714413381505
|
||||
}
|
||||
}
|
2329
pnpm-lock.yaml
generated
2329
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
@@ -29,6 +29,7 @@ import { Spinner } from '../ReactIcons/Spinner';
|
||||
import { GitHubIcon } from '../ReactIcons/GitHubIcon.tsx';
|
||||
import { GoogleIcon } from '../ReactIcons/GoogleIcon.tsx';
|
||||
import { YouTubeIcon } from '../ReactIcons/YouTubeIcon.tsx';
|
||||
import { resourceTitleFromId } from '../../lib/roadmap.ts';
|
||||
|
||||
type TopicDetailProps = {
|
||||
resourceTitle?: string;
|
||||
@@ -207,7 +208,9 @@ export function TopicDetail(props: TopicDetailProps) {
|
||||
}
|
||||
|
||||
const hasContent = topicHtml?.length > 0 || links?.length > 0 || topicTitle;
|
||||
const resourceTitleForSearch = resourceTitle?.toLowerCase()?.replace(/\s+?roadmap/ig, '');
|
||||
const resourceTitleForSearch = resourceTitle
|
||||
?.toLowerCase()
|
||||
?.replace(/\s+?roadmap/gi, '');
|
||||
const googleSearchUrl = `https://www.google.com/search?q=${topicHtmlTitle?.toLowerCase()} guide for ${resourceTitleForSearch}`;
|
||||
const youtubeSearchUrl = `https://www.youtube.com/results?search_query=${topicHtmlTitle?.toLowerCase()} for ${resourceTitleForSearch}`;
|
||||
|
||||
@@ -216,7 +219,7 @@ export function TopicDetail(props: TopicDetailProps) {
|
||||
<div
|
||||
ref={topicRef}
|
||||
tabIndex={0}
|
||||
className="fixed right-0 top-0 z-40 h-screen w-full overflow-y-auto bg-white p-4 focus:outline-0 sm:max-w-[600px] sm:p-6"
|
||||
className="fixed right-0 top-0 z-40 flex h-screen w-full flex-col overflow-y-auto bg-white p-4 focus:outline-0 sm:max-w-[600px] sm:p-6"
|
||||
>
|
||||
{isLoading && (
|
||||
<div className="flex w-full justify-center">
|
||||
@@ -230,6 +233,7 @@ export function TopicDetail(props: TopicDetailProps) {
|
||||
|
||||
{!isContributing && !isLoading && !error && (
|
||||
<>
|
||||
<div className="flex-1">
|
||||
{/* Actions for the topic */}
|
||||
<div className="mb-2">
|
||||
{!isEmbed && (
|
||||
@@ -257,7 +261,7 @@ export function TopicDetail(props: TopicDetailProps) {
|
||||
|
||||
{/* Topic Content */}
|
||||
{hasContent ? (
|
||||
<div className="prose prose-h1:text-balance prose-quoteless prose-h1:mb-2.5 prose-h1:mt-7 prose-h2:mb-3 prose-h2:mt-0 prose-h3:mb-[5px] prose-h3:mt-[10px] prose-p:mb-2 prose-p:mt-0 prose-blockquote:font-normal prose-blockquote:not-italic prose-blockquote:text-gray-700 prose-li:m-0 prose-li:mb-0.5">
|
||||
<div className="prose prose-quoteless prose-h1:mb-2.5 prose-h1:mt-7 prose-h1:text-balance prose-h2:mb-3 prose-h2:mt-0 prose-h3:mb-[5px] prose-h3:mt-[10px] prose-p:mb-2 prose-p:mt-0 prose-blockquote:font-normal prose-blockquote:not-italic prose-blockquote:text-gray-700 prose-li:m-0 prose-li:mb-0.5">
|
||||
{topicTitle && <h1>{topicTitle}</h1>}
|
||||
<div
|
||||
id="topic-content"
|
||||
@@ -302,16 +306,17 @@ export function TopicDetail(props: TopicDetailProps) {
|
||||
|
||||
{/* Contribution */}
|
||||
{canSubmitContribution && !hasEnoughLinks && contributionUrl && (
|
||||
<div className="mt-8 mb-12 flex-1 border-t text-gray-400 text-sm">
|
||||
<div className='mt-3 mb-4'>
|
||||
<p className=''>
|
||||
Can't find what you're looking for? Try these pre-filled search queries:
|
||||
<div className="mb-12 mt-3 border-t text-sm text-gray-400">
|
||||
<div className="mb-4 mt-3">
|
||||
<p className="">
|
||||
Can't find what you're looking for? Try these pre-filled
|
||||
search queries:
|
||||
</p>
|
||||
<div className="mt-3 flex gap-2 text-gray-700">
|
||||
<a
|
||||
href={googleSearchUrl}
|
||||
target="_blank"
|
||||
className="text-xs flex items-center gap-2 rounded-md border border-gray-300 px-3 py-1.5 pl-2 hover:border-gray-700 hover:bg-gray-100"
|
||||
className="flex items-center gap-2 rounded-md border border-gray-300 px-3 py-1.5 pl-2 text-xs hover:border-gray-700 hover:bg-gray-100"
|
||||
>
|
||||
<GoogleIcon className={'h-4 w-4'} />
|
||||
Google
|
||||
@@ -319,7 +324,7 @@ export function TopicDetail(props: TopicDetailProps) {
|
||||
<a
|
||||
href={youtubeSearchUrl}
|
||||
target="_blank"
|
||||
className="text-xs flex items-center gap-2 rounded-md border border-gray-300 px-3 py-1.5 pl-2 hover:border-gray-700 hover:bg-gray-100"
|
||||
className="flex items-center gap-2 rounded-md border border-gray-300 px-3 py-1.5 pl-2 text-xs hover:border-gray-700 hover:bg-gray-100"
|
||||
>
|
||||
<YouTubeIcon className={'h-4 w-4 text-red-500'} />
|
||||
YouTube
|
||||
@@ -328,9 +333,9 @@ export function TopicDetail(props: TopicDetailProps) {
|
||||
</div>
|
||||
|
||||
<p className="mb-2 mt-2 leading-relaxed">
|
||||
Help us improve this introduction and submit a link to a good
|
||||
article, podcast, video, or any other self-vetted resource that helped you
|
||||
understand this topic better.
|
||||
Help us improve this introduction and submit a link to a
|
||||
good article, podcast, video, or any other self-vetted
|
||||
resource that helped you understand this topic better.
|
||||
</p>
|
||||
<a
|
||||
href={contributionUrl}
|
||||
@@ -342,6 +347,35 @@ export function TopicDetail(props: TopicDetailProps) {
|
||||
</a>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
{resourceId === 'devops' && (
|
||||
<div className="mt-4">
|
||||
<a
|
||||
href={'https://thenewstack.io'}
|
||||
target="_blank"
|
||||
className="hidden rounded-md border bg-gray-200 px-2 py-2 text-sm hover:bg-gray-300 sm:block"
|
||||
>
|
||||
<span className="badge mr-1.5">Partner</span>
|
||||
Get the latest {resourceTitleFromId(resourceId)} news from our
|
||||
sister site{' '}
|
||||
<span className="font-medium underline underline-offset-1">
|
||||
TheNewStack.io
|
||||
</span>
|
||||
</a>
|
||||
|
||||
<a
|
||||
href={'https://thenewstack.io'}
|
||||
className="hidden rounded-md border bg-gray-200 px-2 py-1.5 text-sm hover:bg-gray-300 min-[390px]:block sm:hidden"
|
||||
>
|
||||
<span className="badge mr-1.5">Partner</span>
|
||||
Visit{' '}
|
||||
<span className="font-medium underline underline-offset-1">
|
||||
TheNewStack.io
|
||||
</span>{' '}
|
||||
for {resourceTitleFromId(resourceId)} news
|
||||
</a>
|
||||
</div>
|
||||
)}
|
||||
</>
|
||||
)}
|
||||
|
||||
|
@@ -1,5 +1,16 @@
|
||||
import type { MarkdownFileType } from './file';
|
||||
|
||||
export function resourceTitleFromId(id: string): string {
|
||||
if (id === 'devops') {
|
||||
return 'DevOps';
|
||||
}
|
||||
|
||||
return id
|
||||
.split('-')
|
||||
.map((word) => word.charAt(0).toUpperCase() + word.slice(1))
|
||||
.join(' ');
|
||||
}
|
||||
|
||||
export interface RoadmapFrontmatter {
|
||||
pdfUrl: string;
|
||||
order: number;
|
||||
|
Reference in New Issue
Block a user