Skip to content

Conversation

@johnnyreilly
Copy link
Owner

@johnnyreilly johnnyreilly commented Sep 30, 2023

This PR migrates the blog to Docusaurus v3; specifically 3.0.0-rc.1. plugins blog post: #717

image-fetchpriority-rehype-plugin

This PR migrates the rehype plugin: image-fetchpriority-rehype-plugin. See image-fetchpriority-rehype-plugin.mjs

image-cloudinary-rehype-plugin

I have been unsuccessful in attempting to migrate the the cloudinary rehype plugin which I've surfaced in the discord forum: https://discord.com/channels/398180168688074762/1154771869094912090/1158839648366383104

Don't be fooled by blog-website/image-cloudinary-rehype-plugin.mjs - that's my failed experiment.

I realise this is all very tough to understand. Essentially I'm trying to update the src of an image. You can read about it here: https://johnnyreilly.com/docusaurus-image-cloudinary-rehype-plugin#introducing-rehype-cloudinary-docusaurus and here: https://github.com/johnnyreilly/rehype-cloudinary-docusaurus

That src of an image, because this is webpack, is a require statement; an expression which when executed will resolve the filename of the asset on disk; something like assets/images/title-image-3374754db55f364cd0bce20c5ff1c2c4.png

With MDX 1 I could just update the expression in the AST and it would be executed in its modified form. In MDX 2 it appears not to be and that seems to be the case because alongside the node, the data/estree element contains the AST of that expression. So to do a modification, there's probably a need to create a new AST for that expression.

And I want to take it from something like:

require("!/home/john/code/github/blog.johnnyreilly.com/blog-website/node_modules/url-loader/dist/cjs.js?limit=0&name=assets/images/[name]-[contenthash].[ext]&fallback=/home/john/code/github/blog.johnnyreilly.com/blog-website/node_modules/file-loader/dist/cjs.js!./title-image.png").default

to: https://res.cloudinary.com/priou/image/fetch/f_auto,q_auto,w_auto,dpr_auto/https://johnnyreilly.com${require("!/home/john/code/github/blog.johnnyreilly.com/blog-website/node_modules/url-loader/dist/cjs.js?limit=0&name=assets/images/[name]-[contenthash].[ext]&fallback=/home/john/code/github/blog.johnnyreilly.com/blog-website/node_modules/file-loader/dist/cjs.js!./title-image.png").default}

Cracked it: johnnyreilly/rehype-cloudinary-docusaurus#9

@github-actions
Copy link

github-actions bot commented Oct 1, 2023

Azure Static Web Apps: Your stage site is ready! Visit it here: https://thankful-sky-0bfc7e803-712.westeurope.1.azurestaticapps.net

@github-actions
Copy link

github-actions bot commented Oct 1, 2023

⚡️ Lighthouse report for the deploy preview of this PR

URL Performance Accessibility Best Practices SEO PWA Report
/ 🟠 57 🟢 98 🟢 92 🟢 90 🟠 88 Report
/about 🟢 96 🟢 96 🟢 100 🟢 94 🟢 100 Report
/blog 🟠 82 🟢 96 🟢 100 🟢 93 🟢 100 Report
/tags 🟠 75 🟢 97 🟢 100 🟠 89 🟢 100 Report
/definitely-typed-the-movie 🟠 85 🟢 98 🟢 100 🟢 96 🟢 100 Report

@github-actions
Copy link

github-actions bot commented Oct 1, 2023

Azure Static Web Apps: Your stage site is ready! Visit it here: https://thankful-sky-0bfc7e803-712.westeurope.1.azurestaticapps.net

@github-actions
Copy link

github-actions bot commented Oct 1, 2023

Azure Static Web Apps: Your stage site is ready! Visit it here: https://thankful-sky-0bfc7e803-712.westeurope.1.azurestaticapps.net

@github-actions
Copy link

github-actions bot commented Oct 6, 2023

Azure Static Web Apps: Your stage site is ready! Visit it here: https://thankful-sky-0bfc7e803-712.westeurope.1.azurestaticapps.net

@github-actions
Copy link

github-actions bot commented Oct 7, 2023

