varianter / variant.no

Variant nettside. Åpen og tilgjengelig for alle.
https://www.variant.no
Other
11 stars 4 forks source link

Ha en søkemotor-tilgjengelig nettside for økt synlighet #555

Closed mathiazom closed 1 month ago

mathiazom commented 2 months ago

Bakgrunn og behov

For å kunne være godt synlig via søk, må vi legge tilrette for god crawling og indeksering fra tjenester. Innhold er som alltid viktigst, men for dette behovet tenker vi på innhold som separat oppgave. Dvs. vi trenger ikke vite hva innholdet skal være, men vi må legge tilrette for at SEO, crawling, preview fungerer bra.

Det er viktig å ta høyde for ulike løsninger som kan referere til innhold:

Dersom innhold på siden har featured bilde, burde det vises som bilde til OpenGraph i rett utsnitt (1,200 x 630 px). Det burde være mulig å velge preview-bilde til OpenGraph via metadata i CMS.

Definisjon av Metadata burde være konsekvent på tvers av innhold, enten det er "pages", eller ting som bloggposter, nyheter, kalkulator, ansattoversikt, osv.

Akseptansekriterier:

### Tasks
- [ ] https://github.com/varianter/variant.no/issues/579
- [ ] https://github.com/varianter/variant.no/issues/578
- [ ] https://github.com/varianter/variant.no/issues/561
- [ ] https://github.com/varianter/variant.no/issues/560
- [ ] https://github.com/varianter/variant.no/issues/573
- [ ] https://github.com/varianter/variant.no/issues/595
mikaelbr commented 2 months ago

Additionally, OpenGraph metadata should be set correctly and individually for each page.

Should also consider generating individual preview images for Open Graph. See example: https://github.com/varianter/handbook/blob/main/pages/api/og-search.tsx

christinaroise commented 2 months ago

For preview images, sanity is backing and contributing to this plugin: https://www.sanity.io/plugins/asset-source-ogimage and vercel has this as an option: https://vercel.com/docs/functions/og-image-generation

All pages have the SEO object added. It will and is added to new pages as we create them as schemas

mathiazom commented 2 months ago

For preview images, sanity is backing and contributing to this plugin: https://www.sanity.io/plugins/asset-source-ogimage

That plugin does not work with Sanity Studio v3, and is no longer maintained.

Here is a v3 fork we could use: https://www.sanity.io/plugins/og-image-generator-plugin

mikaelbr commented 2 months ago

But also, not all roads lead to Sanity. There are possible futures where sites and subsites exsists outside the realm of Sanity. So a solution generic as preview images I don't think needs to be tightly coupled to the CMS.

mikaelbr commented 2 months ago

I think this is a good general rule, to always consider "what should or needs to be part of the CMS", to avoid putting all our eggs into the Sanity basket just by deafult frame of mind

mathiazom commented 2 months ago

Should also consider generating individual preview images for Open Graph. See example: https://github.com/varianter/handbook/blob/main/pages/api/og-search.tsx

What was the reason for not using @vercel/og, but just Satori directly? To support the Node runtime?

mikaelbr commented 2 months ago

In this case it was quick and dirty reuse of something that was running in a docker container (thus not edge as you imply). So that judgement call does not automatically apply to this case.

mikaelbr commented 1 month ago

Avhengig av språk. Scopes til senere

mikaelbr commented 1 month ago

https://v3.variant.no/sitemap.xml show wrongs URLs.

mathiazom commented 1 month ago

Should look into making the sitemap dynamic (generate per request, not at build)

https://github.com/iamvishnusankar/next-sitemap?tab=readme-ov-file#server-side-sitemap-getserversidesitemap

mathiazom commented 1 month ago

Sitemap has now been set to generate per request in order to keep the urls fresh. Since this is a fairly naive approach, an issue has been created to create a more performant solution: #650

mathiazom commented 1 month ago

Some bugs that need to be fixed: #693, #694