Skip to content

reflex-site-shared: canonical override + Try-for-free primary CTA#6521

Merged
masenf merged 1 commit into
reflex-dev:mainfrom
PalashAwasthi05:streamlit-migration-shared
May 19, 2026
Merged

reflex-site-shared: canonical override + Try-for-free primary CTA#6521
masenf merged 1 commit into
reflex-dev:mainfrom
PalashAwasthi05:streamlit-migration-shared

Conversation

@PalashAwasthi05
Copy link
Copy Markdown
Contributor

@PalashAwasthi05 PalashAwasthi05 commented May 16, 2026

Summary

Two small changes to reflex-site-shared for the Streamlit migration PR series:

  1. meta.create_meta_tags grows an optional canonical kwarg. When set, the rendered <link rel="canonical">, og:url, and twitter:url all point at that URL instead of the page's own url, so search engines and social crawlers index the same target. Default behavior is unchanged when the kwarg is omitted. The blog companion PR uses this to canonicalize /blog/reflex-streamlit to /migration/streamlit.

  2. cta_card (bottom CTA on every marketing page) swaps Try-for-free into the primary slot and demotes Book a Demo to the ghost-variant secondary. Affects every marketing-templated page across reflex-dev/marketing, reflex-dev/docs, and reflex-dev/blog once their reflex-site-shared lockfiles are bumped. No layout change beyond variant and ordering.

Why

The Streamlit lander targets paid-search traffic on "streamlit alternative" intent. That audience self-serves, so the primary CTA across the site should be "Try for free" with Book a Demo as a clearly secondary path.

Pairs with

Test plan

  • create_meta_tags(..., canonical=None) produces the same output as before.
  • create_meta_tags(..., canonical="https://reflex.dev/foo") renders <link rel="canonical" href="https://reflex.dev/foo"> AND sets og:url/twitter:url to the same URL.
  • cta_card shows "Try for free" (primary, left, with ArrowRight icon) + "Book a Demo" (ghost, right) on every marketing page.

🤖 Generated with Claude Code

@PalashAwasthi05 PalashAwasthi05 requested a review from a team as a code owner May 16, 2026 08:32
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented May 16, 2026

Greptile Summary

This PR makes two additive changes to reflex-site-shared: create_meta_tags gains an optional canonical kwarg so callers can point the <link rel=\"canonical\"> at a different URL without a 301, and the footer's Migration column gets a new "From Streamlit" entry at the top.

  • meta.py: The canonical parameter defaults to None, preserving existing behavior. When provided, it replaces the auto-derived page_url in the canonical link element — but og:url and twitter:url (populated by _build_meta_tags) still use page_url, which may send mixed signals to social crawlers.
  • footer.py: One new footer_link(\"From Streamlit\", \"/migration/streamlit/\") entry, inserted first in the Migration list; no structural changes.

Confidence Score: 4/5

Safe to merge; changes are purely additive and do not touch any critical runtime paths.

Both changes are additive and backwards-compatible. The canonical kwarg defaults to None so all existing call sites are unaffected. The only concern is that when a canonical override is supplied, the OG/Twitter URL tags still reflect the originating page rather than the canonical target, which partially undermines the SEO consolidation goal of the feature. The empty-string fallback with or is a minor defensive gap.

A second look at meta.py is worthwhile — specifically whether og:url should also be updated when a canonical override is provided.

Important Files Changed

Filename Overview
packages/reflex-site-shared/src/reflex_site_shared/meta/meta.py Adds optional canonical kwarg to create_meta_tags; default behavior is preserved, but og:url/twitter:url are not updated to match the override and the fallback uses or rather than an is not None guard.
packages/reflex-site-shared/src/reflex_site_shared/views/footer.py Adds "From Streamlit" footer link at the top of the Migration column; straightforward additive change with no logic concerns.

Sequence Diagram

sequenceDiagram
    participant Caller as Blog / Marketing page
    participant CMT as create_meta_tags()
    participant BMT as _build_meta_tags()
    participant DOM as Rendered HTML

    Caller->>CMT: title, description, image, url, canonical
    CMT->>BMT: "title, description, image_url, url=page_url"
    BMT-->>CMT: "[og:url=page_url, twitter:url=page_url, ...]"
    CMT->>DOM: "link rel=canonical href=canonical"
    Note over DOM: og:url still points to blog post URL<br/>canonical points to migration lander
Loading

Reviews (1): Last reviewed commit: "reflex-site-shared: add canonical overri..." | Re-trigger Greptile

Comment thread packages/reflex-site-shared/src/reflex_site_shared/meta/meta.py Outdated
Comment thread packages/reflex-site-shared/src/reflex_site_shared/meta/meta.py Outdated
@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented May 16, 2026

Merging this PR will not alter performance

✅ 24 untouched benchmarks


Comparing PalashAwasthi05:streamlit-migration-shared (8528bcf) with main (fbd85e3)

Open in CodSpeed

@PalashAwasthi05 PalashAwasthi05 force-pushed the streamlit-migration-shared branch from d9c2129 to 0772902 Compare May 17, 2026 00:05
@PalashAwasthi05 PalashAwasthi05 changed the title reflex-site-shared: add canonical override + Streamlit migration footer link reflex-site-shared: canonical override + Streamlit footer link + Try-for-free primary CTA May 17, 2026
@PalashAwasthi05 PalashAwasthi05 force-pushed the streamlit-migration-shared branch from 0772902 to f4e620a Compare May 18, 2026 20:16
Two small changes to reflex-site-shared for the Streamlit migration PR
series:

1. create_meta_tags grows an optional canonical kwarg. When set, the
   rendered <link rel="canonical">, og:url, and twitter:url all point
   at that URL instead of the page's own url, so search engines and
   social crawlers index the same target. Default behavior unchanged
   when the kwarg is omitted.
2. cta_card (bottom CTA on every marketing page) swaps Try-for-free
   into the primary slot and demotes Book a Demo to the ghost variant
   secondary. Affects every marketing-templated page across the three
   apps once their reflex-site-shared lockfiles are bumped.

Pairs with:
- reflex-dev/marketing PR adding the /migration/streamlit lander.
- reflex-dev/blog PR refreshing /blog/reflex-streamlit with a
  frontmatter canonical override pointing at the new lander.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@PalashAwasthi05 PalashAwasthi05 force-pushed the streamlit-migration-shared branch from f4e620a to 8528bcf Compare May 18, 2026 22:28
@PalashAwasthi05 PalashAwasthi05 changed the title reflex-site-shared: canonical override + Streamlit footer link + Try-for-free primary CTA reflex-site-shared: canonical override + Try-for-free primary CTA May 18, 2026
@masenf masenf merged commit 6511f3b into reflex-dev:main May 19, 2026
70 checks passed
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.

2 participants