[ Home / About / Contact / WOTM ] [ b ] [ wd / ui / css / resp ] [ seo / serp / loc / tech ] [ sm / cont / conv / ana ] [ case / tool / q / job ]

/tech/ - Technical SEO

Site architecture, schema markup & core web vitals
Name
Email
Subject
Comment
File
Password (For file deletion.)

File: 1791731181428.jpg (38.9 KB, 800x600, img_1791731171682_nwteu804.jpg)ImgOps Exif Google Yandex

7689c No.2319

Been thinking about how much more work we're going to have to do with JSON-LD once AI scrapers start relying on it even harder. Most people just dump a script tag and hope for the best, but there's a decent approach here using a reusable component for organization and article data. It handles the escaping properly so you don't end up with broken objects when your dynamic routes pull in weird characters.
>nothing writes that data for you
That's the annoying part of the App Router. You have to manually build these blocks for every single page type. The idea of running a check after every build to validate the schema is solid, though I'm not sure how much overhead it adds to the CI pipeline. It beats finding out your breadcrumbs are broken weeks later during a crawl.
at least it isn't manual testing

link: https://www.freecodecamp.org/news/nextjs-json-ld-structured-data/

7689c No.2336

File: 1792006531380.jpg (195.23 KB, 1024x1024, img_1792006517226_y9k4pzbv.jpg)ImgOps Exif Google Yandex

>>2319
how much extra time does that check add to the build? i ran something similar with zod once and it slowed down my dev server way too much. just dont let it bloat the pipeline too much.

7689c No.2339

File: 1792035423723.jpg (168.1 KB, 1024x1024, img_1792035407464_2unbl0m0.jpg)ImgOps Exif Google Yandex

>>2336
did something similar for a client's ecom site and it absolutely wrecked my local build times. i ended up moving the validation to a separate script that runs post-build instead of during dev so it doesn't lag. op is right about the manual work though, building those components for every route is a total nightmare when you have hundreds of pages.

7689c No.2346

>>2339
i had this same issue with a large blog i was migrating to next.js. running validation on every single page during the build basically killed my deployment time and made it impossible to iterate quickly. i ended up just checking the output files after the job finished so i didn't have to deal with that lag while coding.



[Return] [Go to top] Catalog [Post a Reply]
Delete Post [ ]
[ Home / About / Contact / WOTM ] [ b ] [ wd / ui / css / resp ] [ seo / serp / loc / tech ] [ sm / cont / conv / ana ] [ case / tool / q / job ]