equinor / energyvision

Home of the equinor.com website
https://www.equinor.com
MIT License
33 stars 8 forks source link

Improve the news slug #652

Closed wenche closed 2 years ago

wenche commented 2 years ago

Background

The news article was the first template we created in this project. Because news is published at regular intervals and not revisited like the topic pages, we took a different approach and decided to keep news outside of the Route concept. Bacause of that decision we have the slug field added directly in the news template.

However, we improved the way we handled the slugs when we worked on the topic pages. We wanted to have the complete URL in the slugs field (or the part after the lang part) https://equinor.com/no`/karriere/min-karriere`. The upside is that Sanity is the single source of truth and we avoid messy logic in the web. I also make it easy to have the dynamic catch-all slug approach. We should update the news template to use this approach as well, and this will probably make things less complicated for the satellite pages as well. Win - win.

TODO

Related: #308 to improve the mechanism for slugs fields

Acceptance criteria

wenche commented 2 years ago

Should have a meeting for this before we start to make sure that everybody knows what to do

wenche commented 2 years ago

Connected to #308

nilsml commented 2 years ago

Discuss with Mette about prepending dates

wenche commented 2 years ago

The preview for news should probably work in the same way as with the rest of the pages: If there's no slug, preview by id instead. Currently the preview will show a message: "The product (!) needs a slug before it can be previewed." We should fix this, since actually adding the slug should not be the first thing to do.

I think we are able to preview by both id and slug, even if everything is in one document? If not, let's consider to just preview by ids all the time. This might also actually be easier, since the id has language information attached for the translations b2f7b874-7b05-4a4f-8033-f4b26841894e__i18n_nb_NO

nilsml commented 2 years ago

@adneforslund to document why we want to change the news slug, benefits vs drawbacks

adneforslund commented 2 years ago

https://www.figma.com/file/xm1aNey7RrP4llwou1t8OX/Envis-content-Figjam?node-id=0%3A1

adneforslund commented 2 years ago

Add generate button, but not add routes, dont add dates with generate

BirteThornquist commented 2 years ago

@fernandolucchesi I have updated the UX for creating slugs in Figma here

Moved the generate button, removed the field for the generated slug to just a write out of the slug and changed the help text.

Skjermbilde 2022-03-03 kl. 09.13.52.png

Skjermbilde 2022-03-03 kl. 09.15.42.png

fernandolucchesi commented 2 years ago

This is ready for review, could you take a look @wenche?

wenche commented 2 years ago

Sanity:

Skjermbilde 2022-03-10 kl. 09.59.53.png

Skjermbilde 2022-03-10 kl. 10.13.34.png Skjermbilde 2022-03-10 kl. 10.17.28.png Skjermbilde 2022-03-10 kl. 10.19.34.png

wenche commented 2 years ago

The design will be improved according to the sketches by #308

This is a HUGE change so it's not that easy to test 100%. It looks good at first glance, but we just have to keep our eyes open to see if something is missing or isn't correct :thumbsup: