Repository navigation
feat(blog): Add an Apply CTA to the Two Pointers post - #1425
Merged
Merged
Conversation
The markdown renderer added target="_blank" rel="nofollow" to every link, so internal paths like /apply opened in a new tab and were marked nofollow. Only http(s) links get those attributes now.
The post draws working engineers from search but ended with no path to /apply. Close it with who Vets Who Code is for, so a reader can send it to a veteran or military spouse they know. Closes #1422
MarkdownRenderer no longer forces target="_blank" rel="nofollow" on internal links, so the comment's reason no longer holds. Say why these pages render through next-mdx-remote instead.
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
"Two Pointers: A Practical Technique for Code Challenges" gets about 10,000 search impressions, mostly from working engineers, but it ends without a link to
/apply. Adding a link was not enough on its own.MarkdownRendereraddedtarget="_blank" rel="nofollow"to every link, so an internal/applylink would have opened in a new tab and been marked nofollow.Solution
src/components/markdown-renderer/index.tsx: the link renderer now addstarget="_blank" rel="nofollow"only when the href starts withhttp://orhttps://. Internal paths such as/applyrender as plain same-tab links. This applies to every markdown-rendered page: blog posts, project pages, code of conduct and interactive lessons.__tests__/components/markdown-renderer.test.tsx: new test with one internal link (no target/rel) and one external link (keepstarget="_blank"andrel="nofollow"). It failed before the fix and passes after.src/data/blogs/two-pointers-a-practical-technique-for-code-challenges.md: new closing section, "Know a Veteran Who Wants to Code?". It says Vets Who Code is a free, remote software engineering accelerator for veterans and military spouses, asks the reader to send the post on, and links to/applywith the word Apply.Verification
rm -rf .next/types; npm run typecheck: exit 0npx biome check src/components/markdown-renderer/index.tsx __tests__/components/markdown-renderer.test.tsx: no errorsnpx vitest run __tests__/components/markdown-renderer.test.tsx: 1 failed before the fix (target="_blank"on/apply), 2/2 passed afternpm test: 103 files, 1370 tests passednpm run build: exit 0npm run start -- -p 3602, then curl:/blogs/two-pointers-a-practical-technique-for-code-challengesreturns 200. Title and meta description are unchanged.<a href="/apply"><strong>Apply</strong></a>with no target or rel.<a target="_blank" rel="nofollow" href="https://github.com/sponsors/vetswhocode">/applyreturns 200Follow-ups
https://vetswhocode.io/..., 34 insrc/data, 30 of them/donate) still count as external and keeptarget="_blank" rel="nofollow". We could rewrite them as relative paths, or have the renderer compare the host againstsiteConfig.url.Closes #1422
Also updates a comment in
src/containers/decision-landing/index.tsxthat described the old renderer behaviour.