Azure Static Web Apps: Your stage site is ready! Visit it here: https://thankful-sky-0bfc7e803-712.westeurope.1.azurestaticapps.net

@github-actions
Copy link

github-actions bot commented Oct 7, 2023

Azure Static Web Apps: Your stage site is ready! Visit it here: https://thankful-sky-0bfc7e803-712.westeurope.1.azurestaticapps.net

@github-actions
Copy link

github-actions bot commented Oct 7, 2023

Azure Static Web Apps: Your stage site is ready! Visit it here: https://thankful-sky-0bfc7e803-712.westeurope.1.azurestaticapps.net

@github-actions
Copy link

github-actions bot commented Oct 7, 2023

Azure Static Web Apps: Your stage site is ready! Visit it here: https://thankful-sky-0bfc7e803-712.westeurope.1.azurestaticapps.net

@github-actions
Copy link

github-actions bot commented Oct 9, 2023

Azure Static Web Apps: Your stage site is ready! Visit it here: https://thankful-sky-0bfc7e803-712.westeurope.1.azurestaticapps.net

@github-actions
Copy link

Azure Static Web Apps: Your stage site is ready! Visit it here: https://thankful-sky-0bfc7e803-712.westeurope.1.azurestaticapps.net

@github-actions
Copy link

Azure Static Web Apps: Your stage site is ready! Visit it here: https://thankful-sky-0bfc7e803-712.westeurope.1.azurestaticapps.net

@github-actions
Copy link

Azure Static Web Apps: Your stage site is ready! Visit it here: https://thankful-sky-0bfc7e803-712.westeurope.1.azurestaticapps.net

1 similar comment
@github-actions
Copy link

Azure Static Web Apps: Your stage site is ready! Visit it here: https://thankful-sky-0bfc7e803-712.westeurope.1.azurestaticapps.net

@github-actions
Copy link

Azure Static Web Apps: Your stage site is ready! Visit it here: https://thankful-sky-0bfc7e803-712.westeurope.1.azurestaticapps.net

@github-actions
Copy link

Azure Static Web Apps: Your stage site is ready! Visit it here: https://thankful-sky-0bfc7e803-712.westeurope.1.azurestaticapps.net

@github-actions
Copy link

Azure Static Web Apps: Your stage site is ready! Visit it here: https://thankful-sky-0bfc7e803-712.westeurope.1.azurestaticapps.net

@github-actions
Copy link

Azure Static Web Apps: Your stage site is ready! Visit it here: https://thankful-sky-0bfc7e803-712.westeurope.1.azurestaticapps.net

@github-actions
Copy link

Azure Static Web Apps: Your stage site is ready! Visit it here: https://thankful-sky-0bfc7e803-712.westeurope.1.azurestaticapps.net

@github-actions
Copy link

Azure Static Web Apps: Your stage site is ready! Visit it here: https://thankful-sky-0bfc7e803-712.westeurope.1.azurestaticapps.net

@github-actions
Copy link

Azure Static Web Apps: Your stage site is ready! Visit it here: https://thankful-sky-0bfc7e803-712.westeurope.1.azurestaticapps.net

@github-actions
Copy link

Azure Static Web Apps: Your stage site is ready! Visit it here: https://thankful-sky-0bfc7e803-712.westeurope.1.azurestaticapps.net

@github-actions
Copy link

Azure Static Web Apps: Your stage site is ready! Visit it here: https://thankful-sky-0bfc7e803-712.westeurope.1.azurestaticapps.net

@github-actions
Copy link

Azure Static Web Apps: Your stage site is ready! Visit it here: https://thankful-sky-0bfc7e803-712.westeurope.1.azurestaticapps.net

@github-actions
Copy link

Azure Static Web Apps: Your stage site is ready! Visit it here: https://thankful-sky-0bfc7e803-712.westeurope.1.azurestaticapps.net

@github-actions
Copy link

Azure Static Web Apps: Your stage site is ready! Visit it here: https://thankful-sky-0bfc7e803-712.westeurope.1.azurestaticapps.net

@johnnyreilly johnnyreilly merged commit 0d14ce8 into main Oct 28, 2023
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.

2 participants