Skip to content

feat(blog): Add an Apply CTA to the Two Pointers post - #1425

Merged
jeromehardaway merged 3 commits into
masterfrom
feat/two-pointers-apply-cta
Sep 27, 2026
Merged

jeromehardaway merged 3 commits into
masterfrom
feat/two-pointers-apply-cta

Conversation

@jeromehardaway

Copy link
Copy Markdown
Contributor

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. MarkdownRenderer added target="_blank" rel="nofollow" to every link, so an internal /apply link would have opened in a new tab and been marked nofollow.

Solution

  • src/components/markdown-renderer/index.tsx: the link renderer now adds target="_blank" rel="nofollow" only when the href starts with http:// or https://. Internal paths such as /apply render 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 (keeps target="_blank" and rel="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 /apply with the word Apply.

Verification

  • rm -rf .next/types; npm run typecheck: exit 0
  • npx biome check src/components/markdown-renderer/index.tsx __tests__/components/markdown-renderer.test.tsx: no errors
  • npx vitest run __tests__/components/markdown-renderer.test.tsx: 1 failed before the fix (target="_blank" on /apply), 2/2 passed after
  • npm test: 103 files, 1370 tests passed
  • npm run build: exit 0
  • npm run start -- -p 3602, then curl:
    • /blogs/two-pointers-a-practical-technique-for-code-challenges returns 200. Title and meta description are unchanged.
    • The HTML contains <a href="/apply"><strong>Apply</strong></a> with no target or rel.
    • External links keep their attributes: <a target="_blank" rel="nofollow" href="https://github.com/sponsors/vetswhocode">
    • /apply returns 200
  • In Chrome, the hydrated DOM after the client-side DOMPurify pass shows the same result.
  • Full-page screenshot at 1280 wide: the new section renders under "Support Vets Who Code" and above the tags and share row.

Follow-ups

  • Absolute links to our own domain (https://vetswhocode.io/..., 34 in src/data, 30 of them /donate) still count as external and keep target="_blank" rel="nofollow". We could rewrite them as relative paths, or have the renderer compare the host against siteConfig.url.
  • The issue suggests a template-level CTA for every post in the Code Challenges category. That should be its own issue.
  • After deploy, check the live post (last acceptance item).

Closes #1422

Also updates a comment in src/containers/decision-landing/index.tsx that described the old renderer behaviour.

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.
@vercel

vercel Bot commented Sep 27, 2026 •

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
vets-who-code-app Ready Ready Preview Sep 27, 2026 1:10am UTC

Request Review

This branch was successfully deployed

1 active deployment
Preview — 30c83b0a Deployed Sep 27, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Task]: Add an Apply CTA to the Two Pointers blog post

1 participant