Fetch blog posts from cl8y-research API (blocked until API is up) #7
Labels
No labels
agent:implement
agent:ready
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
ready
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
code/CL8Y-web#7
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Blocked on the cl8y-research posts API being up. Do not merge a fetcher that points at an empty or unpublished API.
CL8Y-webstays a static Vite SPA: fetch published posts (list, body, hero, RSS as needed) fromcl8y-researchinstead of compiling MDX fromsrc/blog/posts/*.mdxand opening a marketing-site MR for every weekly recap.Option B approved:
gaps/GAP_1788152435.md§3.3. Research implementation: cl8y-research#2 (this ticket must stayis_blocked_bythat issue).Unblock signal: research
GET /health(or/ready) is 200 andGET /v1/postsincludes seededcl8y-roadmap-cmm-bridge-yieldomega.Current codebase
/blog(BlogListPage.tsx),/blog/:slug(BlogPostPage.tsx+ArticleLayout.tsx+SEO.tsx).src/blog/blogIndex.ts—import.meta.glob("./posts/*.mdx")+virtual:blog-post-meta.vite.config.tsgetBlogPrerenderRoutes()from the posts directory.scripts/generate-rss.mjsfrom MDX frontmatter; dev middleware/rss.xml.src/blog/posts/cl8y-roadmap-cmm-bridge-yieldomega.mdx+public/images/blog/cl8y-roadmap-cmm-bridge-yieldomega-hero.jpg./blogcoverage (e2e/is token, listings, chrome, discovery, trade).DENY/frame-ancestors 'none'; keep/blogrewrites (render.yaml, host-headers skill).blog_gen/SKILL.md. Do not move the worker into this repo (#4 moved to cl8y-research#1).wordCountis computed at build from MDX. After fetch, use API-provided computedwordCount(research must not let the model author it).Why this is needed
Per-post MDX MRs on the marketing site are slow and mix journalism with positioning/token-directory review. The worker already exists so this SPA does not hold Telegram/Replicate secrets. Fetching published JSON/JPEG/RSS keeps prerender/SEO if build or runtime fetch is done carefully.
The roadmap post must remain on cl8y.com the day the glob is removed — that requires the research import seed to be live first.
Constraints / guardrails
cl8y-researchas an npm package. HTTPS GET only.REPLICATE_*/TELEGRAM_*/DATABASE_URLin Vite env.VITE_RESEARCH_API_ORIGIN(or similar) = origin only, https, allowlisted host (e.g.https://research.cl8y.com) — same host-header discipline as other product URLs (GitLab #3).RETIRED_HOMEPAGE_MODULES. Do not rewriteCL8Y_WHITEPAPER.md. Do not change#tokendirectory (GitLab #2) except links into blog if already present./blogand/blog/:slug. No blank white page if API is down; do not fall back to executing random MDX from the network without sanitizing (prefer JSON + a constrained renderer, or precompiled HTML from API if research serves it).dangerouslySetInnerHTMLon API HTML unless research guarantees sanitized HTML and CSP is reviewed. Prefer MDX compile at API publish time to a safe representation, or keep Markdown-to-React with the same sanitizer rules.X-Frame-Options/ CSP for/blog/*.Relevant files
src/blog/blogIndex.tssrc/blog/BlogListPage.tsxsrc/blog/BlogPostPage.tsxsrc/blog/ArticleLayout.tsxvite.config.tsscripts/generate-rss.mjsrender.yaml/_redirects/blogrewritese2e/*.spec.tssrc/lib/siteUrls.ts/ envblog_gen/SKILL.mdRecommended direction
GET /v1/postsand/v1/posts/:slugat build; prerender those routes; RSS from API or from fetched meta. Runtime fetch as enhancement for freshness between deploys or webhook-triggered rebuild (document).<img src="{API}/v1/images/blog/{slug}-hero.jpg">or copy intodistat build./blog, featured title of seeded post,/blog/:slug, 404 slug, (optional) RSS contains item.Acceptance criteria
/v1/postscontainscl8y-roadmap-cmm-bridge-yieldomega./bloglists that post (title/date) without MDX glob as the source of truth./blog/cl8y-roadmap-cmm-bridge-yieldomegarenders body + hero (no 404 image).yarn test && yarn typecheck && yarn lint && yarn buildgreen./blogand one post + 404.grepdist).Test plan — functional paths
scripts/verify-prerender-meta.mjs) includes/blog/<slug>.Test plan — attack, hack, and abuse
<script>alert(1)</script>must not execute in the browser.bridge.cl8y.com.evilnot linked.imagefield (//evil.testorjavascript:).VITE_RESEARCH_API_ORIGINcannot be a relative URL orhttp://in production builds./blog/*still DENY.?status=draftand ignores unknown fields that would show unpublished.Verification criteria
/blogand the roadmap article against staging API.dist/has noREPLICATE/BOT_TOKEN.Gate: GitLab Free cannot set
is_blocked_by. This issue relates to cl8y-research#2.Do not merge the fetcher until that API is up:
GET /health(or/ready) is 200 andGET /v1/postsincludes seededcl8y-roadmap-cmm-bridge-yieldomega.