Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Articles > stories URL changes #11325

Merged
merged 9 commits into from
Oct 29, 2024
Merged

Articles > stories URL changes #11325

merged 9 commits into from
Oct 29, 2024

Conversation

gestchild
Copy link
Contributor

@gestchild gestchild commented Oct 23, 2024

What does this change?

For #11071

  • redirects /articles/:id to /stories/:id
  • redirects /articles' to /search/stories
  • redirects /stories/comic to /search/stories filtered by comic

These redirects are temporarily done in the next.config.js file. This means we can deploy the code and redirects at the same time and nothing will break. Once this is live, I'll move the redirects to the lambda function we use for all the other redirects and remove these ones.

  • updates 'more stories' and 'more comics' links on the story landing page to point to the stories search equivalents
  • amends linkResolver to point article and webcomic types to /stories/:id
  • removes the page templates that were serving /articles and /stories/comic

Also adds hotjar script for stories pages, see: #11331

Questions:

  • is it ok to point /stories/comic to /search/stories filtered by comic? -yes
  • was anything else being served at /stories/:customType? - no
  • don't like having the redirects in more than one place. Can/should we use the redirection lambda rather than next config redirects? - yes, but temporarily use these so nothing breaks
  • do we need to update the literalRedirects that point to articles/:uid? - yes, as part of the lambda work

How to test

  • need to restart the app when checking out the branch in order for the redirects to work
  • visiting localhost:3000/articles/the-power-of-art should render the page at localhost:3000/stories/the-power-of-art
  • visiting /articles takes you to /search/stories
  • visiting /stories/comic takes you to /search/stories filtered by comic

You will also be able to see the 301 redirects in the network tab of the developer toolbar.

  • Following the 'more stories' and 'more comics' links on the stories landing page takes you directly to the above search pages
  • Story cards for articles/web comics all point to /stories/:uid
  • Canonical link hrefs for articles/web point to /stories/:uid

How can we measure success?

We serve pages at /stories/:uid rather than /articles:uid

Have we considered potential risks?

Will there be an impact on Analytics data?

Copy link

github-actions bot commented Oct 23, 2024

Size Change: -5.63 kB (-0.57%)

Total Size: 979 kB

