diff --git a/app.py b/app.py index 3c2e71b..7fe9a02 100644 --- a/app.py +++ b/app.py @@ -5914,6 +5914,33 @@ async def saasshorts_post_to_socials(req: SaaSPostRequest, request: Request): raise HTTPException(status_code=500, detail=str(e)) +# The gallery and the per-video pages are rendered by this API service, but the +# app they advertise lives on www. A relative href on `api.` host resolves +# against `api.`, where `/` is not the app (it is a 404), so every link that +# crosses hosts is written absolute. `www.openshorts.app/gallery` and +# `/video/...` 301 to the api host (dashboard/nginx.conf), so the api host is +# the final domain for those two and the app host is final for everything else. +APP_HOST = "https://www.openshorts.app" +GALLERY_HOST = "https://api.openshorts.app" + + +def _json_ld(payload: dict) -> str: + """Serialise a JSON-LD payload for an inline ` + +/* The body CTA. Until now the only link to the app on these pages was the fixed + * nav button, so a reader who finished the article had nothing to click: the + * pages sit at positions 1.8-4 with a 0.2-1.6% CTR and no path into the + * product. Copy is per page (`page.cta`) because the push differs — a reader + * on the no-watermark page is arguing about watermarks, not about editing. + * + * Plain same-origin link on purpose: utm_* here would overwrite the visitor's + * real acquisition source (google, reddit...) in lib/attribution.js and split + * the OpenPanel session. The inline handler reports the click with the page + * slug, which is what tells us whether the CTA or the nav button is doing the + * work. */ +const DEFAULT_CTA = { + label: 'Try it', + title: 'Paste a link, get vertical clips', + body: '20 free minutes a month, no credit card. Or self-host it free under MIT.', + button: 'Get free clips', +} + +const ctaBlock = (page) => { + const c = { ...DEFAULT_CTA, ...(page.cta || {}) } + const slug = page.path.replace(/^\//, '').replace(/\//g, '-') || 'home' + const href = `${SITE.url}/` + return ` +
${esc(c.body)}
+${p}
`).join('')}Access your plan and generate shorts with no API keys.
+ {queued && ( ++ Your video is saved. Sign in and the clips start on their own — you will not have to paste it again. +
+