1
0
mirror of synced 2025-12-19 18:10:59 -05:00

fix link back to journey page href (#58103)

This commit is contained in:
Robert Sese
2025-10-21 19:52:56 -05:00
committed by GitHub
parent 364e9f8c79
commit 156000f371
2 changed files with 8 additions and 3 deletions

View File

@@ -3,6 +3,7 @@ import { useRouter } from 'next/router'
import { Link } from '@/frame/components/Link'
import type { JourneyContext } from '@/journeys/lib/journey-path-resolver'
import { useTranslation } from '@/languages/components/useTranslation'
import { useVersion } from '@/versions/components/useVersion'
type Props = {
journey: JourneyContext
@@ -10,9 +11,11 @@ type Props = {
export function JourneyTrackCard({ journey }: Props) {
const { locale } = useRouter()
const { currentVersion } = useVersion()
const { t } = useTranslation('journey_track_nav')
const { trackTitle, journeyTitle, journeyPath, nextGuide, numberOfGuides, currentGuideIndex } =
journey
const fullPath = `/${locale}/${currentVersion}${journeyPath}?feature=journey-landing`
return (
<div
@@ -21,7 +24,7 @@ export function JourneyTrackCard({ journey }: Props) {
>
<div className="d-flex flex-column width-full">
<h2 className="h4">
<Link href={`/${locale}${journeyPath}`} className="mb-1 text-underline">
<Link href={fullPath} className="mb-1 text-underline">
{journeyTitle}
</Link>
</h2>
@@ -41,7 +44,7 @@ export function JourneyTrackCard({ journey }: Props) {
</Link>
</>
) : (
<Link href={`/${locale}${journeyPath}`} className="h5 text-bold color-fg f5 ml-1">
<Link href={fullPath} className="h5 text-bold color-fg f5 ml-1">
{t('more_articles')}
</Link>
)}

View File

@@ -2,6 +2,7 @@ import { getPathWithoutLanguage, getPathWithoutVersion } from '@/frame/lib/path-
import { renderContent } from '@/content-render/index'
import { executeWithFallback } from '@/languages/lib/render-with-fallback'
import getApplicableVersions from '@/versions/lib/get-applicable-versions'
import Permalink from '@/frame/lib/permalink'
import getLinkData from './get-link-data'
export interface JourneyContext {
@@ -170,7 +171,8 @@ export async function resolveJourneyContext(
trackName: track.id,
trackTitle: track.title,
journeyTitle: journeyPage.title || '',
journeyPath: journeyPage.permalink || `/${journeyPage.relativePath || ''}`,
journeyPath:
journeyPage.permalink || Permalink.relativePathToSuffix(journeyPage.relativePath || ''),
currentGuideIndex: guideIndex,
numberOfGuides: track.guides.length,
}