Filename Size Change
content/webapp/.next/static/chunks/pages/_app-985634e19b761643.js 0 B -110 kB (removed) 🏆
content/webapp/.next/static/chunks/pages/articles-1212be3db90b136d.js 0 B -2.96 kB (removed) 🏆
content/webapp/.next/static/chunks/pages/articles/[articleId]-7cbe19e3c9ca2bf5.js 0 B -6.83 kB (removed) 🏆
content/webapp/.next/static/chunks/pages/stories-a8381c684c611a74.js 0 B -3.62 kB (removed) 🏆
content/webapp/.next/static/chunks/pages/stories/[contentType]-54bad6f92442b3d7.js 0 B -3.01 kB (removed) 🏆
identity/webapp/.next/static/chunks/pages/_app-9fe04d7f367c3a7c.js 0 B -104 kB (removed) 🏆
content/webapp/.next/static/chunks/pages/_app-febe865347db5a30.js 111 kB +111 kB (new file) 🆕
content/webapp/.next/static/chunks/pages/stories-0563e6c52a3e3f60.js 3.64 kB +3.64 kB (new file) 🆕
content/webapp/.next/static/chunks/pages/stories/[articleId]-b34b26e805bb366a.js 7.13 kB +7.13 kB (new file) 🆕
identity/webapp/.next/static/chunks/pages/_app-b7b3151a9e7c3f40.js 104 kB +104 kB (new file) 🆕
ℹ️ View Unchanged
Filename Size
content/webapp/.next/static/chunks/00a8a139.976ae5fd9989bf10.js 59 kB
content/webapp/.next/static/chunks/132.1d7e9ae9baf2bf3e.js 4.82 kB
content/webapp/.next/static/chunks/1349.d2a91366cd45a4ca.js 1.13 kB
content/webapp/.next/static/chunks/1624.078f48c0e02f531b.js 269 B
content/webapp/.next/static/chunks/1747-fefcb42dbbfafe34.js 6.96 kB
content/webapp/.next/static/chunks/2223.13e51946be4f0995.js 1.8 kB
content/webapp/.next/static/chunks/2224.a73abbf8ffcabc4d.js 1.41 kB
content/webapp/.next/static/chunks/2545.c2b990ec5d9479b8.js 1.36 kB
content/webapp/.next/static/chunks/2568.b1076f5e01039efd.js 802 B
content/webapp/.next/static/chunks/2630-4bf3a02ad19c8ede.js 4.46 kB
content/webapp/.next/static/chunks/267-d39fe4d3f0f27696.js 3.67 kB
content/webapp/.next/static/chunks/286.b066630328a98bd8.js 20.8 kB
content/webapp/.next/static/chunks/3.118acbbc2ae9c2bd.js 711 B
content/webapp/.next/static/chunks/3199.4ed9de84fa34a4be.js 439 B
content/webapp/.next/static/chunks/3419.35e7d06626e8c6d0.js 420 B
content/webapp/.next/static/chunks/3420-7e0cf6c9a569a227.js 3.87 kB
content/webapp/.next/static/chunks/3471-3190db4014728fdb.js 2.76 kB
content/webapp/.next/static/chunks/3627.3684abdbe8510420.js 1.77 kB
content/webapp/.next/static/chunks/382-ca57e688a4545109.js 3.07 kB
content/webapp/.next/static/chunks/4468.bdc27fdcaba7eeb6.js 6.42 kB
content/webapp/.next/static/chunks/4537-29080707bc0242bb.js 4.22 kB
content/webapp/.next/static/chunks/4825-4df3e43759acfe8c.js 7.76 kB
content/webapp/.next/static/chunks/4962-1a876f84ea228198.js 12.3 kB
content/webapp/.next/static/chunks/5006-e89ff8af75151368.js 7.15 kB
content/webapp/.next/static/chunks/5048.c1216d2909771efa.js 2.87 kB
content/webapp/.next/static/chunks/5286-bee6f4dcdeeae555.js 3.27 kB
content/webapp/.next/static/chunks/5292-b399898dfbbd0ba7.js 2.83 kB
content/webapp/.next/static/chunks/5389.d762d43fb2d0a421.js 1.7 kB
content/webapp/.next/static/chunks/5435-4268f265804ebf5e.js 4.6 kB
content/webapp/.next/static/chunks/5768-699dd21166035c67.js 3.18 kB
content/webapp/.next/static/chunks/5843-e7a3b6f6cdcea870.js 3.09 kB
content/webapp/.next/static/chunks/6207.faaccc5f80a44f7a.js 268 B
content/webapp/.next/static/chunks/6318.9b79dafa4a83ab14.js 2.29 kB
content/webapp/.next/static/chunks/6501.a3977bc142afc39e.js 1.35 kB
content/webapp/.next/static/chunks/6577-effbaab7dae5448b.js 3.52 kB
content/webapp/.next/static/chunks/6862-7cf8b92070da46f4.js 4.43 kB
content/webapp/.next/static/chunks/6879.76da889a24c486ba.js 2.6 kB
content/webapp/.next/static/chunks/7044-b6c14b7fdc5073c5.js 5.51 kB
content/webapp/.next/static/chunks/7107-eecda3d84c2ca297.js 34.1 kB
content/webapp/.next/static/chunks/722-2ee52edde987a147.js 3.25 kB
content/webapp/.next/static/chunks/7414-03438ef5466cad65.js 6 kB
content/webapp/.next/static/chunks/7440.919417010418505e.js 2.85 kB
content/webapp/.next/static/chunks/7603-ae8849f32a8640b6.js 3.26 kB
content/webapp/.next/static/chunks/7888.a02595574e302988.js 5.3 kB
content/webapp/.next/static/chunks/8189-461a5e1315036809.js 3.45 kB
content/webapp/.next/static/chunks/8348.7aa3dc55a5cec72b.js 1.26 kB
content/webapp/.next/static/chunks/9042-da245b7540a5c643.js 5.21 kB
content/webapp/.next/static/chunks/9049-a63f6fa100834eba.js 3.63 kB
content/webapp/.next/static/chunks/908.c3283f73c6e55bbf.js 1.79 kB
content/webapp/.next/static/chunks/9262-1efa3cbea792d043.js 21.2 kB
content/webapp/.next/static/chunks/9519-69afe3046dfb3f41.js 6.14 kB
content/webapp/.next/static/chunks/9590.2d7b95171d8d0866.js 579 B
content/webapp/.next/static/chunks/9680-789f6f04bb823f7e.js 3.12 kB
content/webapp/.next/static/chunks/9778-7a9dca488eda648b.js 3.06 kB
content/webapp/.next/static/chunks/9950.02e3834265565be8.js 1.13 kB
content/webapp/.next/static/chunks/framework-cd51c6317946e9aa.js 45.2 kB
content/webapp/.next/static/chunks/main-978dba4ddde48128.js 30.7 kB
content/webapp/.next/static/chunks/pages/_error-4ae94352bfd58ed4.js 335 B
content/webapp/.next/static/chunks/pages/[uid]-e305752b7019cf9b.js 1.97 kB
content/webapp/.next/static/chunks/pages/404-9b6af81752f83cf9.js 263 B
content/webapp/.next/static/chunks/pages/500-7bf98e2f0d70a0db.js 262 B
content/webapp/.next/static/chunks/pages/about-us-0d82c6f665195de1.js 1.97 kB
content/webapp/.next/static/chunks/pages/about-us/[uid]-4517049edeb7bb2c.js 1.97 kB
content/webapp/.next/static/chunks/pages/books-20edbf7e2e9dfc4d.js 2.98 kB
content/webapp/.next/static/chunks/pages/books/[bookId]-077d421bd1e84d05.js 4.2 kB
content/webapp/.next/static/chunks/pages/collections-5d17667caec39f6a.js 2.38 kB
content/webapp/.next/static/chunks/pages/collections/[uid]-0115fc8d5a43ade4.js 1.97 kB
content/webapp/.next/static/chunks/pages/concepts/[conceptId]-af7bff21125eb4c7.js 4.39 kB
content/webapp/.next/static/chunks/pages/cookie-policy-d38036ca95595d73.js 6.3 kB
content/webapp/.next/static/chunks/pages/event-series/[eventSeriesId]-10f4eff99691fdee.js 3.29 kB
content/webapp/.next/static/chunks/pages/events-783010f5e767e147.js 3.09 kB
content/webapp/.next/static/chunks/pages/events/[eventId]-8c9f3d3d3088961f.js 9.12 kB
content/webapp/.next/static/chunks/pages/events/[eventId]/visual-stories-e361b663cc5ee385.js 304 B
content/webapp/.next/static/chunks/pages/exhibitions-d202846410e7833b.js 3.33 kB
content/webapp/.next/static/chunks/pages/exhibitions/[exhibitionId]-b8d995e61cd21d74.js 4.03 kB
content/webapp/.next/static/chunks/pages/exhibitions/[exhibitionId]/visual-stories-b0cfcf472928d278.js 304 B
content/webapp/.next/static/chunks/pages/get-involved-c8c8a19055c2f543.js 1.97 kB
content/webapp/.next/static/chunks/pages/get-involved/[uid]-3d15efb771f0219a.js 1.98 kB
content/webapp/.next/static/chunks/pages/guides/[guideId]-4cad5be175328768.js 2.28 kB
content/webapp/.next/static/chunks/pages/guides/exhibitions-c6009d0dde8bef6b.js 3.56 kB
content/webapp/.next/static/chunks/pages/guides/exhibitions/[id]-a0c813725d8c9372.js 3.51 kB
content/webapp/.next/static/chunks/pages/guides/exhibitions/[id]/[type]-e20ea2f1870b9a00.js 7.31 kB
content/webapp/.next/static/chunks/pages/guides/exhibitions/[id]/[type]/[stop]-0a15eccf1f452b59.js 3.91 kB
content/webapp/.next/static/chunks/pages/index-7a9cc7106ed33d65.js 2 kB
content/webapp/.next/static/chunks/pages/newsletter-9e19b75aab9d58f4.js 2.39 kB
content/webapp/.next/static/chunks/pages/pages/[pageId]-5b0501b00935e191.js 1.93 kB
content/webapp/.next/static/chunks/pages/projects/[projectId]-6a3ac57c911456fa.js 2.26 kB
content/webapp/.next/static/chunks/pages/search-8637bfa593af83bb.js 5.34 kB
content/webapp/.next/static/chunks/pages/search/events-147e6a873dcee57a.js 1.52 kB
content/webapp/.next/static/chunks/pages/search/images-c368bfeff46d5e5c.js 2.16 kB
content/webapp/.next/static/chunks/pages/search/stories-4e28bc872fef8407.js 3.27 kB
content/webapp/.next/static/chunks/pages/search/works-b4853ff80a576e18.js 4.4 kB
content/webapp/.next/static/chunks/pages/seasons/[seasonId]-005659ad17a2f569.js 3.94 kB
content/webapp/.next/static/chunks/pages/series/[seriesId]-58f8f6c9d908435d.js 5.55 kB
content/webapp/.next/static/chunks/pages/slice-simulator-29a0ef9211652363.js 8.48 kB
content/webapp/.next/static/chunks/pages/visit-us-1289d8710ce2b47b.js 2.29 kB
content/webapp/.next/static/chunks/pages/visit-us/[uid]-afff369e510dfeab.js 1.98 kB
content/webapp/.next/static/chunks/pages/visual-stories/[visualStoryId]-13d261b44455da8c.js 242 B
content/webapp/.next/static/chunks/pages/whats-on-425c28a6ef16454b.js 220 B
content/webapp/.next/static/chunks/pages/whats-on/[period]-52becb68c10c131c.js 288 B
content/webapp/.next/static/chunks/pages/works/[workId]-bae28bdc5e974135.js 22.2 kB
content/webapp/.next/static/chunks/pages/works/[workId]/download-ccf37e6191bb73ec.js 3.06 kB
content/webapp/.next/static/chunks/pages/works/[workId]/images-c7b515c70c18d093.js 696 B
content/webapp/.next/static/chunks/pages/works/[workId]/items-6ffa22656f41d8b9.js 217 B
content/webapp/.next/static/chunks/polyfills-c67a75d1b6f99dc8.js 31.1 kB
content/webapp/.next/static/chunks/webpack-19aaff0b2ff3f8f1.js 2.33 kB
identity/webapp/.next/static/chunks/286.b94e91b70e38ea49.js 20.7 kB
identity/webapp/.next/static/chunks/374.94537fd117195c86.js 2.47 kB
identity/webapp/.next/static/chunks/432.fa29da5acdb8e0b1.js 744 B
identity/webapp/.next/static/chunks/442-f1af16c3993c320a.js 8.96 kB
identity/webapp/.next/static/chunks/644-2ca73088ad8338ab.js 16.4 kB
identity/webapp/.next/static/chunks/framework-b330de622121c9cc.js 45.2 kB
identity/webapp/.next/static/chunks/main-d973a3979032d64a.js 32.2 kB
identity/webapp/.next/static/chunks/pages/_error-8e82953fa241027d.js 1.42 kB
identity/webapp/.next/static/chunks/pages/delete-requested-5e24da8710b594ff.js 3.21 kB
identity/webapp/.next/static/chunks/pages/error-2784191c63901541.js 1.7 kB
identity/webapp/.next/static/chunks/pages/index-44b48653e661ac63.js 11.9 kB
identity/webapp/.next/static/chunks/pages/registration-0736636262fc3578.js 4.13 kB
identity/webapp/.next/static/chunks/pages/success-1230b17dd14dc2d1.js 3.29 kB
identity/webapp/.next/static/chunks/pages/validated-962f79b0e82f2836.js 3.37 kB
identity/webapp/.next/static/chunks/polyfills-c67a75d1b6f99dc8.js 31.1 kB
identity/webapp/.next/static/chunks/webpack-d9d97d637ba6ec7a.js 1.82 kB

compressed-size-action

@gestchild gestchild marked this pull request as ready for review October 24, 2024 15:06
@gestchild gestchild requested a review from a team as a code owner October 24, 2024 15:06
@gestchild
Copy link
Contributor Author

@LaurenFBaily would appreciate your thoughts on how this might affect our analytics data and if we need to do anything/let anyone know before this is deployed

@LaurenFBaily
Copy link

Yes it will (again) affect analytics but Grace is aware of the impact. It essentially means that to look at the analytics for a single article created before this change is deployed it will have the traffic split across three different urls. This will matter less as time goes on.

@gestchild
Copy link
Contributor Author

gestchild commented Oct 24, 2024

thanks, I guess we just need to note the date of the deployment then. In the days of UA we could add a note inside GA, don't know if there is an equivalent nowadays

Copy link
Contributor

@rcantin-w rcantin-w left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remind me, did we say we'd do the changes to redirects.ts after this gets deployed?

@rcantin-w rcantin-w changed the title Artices >stories Articles > stories URL changes Oct 28, 2024
@gestchild
Copy link
Contributor Author

Remind me, did we say we'd do the changes to redirects.ts after this gets deployed?

yeah, I'm doing the redirects in the app here, so we can deploy them with the code changes so that nothing breaks. Then will move then to redirects.ts in a subsequent PR

# Conflicts:
#	common/services/prismic/link-resolver.test.ts
@gestchild gestchild merged commit d023620 into main Oct 29, 2024
8 checks passed
@gestchild gestchild deleted the artices->stories branch October 29, 2024 13:12
@gestchild
Copy link
Contributor Author

Changes deployed on 29/10/2024 about 13:35 - added to Notion Doc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants