[{"data":1,"prerenderedAt":537},["ShallowReactive",2],{"article-\u002Fwriting\u002Fvale-110-drupal-prose-checks-while-you-type-20261201":3,"read-next-\u002Fwriting\u002Fvale-110-drupal-prose-checks-while-you-type-20261201":129},{"id":4,"title":5,"articleType":6,"categories":7,"date":9,"description":10,"extension":11,"feedImage":12,"hiddenCategories":13,"meta":15,"paragraphs":16,"path":112,"readingTime":113,"related":114,"sitemap":123,"stem":124,"topics":125,"__hash__":128},"articleEntries\u002Farticles-data\u002Fvale-110-drupal-prose-checks-while-you-type-20261201.json","Vale (for Drupal) 1.1.0: prose checks while you type","Blog post",[8],"Drupal","2026-12-01T16:00:00+11:00","Style guide findings in CKEditor while your editors are still writing, from the same Vale engine that checks the save. Vale (for Drupal) 1.1.0 also checks each translation in its own language, and Drupal Canvas pages.","json",false,[14],"Planet Drupal",{},[17,36,46,54,60,72,90,96,102],{"type":18,"layout":19,"regions":20},"section","layout_onecol",{"content":21},[22,25,27,29],{"type":23,"html":24},"text_formatted","\u003Cp>I've been keeping an eye on Vale's progress for a while, and when I saw its new WebAssembly build I knew I had to bring it to Drupal.\u003C\u002Fp>",{"type":23,"html":26},"\u003Cp>So I did. In 1.1.0, findings from your site's style guide appear in CKEditor while your editors are still writing, underlined the way a spelling mistake would be. That's \u003Ccode>game-changer\u003C\u002Fcode> below, one of the AI tells I lint every post on this site against.\u003C\u002Fp>",{"type":23,"html":28},"\u003Cp>In the five weeks since 1.0.0 it has also learnt to check each translation in its own language, and the text in Drupal Canvas pages.\u003C\u002Fp>",{"type":30,"alt":31,"caption":32,"src":33,"width":34,"height":35},"media","A Text: Formatted paragraph in a Layout Paragraphs dialog on stuar.tc, in Gin. Vale has underlined five findings in the CKEditor text, and the card for “game-changer” is open: an error from the ai-tells.AICompoundPhrases rule.","\u003Cp>My own drafts get the same rules, AI tells included.\u003C\u002Fp>","\u002Fimages\u002Fwriting\u002Fvale-110-drupal-prose-checks-while-you-type-20261201\u002Fvale-ckeditor-findings.png",1280,800,{"type":18,"layout":19,"regions":37,"title":45},{"content":38},[39,41,43],{"type":23,"html":40},"\u003Cp>Vale 3.26.0 ships the CLI's own engine as WebAssembly, and 1.1.0 runs it in a Web Worker beside the editor with your site's \u003Ccode>.vale.ini\u003C\u002Fcode> and styles. It checks once you stop typing, using the same settings a save does.\u003C\u002Fp>",{"type":23,"html":42},"\u003Cp>The server still checks every validated save, which means text that never went through the browser gets checked as well, and until the browser build has loaded, the editor gets its findings from the server instead. Text summaries still wait for the save.\u003C\u002Fp>",{"type":23,"html":44},"\u003Cp>Congratulations to \u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fjdkato\">Joseph Kato\u003C\u002Fa>, Vale's sole developer, on the \u003Ca href=\"https:\u002F\u002Ffloss.fund\u002Fblog\u002Fsecond-tranche-2025-anniversary\u002F\">FLOSS\u002Ffund grant\u003C\u002Fa> that paid for Vale's move to the web. I didn't have to write an engine or a hover card for 1.1.0, because both come from his \u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fvale-cli\u002Fvale-web\">browser extension\u003C\u002Fa>, under its MIT licence. If Vale has improved your writing as well, come and say so on the \u003Ca href=\"https:\u002F\u002Fdiscord.gg\u002FNTX6Xggryj\">Vale Discord\u003C\u002Fa>.\u003C\u002Fp>","The same Vale, in the browser",{"type":18,"layout":19,"regions":47,"title":53},{"content":48},[49,51],{"type":23,"html":50},"\u003Cp>Your editors can take your rules to other sites as well. Import the zip from \u003Ccode>\u002Fvale\u002Fstyles\u003C\u002Fcode> into Vale's browser extension with \u003Cem>Upload archive\u003C\u002Fem>, paste in \u003Ccode>\u002Fvale\u002Fconfig\u002Fen\u003C\u002Fcode> as its config, and the extension checks against your rules wherever they write.\u003C\u002Fp>",{"type":23,"html":52},"\u003Cp>Inside Drupal I'd still use the module, because there's nothing for editors to install and every field has its own settings, text format and language. If they run the extension as well, set it to \u003Cem>On demand\u003C\u002Fem> on your Drupal site so they don't see every finding twice.\u003C\u002Fp>","Your rules, everywhere else",{"type":18,"layout":19,"regions":55,"title":59},{"content":56},[57],{"type":23,"html":58},"\u003Cp>A French translation is now held to French, in the editor and on save, with Vale splitting its sentences and tagging its words the way French does. German and Spanish get the same, and other languages split sentences on punctuation. \u003Ccode>drush vale:sync\u003C\u002Fcode> downloads a model for each of your site's languages along with your styles, and if a language is missing a model or a spelling dictionary, the Status report lists it.\u003C\u002Fp>","Each translation in its own language",{"type":18,"layout":19,"regions":61,"title":71},{"content":62},[63,65,67],{"type":23,"html":64},"\u003Cp>Canvas pages are checked now as well, on Canvas 1.13 and Drupal 11.3 or later. When a component prop has an error, the publish is refused and the message gives the component and prop, such as \u003Ccode>Components &gt; Text block &gt; heading\u003C\u002Fcode>, with a link to it from Canvas's review panel. The content report and \u003Ccode>vale:lint\u003C\u002Fcode> use the same path.\u003C\u002Fp>",{"type":23,"html":66},"\u003Cp>I turned it on with one switch on the \u003Cem>Canvas\u003C\u002Fem> tab of \u003Cem>Configuration &gt; Content authoring &gt; Vale\u003C\u002Fem>, which needs Canvas's \u003Cem>Administer components\u003C\u002Fem> permission. It checks the props Canvas treats as prose, and there's a list of prop names to skip if one of yours shouldn't be checked.\u003C\u002Fp>",{"type":30,"alt":68,"caption":69,"src":70,"width":34,"height":35},"Drupal Canvas's Unpublished changes panel after a refused publish. It shows one error: Components > Text block > heading, from ai-tells.AICompoundPhrases, on “game-changer”, with a link to the component.","\u003Cp>The refused publish gives the component and prop, with a link to them.\u003C\u002Fp>","\u002Fimages\u002Fwriting\u002Fvale-110-drupal-prose-checks-while-you-type-20261201\u002Fvale-canvas-publish-refused.png","Canvas pages",{"type":18,"layout":19,"regions":73,"title":89},{"content":74},[75,77,83,85,87],{"type":23,"html":76},"\u003Cp>Before you update, check which roles have \u003Cem>Use the Vale check endpoint\u003C\u002Fem>, because that permission now also serves the browser your config and styles, and every role with it will see findings on its next edit.\u003C\u002Fp>",{"type":78,"title":79,"language":80,"code":81,"highlighted":82},"code","Update the module, then install Vale and its browser build","bash","composer update drupal\u002Fvale\ndrush updb\ndrush vale:install --vale-version=3.27.0\ndrush vale:sync","\u003Cspan class=\"token function\">composer\u003C\u002Fspan> update drupal\u002Fvale\ndrush updb\ndrush vale:install --vale-version\u003Cspan class=\"token operator\">=\u003C\u002Fspan>\u003Cspan class=\"token number\">3.27\u003C\u002Fspan>.0\ndrush vale:sync",{"type":23,"html":84},"\u003Cp>Pin the version for now, because the latest Vale, 3.29.0, \u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fvale-cli\u002Fvale\u002Fissues\u002F1241\">can't download language models yet\u003C\u002Fa>. \u003Ccode>vale:install\u003C\u002Fcode> now puts the browser build in \u003Ccode>libraries\u002Fvale\u003C\u002Fcode>, and you'll need to deploy that directory with the site.\u003C\u002Fp>",{"type":23,"html":86},"\u003Cp>Then add the \u003Cem>Vale findings\u003C\u002Fem> button to a text format's CKEditor toolbar. Text areas and plain text fields list their findings under the field, and findings while editing are on by default, with a setting on each widget in the form display to turn them off.\u003C\u002Fp>",{"type":23,"html":88},"\u003Cp>Site settings such as publish-only mode now have a form at \u003Cem>Configuration &gt; Content authoring &gt; Vale\u003C\u002Fem>, behind a new \u003Cem>Administer Vale\u003C\u002Fem> permission, although a value in \u003Ccode>settings.php\u003C\u002Fcode> still takes precedence. If you have a script that calls \u003Ccode>vale:lint --format\u003C\u002Fcode>, it now takes only \u003Ccode>table\u003C\u002Fcode>, \u003Ccode>json\u003C\u002Fcode> or \u003Ccode>csv\u003C\u002Fcode>, and if you've built your own class on \u003Ccode>ValeRunnerInterface\u003C\u002Fcode>, it needs the new language argument on \u003Ccode>lint()\u003C\u002Fcode>.\u003C\u002Fp>","Updating from 1.0.0",{"type":18,"layout":19,"regions":91,"title":95},{"content":92},[93],{"type":23,"html":94},"\u003Cp>The \u003Ca href=\"https:\u002F\u002Fgithub.com\u002FDecipher\u002Fvale\u002Fblob\u002F1.1.x\u002Fdocs\u002Fhosting.md\">hosting docs\u003C\u002Fa> have notes for Lagoon, Acquia Cloud Platform, Pantheon, Platform.sh and Upsun, including the browser build and language models, with a script that installs a pinned Vale and your styles in a build with no database. Vale now runs on Alpine images, and the commands work under core's new \u003Ccode>dr\u003C\u002Fcode> as well as Drush.\u003C\u002Fp>","On managed hosting",{"type":18,"layout":19,"regions":97,"title":101},{"content":98},[99],{"type":23,"html":100},"\u003Cp>Typing doesn't wait on it, because the check runs in a Web Worker off the main thread. The browser build is about 10 MB compressed, and each editor downloads it once before their browser caches it. The \u003Ca href=\"https:\u002F\u002Fgithub.com\u002FDecipher\u002Fvale\u002Fblob\u002F1.1.x\u002Fdocs\u002Fbrowser.md\">browser docs\u003C\u002Fa> cover how to serve it.\u003C\u002Fp>","Will it slow the editor down?",{"type":18,"layout":19,"regions":103},{"content":104},[105,107],{"type":23,"html":106},"\u003Cp>Next, I'm bringing Vale to AI agents in Drupal, so they check their own writing against your style guide before they save it. Vale already runs as a Drupal Tool API tool, and through Drupal AI and MCP, agents will follow the same rules as the editors writing alongside them.\u003C\u002Fp>\u003Cp>If your editors write somewhere other than CKEditor, tell me where in the issue queue.\u003C\u002Fp>",{"type":108,"description":109,"url":110,"gitpod":12,"drupalUrl":111},"repository","\u003Cp>My sponsors funded the work to bring Vale's browser build into Drupal. Read the code on GitHub, or report an issue on Drupal.org.\u003C\u002Fp>","https:\u002F\u002Fgithub.com\u002FDecipher\u002Fvale","https:\u002F\u002Fwww.drupal.org\u002Fproject\u002Fvale","\u002Fwriting\u002Fvale-110-drupal-prose-checks-while-you-type-20261201","4 min",[115,118,121],{"path":116,"source":117},"\u002Fwriting\u002Fvale-100-prose-linting-drupal-20261028","picked",{"path":119,"source":120},"\u002Fwriting\u002Fdruxt-0252-drupal-canvas-sites-no-drupal-required-20261124","view",{"path":122,"source":120},"\u002Fwriting\u002Fconsumer-node-preview-100-rc1-preview-fully-decoupled-drupal-sites-20261112",{"loc":112},"articles-data\u002Fvale-110-drupal-prose-checks-while-you-type-20261201",[126,127],"Editing","Drupal Canvas","t10DEm_mMD6-j-_Sth0rdi0oRPz4pDIrT-Brb76yc_A",[130,281,401],{"id":131,"title":132,"articleType":6,"categories":133,"date":135,"description":136,"extension":11,"feedImage":137,"hiddenCategories":138,"meta":139,"paragraphs":140,"path":122,"readingTime":113,"related":269,"sitemap":275,"stem":276,"topics":277,"__hash__":280},"articleEntries\u002Farticles-data\u002Fconsumer-node-preview-100-rc1-preview-fully-decoupled-drupal-sites-20261112.json","Consumer Node Preview 1.0.0-rc1; preview for Fully Decoupled Drupal sites",[8,134],"Druxt","2026-11-12T20:00:00+11:00","Consumer Node Preview shows unsaved Drupal edits in your Fully Decoupled frontend, the way readers will see them. Druxt Node Preview 0.1.0 is the Nuxt side.",true,[14],{},[141,156,177,183,194,208,218,233,243,252,262],{"type":18,"layout":19,"regions":142},{"content":143},[144,146,152,154],{"type":23,"html":145},"\u003Cp>Press Preview on a Fully Decoupled Drupal site, and Consumer Node Preview \u003Ccode>1.0.0-rc1\u003C\u002Fcode> shows the unsaved page in the frontend your readers will see: the title you just changed and the text you just rewrote, rendered by the site that will publish them.\u003C\u002Fp>",{"type":30,"alt":147,"caption":148,"width":149,"height":150,"src":151},"Drupal's preview screen with Frontend, Drupal and JSON:API tabs. The Frontend tab frames the druxtjs.org page Getting started with Druxt inside the site's own header and breadcrumb. A Show changes against the live page toggle is on and reports 2 changes: the title gains the words from zero, and in the first paragraph piece of content is struck through and replaced with page.","\u003Cp>Two unsaved edits, to the title and the first paragraph, rendered by the Druxt site readers see.\u003C\u002Fp>",968,760,"\u002Fimages\u002Fwriting\u002Fconsumer-node-preview-100-rc1-preview-fully-decoupled-drupal-sites-20261112\u002Fpreview-diff.png",{"type":23,"html":153},"\u003Cp>Drupal's own Preview renders the node in Drupal's theme, not your frontend, so editors save a draft to check it. Next.js draft mode smooths that workaround, but still needs a saved revision. Consumer Node Preview works on what's still in the edit form, for the person writing it, before anything is saved.\u003C\u002Fp>",{"type":23,"html":155},"\u003Cp>Anything that reads JSON:API can be on the other end. Druxt Node Preview \u003Ccode>0.1.0\u003C\u002Fcode> is the Nuxt one, already running druxtjs.org's previews.\u003C\u002Fp>",{"type":18,"layout":19,"regions":157,"title":176},{"content":158},[159,161,165,167,169,174],{"type":23,"html":160},"\u003Cp>Consumer Node Preview builds on JSON:API Node Preview, which serves the unsaved node over JSON:API.\u003C\u002Fp>",{"type":78,"title":162,"language":80,"code":163,"highlighted":164},"Install both","composer require drupal\u002Fjsonapi_node_preview:^1.0@beta drupal\u002Fconsumer_node_preview:^1.0@RC\ndrush en consumer_node_preview","\u003Cspan class=\"token function\">composer\u003C\u002Fspan> require drupal\u002Fjsonapi_node_preview:^1.0@beta drupal\u002Fconsumer_node_preview:^1.0@RC\ndrush en consumer_node_preview",{"type":23,"html":166},"\u003Cp>It stays a release candidate while JSON:API Node Preview is in beta.\u003C\u002Fp>",{"type":23,"html":168},"\u003Cp>Each app that reads your API is a consumer, and each gets its own preview targets, so a Next site and an Astro build can preview the same draft. A target is a label and a URL template. Add it on the consumer's form under \u003Cem>Configuration &gt; Web services &gt; Consumers\u003C\u002Fem>, or in \u003Ccode>settings.php\u003C\u002Fcode> when the URL changes per environment:\u003C\u002Fp>",{"type":78,"title":170,"language":171,"code":172,"highlighted":173},"settings.php","php","$settings['consumer_node_preview'] = [\n  'targets' => [\n    'frontend' => [\n      'label' => 'Frontend',\n      'url' => 'https:\u002F\u002Fwww.example.com\u002Fdruxt\u002Fnode\u002Fpreview?vm=[view_mode]&layout=[layout]#[jsonapi_node_preview]',\n      'layouts' => ['default', 'preview'],\n    ],\n  ],\n];","\u003Cspan class=\"token variable\">$settings\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">[\u003C\u002Fspan>\u003Cspan class=\"token string single-quoted-string\">'consumer_node_preview'\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">]\u003C\u002Fspan> \u003Cspan class=\"token operator\">=\u003C\u002Fspan> \u003Cspan class=\"token punctuation\">[\u003C\u002Fspan>\n  \u003Cspan class=\"token string single-quoted-string\">'targets'\u003C\u002Fspan> \u003Cspan class=\"token operator\">=>\u003C\u002Fspan> \u003Cspan class=\"token punctuation\">[\u003C\u002Fspan>\n    \u003Cspan class=\"token string single-quoted-string\">'frontend'\u003C\u002Fspan> \u003Cspan class=\"token operator\">=>\u003C\u002Fspan> \u003Cspan class=\"token punctuation\">[\u003C\u002Fspan>\n      \u003Cspan class=\"token string single-quoted-string\">'label'\u003C\u002Fspan> \u003Cspan class=\"token operator\">=>\u003C\u002Fspan> \u003Cspan class=\"token string single-quoted-string\">'Frontend'\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">,\u003C\u002Fspan>\n      \u003Cspan class=\"token string single-quoted-string\">'url'\u003C\u002Fspan> \u003Cspan class=\"token operator\">=>\u003C\u002Fspan> \u003Cspan class=\"token string single-quoted-string\">'https:\u002F\u002Fwww.example.com\u002Fdruxt\u002Fnode\u002Fpreview?vm=[view_mode]&amp;layout=[layout]#[jsonapi_node_preview]'\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">,\u003C\u002Fspan>\n      \u003Cspan class=\"token string single-quoted-string\">'layouts'\u003C\u002Fspan> \u003Cspan class=\"token operator\">=>\u003C\u002Fspan> \u003Cspan class=\"token punctuation\">[\u003C\u002Fspan>\u003Cspan class=\"token string single-quoted-string\">'default'\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">,\u003C\u002Fspan> \u003Cspan class=\"token string single-quoted-string\">'preview'\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">]\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">,\u003C\u002Fspan>\n    \u003Cspan class=\"token punctuation\">]\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">,\u003C\u002Fspan>\n  \u003Cspan class=\"token punctuation\">]\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">,\u003C\u002Fspan>\n\u003Cspan class=\"token punctuation\">]\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">;\u003C\u002Fspan>",{"type":23,"html":175},"\u003Cp>Press Preview, and the module fills in the template's tokens and frames the page on the \u003Cem>Frontend\u003C\u002Fem> tab, so the page has to allow that: no \u003Ccode>X-Frame-Options\u003C\u002Fcode>, and Drupal's origin in any \u003Ccode>frame-ancestors\u003C\u002Fcode> rule. Beside it, \u003Cem>Drupal\u003C\u002Fem> is core's own preview, for anything Drupal renders itself, and \u003Cem>JSON:API\u003C\u002Fem> is the raw document: the tab I open first when a field doesn't turn up.\u003C\u002Fp>","Pointing Drupal at your frontend",{"type":18,"layout":19,"regions":178,"title":182},{"content":179},[180],{"type":23,"html":181},"\u003Cp>A preview URL includes the address of an unsaved draft. In a path or query string, it would end up in the frontend's access logs, any CDN in front of it, and the \u003Ccode>Referer\u003C\u002Fcode> of everything the page loads. So \u003Ccode>[jsonapi_node_preview]\u003C\u002Fcode> goes after the \u003Ccode>#\u003C\u002Fcode>: browsers never send the fragment to a server. Scripts on the page can still read it, so keep analytics, error tracking and session replay off the preview route.\u003C\u002Fp>","Keeping the draft out of the logs",{"type":18,"layout":19,"regions":184,"title":193},{"content":185},[186,188],{"type":23,"html":187},"\u003Cp>If Drupal and your frontend share a domain, like \u003Ccode>cms.example.com\u003C\u002Fcode> and \u003Ccode>www.example.com\u003C\u002Fcode>, the preview page can read with the editor's session cookie, once Drupal's CORS config names the frontend and allows credentials:\u003C\u002Fp>",{"type":78,"title":189,"language":190,"code":191,"highlighted":192},"services.yml, same site","yaml","parameters:\n  cors.config:\n    enabled: true\n    allowedHeaders: ['*']\n    allowedMethods: ['GET']\n    allowedOrigins: ['https:\u002F\u002Fwww.example.com']\n    supportsCredentials: true","\u003Cspan class=\"token key atrule\">parameters\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">:\u003C\u002Fspan>\n  \u003Cspan class=\"token key atrule\">cors.config\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">:\u003C\u002Fspan>\n    \u003Cspan class=\"token key atrule\">enabled\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">:\u003C\u002Fspan> \u003Cspan class=\"token boolean important\">true\u003C\u002Fspan>\n    \u003Cspan class=\"token key atrule\">allowedHeaders\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">:\u003C\u002Fspan> \u003Cspan class=\"token punctuation\">[\u003C\u002Fspan>\u003Cspan class=\"token string\">'*'\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">]\u003C\u002Fspan>\n    \u003Cspan class=\"token key atrule\">allowedMethods\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">:\u003C\u002Fspan> \u003Cspan class=\"token punctuation\">[\u003C\u002Fspan>\u003Cspan class=\"token string\">'GET'\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">]\u003C\u002Fspan>\n    \u003Cspan class=\"token key atrule\">allowedOrigins\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">:\u003C\u002Fspan> \u003Cspan class=\"token punctuation\">[\u003C\u002Fspan>\u003Cspan class=\"token string\">'https:\u002F\u002Fwww.example.com'\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">]\u003C\u002Fspan>\n    \u003Cspan class=\"token key atrule\">supportsCredentials\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">:\u003C\u002Fspan> \u003Cspan class=\"token boolean important\">true\u003C\u002Fspan>","Sharing a domain: the editor's session",{"type":18,"layout":19,"regions":195,"title":207},{"content":196},[197,199,205],{"type":23,"html":198},"\u003Cp>Browsers won't send that cookie to a frontend on another domain, such as \u003Ccode>example.vercel.app\u003C\u002Fcode>, so the preview reads with a token instead. Install Simple OAuth, then on the consumer's form turn on the Authorization Code grant, and give its \u003Cem>Authorization Code settings\u003C\u002Fem> a scope for a role made for previews, rather than your editors' own. A scope under \u003Cem>Default scopes\u003C\u002Fem> alone gets the preview a 403.\u003C\u002Fp>",{"type":30,"alt":200,"caption":201,"width":202,"height":203,"src":204},"The consumer form's Grant types, with Authorization Code and Client Credentials ticked, and the Authorization Code settings, with the editor scope ticked.","\u003Cp>The consumer's Authorization Code grant, with a scope for the editor role. The preview token needs both.\u003C\u002Fp>",918,474,"\u002Fimages\u002Fwriting\u002Fconsumer-node-preview-100-rc1-preview-fully-decoupled-drupal-sites-20261112\u002Fconsumer-token-grant.png",{"type":23,"html":206},"\u003Cp>End the target with \u003Ccode>;token=[preview_token]\u003C\u002Fcode>, and in \u003Ccode>settings.php\u003C\u002Fcode> name its consumer with \u003Ccode>'consumer' =&gt; 'my-frontend'\u003C\u002Fcode>. Each Preview then adds a token to the fragment. It acts as the editor, limited to that role, for 15 minutes by default. It travels without a cookie, so CORS can allow any origin: without credentials, another site reads only what an anonymous visitor could. In \u003Ccode>services.yml\u003C\u002Fcode>, set \u003Ccode>allowedOrigins\u003C\u002Fcode> to \u003Ccode>['*']\u003C\u002Fcode> and \u003Ccode>supportsCredentials\u003C\u002Fcode> to \u003Ccode>false\u003C\u002Fcode>.\u003C\u002Fp>","On another domain: a preview token",{"type":18,"layout":209,"regions":210,"title":217},"layout_twocol",{"first":211,"second":214},[212],{"type":23,"html":213},"\u003Cp>\u003Cstrong>View modes, for Nuxt developers.\u003C\u002Fstrong> Drupal's displays of the same content, such as Full or Teaser, each with its own fields. The editor's pick arrives as \u003Ccode>vm\u003C\u002Fcode>, and Druxt renders the node in that mode.\u003C\u002Fp>",[215],{"type":23,"html":216},"\u003Cp>\u003Cstrong>Layouts, for Drupal developers.\u003C\u002Fstrong> Nuxt's page wrappers, the components in \u003Ccode>layouts\u002F\u003C\u002Fcode> that put the site around a page. The editor's pick arrives as \u003Ccode>layout\u003C\u002Fcode>, so one node can be checked inside the full site or on a bare page.\u003C\u002Fp>","View modes and layouts",{"type":18,"layout":19,"regions":219,"title":232},{"content":220},[221,223,228,230],{"type":23,"html":222},"\u003Cp>On a Druxt site, the preview page is a Nuxt module that can register its own target:\u003C\u002Fp>",{"type":78,"title":224,"language":225,"code":226,"highlighted":227},"nuxt.config.js","javascript","\u002F\u002F npm install druxt-site @druxt-contrib\u002Fnode-preview\nexport default {\n  modules: ['@druxt-contrib\u002Fnode-preview', 'druxt-site'],\n  druxt: {\n    baseUrl: 'https:\u002F\u002Fcms.example.com',\n    proxy: { api: true },\n    nodePreview: {\n      layouts: ['default', 'preview'],\n      register: {\n        url: 'https:\u002F\u002Fexample.vercel.app',\n        consumer: 'my-frontend', \u002F\u002F The consumer's client ID.\n        token: true,\n      },\n    },\n  },\n}","\u003Cspan class=\"token comment\">\u002F\u002F npm install druxt-site @druxt-contrib\u002Fnode-preview\u003C\u002Fspan>\n\u003Cspan class=\"token keyword\">export\u003C\u002Fspan> \u003Cspan class=\"token keyword\">default\u003C\u002Fspan> \u003Cspan class=\"token punctuation\">{\u003C\u002Fspan>\n  \u003Cspan class=\"token literal-property property\">modules\u003C\u002Fspan>\u003Cspan class=\"token operator\">:\u003C\u002Fspan> \u003Cspan class=\"token punctuation\">[\u003C\u002Fspan>\u003Cspan class=\"token string\">'@druxt-contrib\u002Fnode-preview'\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">,\u003C\u002Fspan> \u003Cspan class=\"token string\">'druxt-site'\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">]\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">,\u003C\u002Fspan>\n  \u003Cspan class=\"token literal-property property\">druxt\u003C\u002Fspan>\u003Cspan class=\"token operator\">:\u003C\u002Fspan> \u003Cspan class=\"token punctuation\">{\u003C\u002Fspan>\n    \u003Cspan class=\"token literal-property property\">baseUrl\u003C\u002Fspan>\u003Cspan class=\"token operator\">:\u003C\u002Fspan> \u003Cspan class=\"token string\">'https:\u002F\u002Fcms.example.com'\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">,\u003C\u002Fspan>\n    \u003Cspan class=\"token literal-property property\">proxy\u003C\u002Fspan>\u003Cspan class=\"token operator\">:\u003C\u002Fspan> \u003Cspan class=\"token punctuation\">{\u003C\u002Fspan> \u003Cspan class=\"token literal-property property\">api\u003C\u002Fspan>\u003Cspan class=\"token operator\">:\u003C\u002Fspan> \u003Cspan class=\"token boolean\">true\u003C\u002Fspan> \u003Cspan class=\"token punctuation\">}\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">,\u003C\u002Fspan>\n    \u003Cspan class=\"token literal-property property\">nodePreview\u003C\u002Fspan>\u003Cspan class=\"token operator\">:\u003C\u002Fspan> \u003Cspan class=\"token punctuation\">{\u003C\u002Fspan>\n      \u003Cspan class=\"token literal-property property\">layouts\u003C\u002Fspan>\u003Cspan class=\"token operator\">:\u003C\u002Fspan> \u003Cspan class=\"token punctuation\">[\u003C\u002Fspan>\u003Cspan class=\"token string\">'default'\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">,\u003C\u002Fspan> \u003Cspan class=\"token string\">'preview'\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">]\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">,\u003C\u002Fspan>\n      \u003Cspan class=\"token literal-property property\">register\u003C\u002Fspan>\u003Cspan class=\"token operator\">:\u003C\u002Fspan> \u003Cspan class=\"token punctuation\">{\u003C\u002Fspan>\n        \u003Cspan class=\"token literal-property property\">url\u003C\u002Fspan>\u003Cspan class=\"token operator\">:\u003C\u002Fspan> \u003Cspan class=\"token string\">'https:\u002F\u002Fexample.vercel.app'\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">,\u003C\u002Fspan>\n        \u003Cspan class=\"token literal-property property\">consumer\u003C\u002Fspan>\u003Cspan class=\"token operator\">:\u003C\u002Fspan> \u003Cspan class=\"token string\">'my-frontend'\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">,\u003C\u002Fspan> \u003Cspan class=\"token comment\">\u002F\u002F The consumer's client ID.\u003C\u002Fspan>\n        \u003Cspan class=\"token literal-property property\">token\u003C\u002Fspan>\u003Cspan class=\"token operator\">:\u003C\u002Fspan> \u003Cspan class=\"token boolean\">true\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">,\u003C\u002Fspan>\n      \u003Cspan class=\"token punctuation\">}\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">,\u003C\u002Fspan>\n    \u003Cspan class=\"token punctuation\">}\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">,\u003C\u002Fspan>\n  \u003Cspan class=\"token punctuation\">}\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">,\u003C\u002Fspan>\n\u003Cspan class=\"token punctuation\">}\u003C\u002Fspan>",{"type":23,"html":229},"\u003Cp>With the secret of a consumer \u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fdruxt-contrib\u002Fdruxt-node-preview\u002Fblob\u002F0.x\u002Fdocs\u002Fregistration-drupal-setup.md\">set up for Simple OAuth\u003C\u002Fa> in \u003Ccode>DRUXT_NODE_PREVIEW_CLIENT_SECRET\u003C\u002Fcode>, Nuxt adds its target to Drupal when it starts and every six hours, and removes it on a clean shutdown. A target that stops registering goes inactive after a day, so a crashed server cleans up after itself. With \u003Ccode>token\u003C\u002Fcode> on and Druxt's API proxy, the read never leaves the frontend's origin, and Drupal's CORS stays as it is.\u003C\u002Fp>",{"type":23,"html":231},"\u003Cp>The preview goes in the Druxt store before \u003Ccode>DruxtEntity\u003C\u002Fcode> resolves, so it renders through the same components as the live page, and the token comes off the address on load. It only fetches from its own origin, its Drupal site, or origins you list, so a crafted link can't point the preview, or the editor's token, at somebody else's server.\u003C\u002Fp>","Druxt renders it like any other page",{"type":18,"layout":19,"regions":234,"title":242},{"content":235},[236,238],{"type":23,"html":237},"\u003Cp>Nothing in the URL template is Druxt-specific. Druxt Node Preview is for Nuxt 2 and Node 16, and stays \u003Ccode>0.x\u003C\u002Fcode> until Druxt reaches \u003Ccode>1.0.0\u003C\u002Fcode>. In Nuxt 3, Next or Astro, this is the core of a preview page:\u003C\u002Fp>",{"type":78,"title":239,"language":225,"code":240,"highlighted":241},"A preview page for any other frontend","\u002F\u002F Target URL: https:\u002F\u002Fwww.example.com\u002Fpreview#[jsonapi_node_preview];token=[preview_token]\n\u002F\u002F Runs in the browser, in a module script: the fragment never reaches a server.\n\u002F\u002F The origins this page may fetch a preview from.\nconst allowed = ['https:\u002F\u002Fcms.example.com']\n\n\u002F\u002F Some routers turn https:\u002F\u002F into https:\u002F inside a hash.\nconst hash = decodeURIComponent(location.hash.slice(1))\nconst [address, token] = hash\n  .replace(\u002F^(https?):\\\u002F(?!\\\u002F)\u002F, '$1:\u002F\u002F')\n  .split(';token=')\nconst endpoint = new URL(address)\n\u002F\u002F Take the token back out of the address bar.\nhistory.replaceState(null, '', location.pathname + location.search)\n\nif (!allowed.includes(endpoint.origin)) {\n  throw new Error(`Refusing a preview from ${endpoint.origin}`)\n}\n\nconst response = await fetch(endpoint, {\n  \u002F\u002F A token target reads without the cookie.\n  credentials: token ? 'omit' : 'include',\n  headers: {\n    Accept: 'application\u002Fvnd.api+json',\n    ...(token && { Authorization: `Bearer ${token}` }),\n  },\n})\nif (!response.ok) throw new Error(`Preview failed: HTTP ${response.status}`)\nconst { data, included } = await response.json()\n\u002F\u002F Render data and included with the components a live page uses.","\u003Cspan class=\"token comment\">\u002F\u002F Target URL: https:\u002F\u002Fwww.example.com\u002Fpreview#[jsonapi_node_preview];token=[preview_token]\u003C\u002Fspan>\n\u003Cspan class=\"token comment\">\u002F\u002F Runs in the browser, in a module script: the fragment never reaches a server.\u003C\u002Fspan>\n\u003Cspan class=\"token comment\">\u002F\u002F The origins this page may fetch a preview from.\u003C\u002Fspan>\n\u003Cspan class=\"token keyword\">const\u003C\u002Fspan> allowed \u003Cspan class=\"token operator\">=\u003C\u002Fspan> \u003Cspan class=\"token punctuation\">[\u003C\u002Fspan>\u003Cspan class=\"token string\">'https:\u002F\u002Fcms.example.com'\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">]\u003C\u002Fspan>\n\n\u003Cspan class=\"token comment\">\u002F\u002F Some routers turn https:\u002F\u002F into https:\u002F inside a hash.\u003C\u002Fspan>\n\u003Cspan class=\"token keyword\">const\u003C\u002Fspan> hash \u003Cspan class=\"token operator\">=\u003C\u002Fspan> \u003Cspan class=\"token function\">decodeURIComponent\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">(\u003C\u002Fspan>location\u003Cspan class=\"token punctuation\">.\u003C\u002Fspan>hash\u003Cspan class=\"token punctuation\">.\u003C\u002Fspan>\u003Cspan class=\"token function\">slice\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">(\u003C\u002Fspan>\u003Cspan class=\"token number\">1\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">)\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">)\u003C\u002Fspan>\n\u003Cspan class=\"token keyword\">const\u003C\u002Fspan> \u003Cspan class=\"token punctuation\">[\u003C\u002Fspan>address\u003Cspan class=\"token punctuation\">,\u003C\u002Fspan> token\u003Cspan class=\"token punctuation\">]\u003C\u002Fspan> \u003Cspan class=\"token operator\">=\u003C\u002Fspan> hash\n  \u003Cspan class=\"token punctuation\">.\u003C\u002Fspan>\u003Cspan class=\"token function\">replace\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">(\u003C\u002Fspan>\u003Cspan class=\"token regex\">\u003Cspan class=\"token regex-delimiter\">\u002F\u003C\u002Fspan>\u003Cspan class=\"token regex-source language-regex\">^(https?):\\\u002F(?!\\\u002F)\u003C\u002Fspan>\u003Cspan class=\"token regex-delimiter\">\u002F\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">,\u003C\u002Fspan> \u003Cspan class=\"token string\">'$1:\u002F\u002F'\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">)\u003C\u002Fspan>\n  \u003Cspan class=\"token punctuation\">.\u003C\u002Fspan>\u003Cspan class=\"token function\">split\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">(\u003C\u002Fspan>\u003Cspan class=\"token string\">';token='\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">)\u003C\u002Fspan>\n\u003Cspan class=\"token keyword\">const\u003C\u002Fspan> endpoint \u003Cspan class=\"token operator\">=\u003C\u002Fspan> \u003Cspan class=\"token keyword\">new\u003C\u002Fspan> \u003Cspan class=\"token class-name\">URL\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">(\u003C\u002Fspan>address\u003Cspan class=\"token punctuation\">)\u003C\u002Fspan>\n\u003Cspan class=\"token comment\">\u002F\u002F Take the token back out of the address bar.\u003C\u002Fspan>\nhistory\u003Cspan class=\"token punctuation\">.\u003C\u002Fspan>\u003Cspan class=\"token function\">replaceState\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">(\u003C\u002Fspan>\u003Cspan class=\"token keyword\">null\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">,\u003C\u002Fspan> \u003Cspan class=\"token string\">''\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">,\u003C\u002Fspan> location\u003Cspan class=\"token punctuation\">.\u003C\u002Fspan>pathname \u003Cspan class=\"token operator\">+\u003C\u002Fspan> location\u003Cspan class=\"token punctuation\">.\u003C\u002Fspan>search\u003Cspan class=\"token punctuation\">)\u003C\u002Fspan>\n\n\u003Cspan class=\"token keyword\">if\u003C\u002Fspan> \u003Cspan class=\"token punctuation\">(\u003C\u002Fspan>\u003Cspan class=\"token operator\">!\u003C\u002Fspan>allowed\u003Cspan class=\"token punctuation\">.\u003C\u002Fspan>\u003Cspan class=\"token function\">includes\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">(\u003C\u002Fspan>endpoint\u003Cspan class=\"token punctuation\">.\u003C\u002Fspan>origin\u003Cspan class=\"token punctuation\">)\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">)\u003C\u002Fspan> \u003Cspan class=\"token punctuation\">{\u003C\u002Fspan>\n  \u003Cspan class=\"token keyword\">throw\u003C\u002Fspan> \u003Cspan class=\"token keyword\">new\u003C\u002Fspan> \u003Cspan class=\"token class-name\">Error\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">(\u003C\u002Fspan>\u003Cspan class=\"token template-string\">\u003Cspan class=\"token template-punctuation string\">`\u003C\u002Fspan>\u003Cspan class=\"token string\">Refusing a preview from \u003C\u002Fspan>\u003Cspan class=\"token interpolation\">\u003Cspan class=\"token interpolation-punctuation punctuation\">${\u003C\u002Fspan>endpoint\u003Cspan class=\"token punctuation\">.\u003C\u002Fspan>origin\u003Cspan class=\"token interpolation-punctuation punctuation\">}\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"token template-punctuation string\">`\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">)\u003C\u002Fspan>\n\u003Cspan class=\"token punctuation\">}\u003C\u002Fspan>\n\n\u003Cspan class=\"token keyword\">const\u003C\u002Fspan> response \u003Cspan class=\"token operator\">=\u003C\u002Fspan> \u003Cspan class=\"token keyword\">await\u003C\u002Fspan> \u003Cspan class=\"token function\">fetch\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">(\u003C\u002Fspan>endpoint\u003Cspan class=\"token punctuation\">,\u003C\u002Fspan> \u003Cspan class=\"token punctuation\">{\u003C\u002Fspan>\n  \u003Cspan class=\"token comment\">\u002F\u002F A token target reads without the cookie.\u003C\u002Fspan>\n  \u003Cspan class=\"token literal-property property\">credentials\u003C\u002Fspan>\u003Cspan class=\"token operator\">:\u003C\u002Fspan> token \u003Cspan class=\"token operator\">?\u003C\u002Fspan> \u003Cspan class=\"token string\">'omit'\u003C\u002Fspan> \u003Cspan class=\"token operator\">:\u003C\u002Fspan> \u003Cspan class=\"token string\">'include'\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">,\u003C\u002Fspan>\n  \u003Cspan class=\"token literal-property property\">headers\u003C\u002Fspan>\u003Cspan class=\"token operator\">:\u003C\u002Fspan> \u003Cspan class=\"token punctuation\">{\u003C\u002Fspan>\n    \u003Cspan class=\"token literal-property property\">Accept\u003C\u002Fspan>\u003Cspan class=\"token operator\">:\u003C\u002Fspan> \u003Cspan class=\"token string\">'application\u002Fvnd.api+json'\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">,\u003C\u002Fspan>\n    \u003Cspan class=\"token operator\">...\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">(\u003C\u002Fspan>token \u003Cspan class=\"token operator\">&amp;&amp;\u003C\u002Fspan> \u003Cspan class=\"token punctuation\">{\u003C\u002Fspan> \u003Cspan class=\"token literal-property property\">Authorization\u003C\u002Fspan>\u003Cspan class=\"token operator\">:\u003C\u002Fspan> \u003Cspan class=\"token template-string\">\u003Cspan class=\"token template-punctuation string\">`\u003C\u002Fspan>\u003Cspan class=\"token string\">Bearer \u003C\u002Fspan>\u003Cspan class=\"token interpolation\">\u003Cspan class=\"token interpolation-punctuation punctuation\">${\u003C\u002Fspan>token\u003Cspan class=\"token interpolation-punctuation punctuation\">}\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"token template-punctuation string\">`\u003C\u002Fspan>\u003C\u002Fspan> \u003Cspan class=\"token punctuation\">}\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">)\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">,\u003C\u002Fspan>\n  \u003Cspan class=\"token punctuation\">}\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">,\u003C\u002Fspan>\n\u003Cspan class=\"token punctuation\">}\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">)\u003C\u002Fspan>\n\u003Cspan class=\"token keyword\">if\u003C\u002Fspan> \u003Cspan class=\"token punctuation\">(\u003C\u002Fspan>\u003Cspan class=\"token operator\">!\u003C\u002Fspan>response\u003Cspan class=\"token punctuation\">.\u003C\u002Fspan>ok\u003Cspan class=\"token punctuation\">)\u003C\u002Fspan> \u003Cspan class=\"token keyword\">throw\u003C\u002Fspan> \u003Cspan class=\"token keyword\">new\u003C\u002Fspan> \u003Cspan class=\"token class-name\">Error\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">(\u003C\u002Fspan>\u003Cspan class=\"token template-string\">\u003Cspan class=\"token template-punctuation string\">`\u003C\u002Fspan>\u003Cspan class=\"token string\">Preview failed: HTTP \u003C\u002Fspan>\u003Cspan class=\"token interpolation\">\u003Cspan class=\"token interpolation-punctuation punctuation\">${\u003C\u002Fspan>response\u003Cspan class=\"token punctuation\">.\u003C\u002Fspan>status\u003Cspan class=\"token interpolation-punctuation punctuation\">}\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"token template-punctuation string\">`\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">)\u003C\u002Fspan>\n\u003Cspan class=\"token keyword\">const\u003C\u002Fspan> \u003Cspan class=\"token punctuation\">{\u003C\u002Fspan> data\u003Cspan class=\"token punctuation\">,\u003C\u002Fspan> included \u003Cspan class=\"token punctuation\">}\u003C\u002Fspan> \u003Cspan class=\"token operator\">=\u003C\u002Fspan> \u003Cspan class=\"token keyword\">await\u003C\u002Fspan> response\u003Cspan class=\"token punctuation\">.\u003C\u002Fspan>\u003Cspan class=\"token function\">json\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">(\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">)\u003C\u002Fspan>\n\u003Cspan class=\"token comment\">\u002F\u002F Render data and included with the components a live page uses.\u003C\u002Fspan>","A preview page for Next, Astro or Nuxt 3",{"type":18,"layout":19,"regions":244},{"content":245},[246],{"type":247,"title":248,"content":249},"jumbotron","Help paragraph preview land",[250],{"type":23,"html":251},"\u003Cp>Unsaved paragraphs come through with the patch on \u003Ca href=\"https:\u002F\u002Fwww.drupal.org\u002Fi\u002F3367724\">#3367724\u003C\u002Fa>, which druxtjs.org runs as a Composer patch. If you preview paragraphs, test it on your site and leave a review. It needs a tested review to land.\u003C\u002Fp>",{"type":18,"layout":19,"regions":253},{"content":254},[255,259],{"type":108,"description":256,"url":257,"gitpod":12,"drupalUrl":258},"\u003Cp>Consumer Node Preview's code is on GitHub, and its releases and issue queue are on Drupal.org. If your editors work on a Fully Decoupled site, sponsorship is what moves the diff work up the list.\u003C\u002Fp>","https:\u002F\u002Fgithub.com\u002FDecipher\u002Fconsumer_node_preview","https:\u002F\u002Fwww.drupal.org\u002Fproject\u002Fconsumer_node_preview",{"type":108,"description":260,"url":261,"gitpod":12},"\u003Cp>Druxt Node Preview is on GitHub. Its end-to-end suite builds a Drupal site with both modules and previews through a real Druxt frontend.\u003C\u002Fp>","https:\u002F\u002Fgithub.com\u002Fdruxt-contrib\u002Fdruxt-node-preview",{"type":18,"layout":19,"regions":263},{"content":264},[265,267],{"type":23,"html":266},"\u003Cp>Diffs are next: the changes toggle in the screenshot is druxtjs.org's early look at them.\u003C\u002Fp>",{"type":23,"html":268},"\u003Cp>If your frontend sits on a different domain to Drupal, is a 15-minute token long enough for the way your editors preview?\u003C\u002Fp>",[270,272,273],{"path":271,"source":117},"\u002Fwriting\u002Fdrupal-site-settings-over-jsonapi-consumer-20260826",{"path":116,"source":120},{"path":274,"source":120},"\u002Fwriting\u002Fdruxt-0250-caching-and-performance-buffs-20261023",{"loc":122},"articles-data\u002Fconsumer-node-preview-100-rc1-preview-fully-decoupled-drupal-sites-20261112",[126,278,279],"JSON:API","Paragraphs","36yE5bObHL76fn6MtHgPtI2A2jXJBgR8FVMGWOdFc7s",{"id":282,"title":283,"articleType":6,"categories":284,"date":286,"description":287,"extension":11,"feedImage":137,"hiddenCategories":288,"meta":289,"paragraphs":290,"path":119,"readingTime":113,"related":392,"sitemap":397,"stem":398,"topics":399,"__hash__":400},"articleEntries\u002Farticles-data\u002Fdruxt-0252-drupal-canvas-sites-no-drupal-required-20261124.json","Druxt 0.25.2; Drupal Canvas sites, no Drupal required",[8,134,285],"Nuxt","2026-11-24T17:00:00+11:00","Druxt 0.25.2 renders Drupal Canvas pages in Fully Decoupled Nuxt sites, keeps signed-in requests out of the server cache, and makes v-model follow forms and filters. Run the demo in your browser, with no Drupal to install.",[14],{},[291,303,321,329,343,356,368,382],{"type":18,"layout":19,"regions":292},{"content":293},[294,296,298],{"type":23,"html":295},"\u003Cp>Druxt 0.25.2 renders Drupal Canvas pages in Nuxt, and you can try it in this post without installing anything. Press Run and a Nuxt 2 site boots in your browser. It reads a recording of a Drupal CMS site's API, so no Drupal is running behind it.\u003C\u002Fp>",{"type":23,"html":297},"\u003Cp>Druxt is the Fully Decoupled Drupal framework for Nuxt 2. Canvas is the page builder in Drupal CMS, and sites that have it installed now build. This release also keeps signed-in requests out of the server cache from the first request, makes \u003Ccode>v-model\u003C\u002Fcode> follow forms and filters, and reports why a resource failed to load. Upgrading takes one command and two checks.\u003C\u002Fp>",{"type":299,"title":300,"url":301,"caption":302},"stackblitz","Drupal CMS's Dashi site, rendered by Druxt 0.25.2 and Nuxt 2","https:\u002F\u002Fstackblitz.com\u002Fgithub\u002FDecipher\u002Fdemo-druxt-canvas?file=nuxt.config.js","\u003Cp>A Nuxt 2 site on \u003Ccode>druxt-site\u003C\u002Fcode> 0.15.2 and \u003Ccode>@druxt-contrib\u002Fcanvas\u003C\u002Fcode>, reading the Dashi preset of Decoupled Drupal Mock. \u003Ca href=\"https:\u002F\u002Fgithub.com\u002FDecipher\u002Fdemo-druxt-canvas\">The source is on GitHub\u003C\u002Fa>.\u003C\u002Fp>",{"type":18,"layout":19,"regions":304,"title":320},{"content":305},[306,308,311,316,318],{"type":23,"html":307},"\u003Cp>I wanted a demo you could run without setting up Drupal. It runs two things side by side. The first is \u003Ca href=\"https:\u002F\u002Fgithub.com\u002FDecipher\u002Fdecoupled-drupal-mock\">Decoupled Drupal Mock\u003C\u002Fa> with its \u003Ca href=\"https:\u002F\u002Fgithub.com\u002FDecipher\u002Fdecoupled-drupal-mock\u002Ftree\u002F1.0.x\u002Fpresets\u002Fdashi\">Dashi preset\u003C\u002Fa>, which replays the JSON:API, Decoupled Router and menu responses recorded from a Drupal CMS 2.2.9 site running Canvas 1.12.0. The second is Nuxt, with this configuration:\u003C\u002Fp>",{"type":78,"title":224,"language":225,"code":309,"highlighted":310},"export default {\n  modules: ['druxt-site', '@druxt-contrib\u002Fcanvas'],\n  druxt: {\n    baseUrl: 'http:\u002F\u002Flocalhost:3005',\n    proxy: { api: true },\n  },\n}","\u003Cspan class=\"token keyword\">export\u003C\u002Fspan> \u003Cspan class=\"token keyword\">default\u003C\u002Fspan> \u003Cspan class=\"token punctuation\">{\u003C\u002Fspan>\n  \u003Cspan class=\"token literal-property property\">modules\u003C\u002Fspan>\u003Cspan class=\"token operator\">:\u003C\u002Fspan> \u003Cspan class=\"token punctuation\">[\u003C\u002Fspan>\u003Cspan class=\"token string\">'druxt-site'\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">,\u003C\u002Fspan> \u003Cspan class=\"token string\">'@druxt-contrib\u002Fcanvas'\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">]\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">,\u003C\u002Fspan>\n  \u003Cspan class=\"token literal-property property\">druxt\u003C\u002Fspan>\u003Cspan class=\"token operator\">:\u003C\u002Fspan> \u003Cspan class=\"token punctuation\">{\u003C\u002Fspan>\n    \u003Cspan class=\"token literal-property property\">baseUrl\u003C\u002Fspan>\u003Cspan class=\"token operator\">:\u003C\u002Fspan> \u003Cspan class=\"token string\">'http:\u002F\u002Flocalhost:3005'\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">,\u003C\u002Fspan>\n    \u003Cspan class=\"token literal-property property\">proxy\u003C\u002Fspan>\u003Cspan class=\"token operator\">:\u003C\u002Fspan> \u003Cspan class=\"token punctuation\">{\u003C\u002Fspan> \u003Cspan class=\"token literal-property property\">api\u003C\u002Fspan>\u003Cspan class=\"token operator\">:\u003C\u002Fspan> \u003Cspan class=\"token boolean\">true\u003C\u002Fspan> \u003Cspan class=\"token punctuation\">}\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">,\u003C\u002Fspan>\n  \u003Cspan class=\"token punctuation\">}\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">,\u003C\u002Fspan>\n\u003Cspan class=\"token punctuation\">}\u003C\u002Fspan>",{"type":30,"src":312,"alt":313,"caption":314,"width":34,"height":315},"\u002Fimages\u002Fwriting\u002Fdruxt-0252-drupal-canvas-sites-no-drupal-required-20261124\u002Fdemo-dashi-front.jpg","The demo's front page in Dashi's theme: the dashi Food Magazine logo, a search box, and Home, Articles and Recipes links. Below them a featured recipe, \"Super easy vegetarian pasta bake\", with its photo and a View recipe button, then cards for an article and two recipes with photos.","Dashi's front page, a Canvas page, rendered by the demo from the recording.",934,{"type":23,"html":317},"\u003Cp>The front page and \u003Ccode>\u002Fcanvas-external\u003C\u002Fcode> are Canvas pages. Druxt resolves them by path, with no Nuxt page files. Follow a link from the front page to a recipe or article, and Vue components read that node's fields to lay it out the way Dashi does.\u003C\u002Fp>",{"type":23,"html":319},"\u003Cp>To serve the same pages from your own Drupal, point \u003Ccode>baseUrl\u003C\u002Fcode> at it. \u003Ccode>@druxt-contrib\u002Fcanvas\u003C\u002Fcode> renders each Canvas component through a Vue wrapper that you write, and the \u003Ca href=\"https:\u002F\u002Fcontrib.druxtjs.org\u002Fdruxt-canvas\u002Ftheming\u002F\">Druxt Canvas docs\u003C\u002Fa> explain how to name them.\u003C\u002Fp>","What's in the demo",{"type":18,"layout":19,"regions":322,"title":328},{"content":323},[324,326],{"type":23,"html":325},"\u003Cp>druxt-schema 0.12.2 builds sites that have Canvas installed (\u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fdruxt\u002Fdruxt.js\u002Fissues\u002F1022\">#1022\u003C\u002Fa>). Druxt reads every entity view and form display at build time, and Canvas 1.12.0 answers 500 when JSON:API asks for the second page of them. Druxt now requests them in smaller batches, filtered by entity type and bundle. Canvas 1.13.0 still has the bug, and it's \u003Ca href=\"https:\u002F\u002Fgit.drupalcode.org\u002Fproject\u002Fcanvas\u002F-\u002Fwork_items\u002F3592360\">reported against Canvas\u003C\u002Fa>.\u003C\u002Fp>",{"type":23,"html":327},"\u003Cp>If you patched Canvas to get your build through, you can keep the patch or remove it. Keep it if one bundle has more than 50 view or form displays, because the build still fails without it. The demo's recording returns every page, so you'll only see this fix on a live site.\u003C\u002Fp>","Building against Canvas",{"type":18,"layout":19,"regions":330,"title":342},{"content":331},[332,334,336,340],{"type":23,"html":333},"\u003Cp>0.25.0 added a server cache for the JSON:API index and menus. It skips any request that carries credentials, but it only saw a token added by an Axios interceptor once the response came back. Until then, a signed-in visitor could get a response cached for anonymous visitors. 0.25.2 runs your request interceptors on a copy of each request before it checks the cache, so the cache turns off from the first request (\u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fdruxt\u002Fdruxt.js\u002Fissues\u002F1018\">#1018\u003C\u002Fa>).\u003C\u002Fp>",{"type":23,"html":335},"\u003Cp>Register a plugin like this one under \u003Ccode>plugins\u003C\u002Fcode> in \u003Ccode>nuxt.config.js\u003C\u002Fcode>, reading the token from wherever your site stores it:\u003C\u002Fp>",{"type":78,"title":337,"language":225,"code":338,"highlighted":339},"plugins\u002Fdruxt-token.js","export default ({ $druxt, store }) => {\n  $druxt.axios.interceptors.request.use((config) => {\n    if (store.state.token) {\n      config.headers.Authorization = `Bearer ${store.state.token}`\n    }\n    return config\n  })\n}","\u003Cspan class=\"token keyword\">export\u003C\u002Fspan> \u003Cspan class=\"token keyword\">default\u003C\u002Fspan> \u003Cspan class=\"token punctuation\">(\u003C\u002Fspan>\u003Cspan class=\"token parameter\">\u003Cspan class=\"token punctuation\">{\u003C\u002Fspan> $druxt\u003Cspan class=\"token punctuation\">,\u003C\u002Fspan> store \u003Cspan class=\"token punctuation\">}\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">)\u003C\u002Fspan> \u003Cspan class=\"token operator\">=>\u003C\u002Fspan> \u003Cspan class=\"token punctuation\">{\u003C\u002Fspan>\n  $druxt\u003Cspan class=\"token punctuation\">.\u003C\u002Fspan>axios\u003Cspan class=\"token punctuation\">.\u003C\u002Fspan>interceptors\u003Cspan class=\"token punctuation\">.\u003C\u002Fspan>request\u003Cspan class=\"token punctuation\">.\u003C\u002Fspan>\u003Cspan class=\"token function\">use\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">(\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">(\u003C\u002Fspan>\u003Cspan class=\"token parameter\">config\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">)\u003C\u002Fspan> \u003Cspan class=\"token operator\">=>\u003C\u002Fspan> \u003Cspan class=\"token punctuation\">{\u003C\u002Fspan>\n    \u003Cspan class=\"token keyword\">if\u003C\u002Fspan> \u003Cspan class=\"token punctuation\">(\u003C\u002Fspan>store\u003Cspan class=\"token punctuation\">.\u003C\u002Fspan>state\u003Cspan class=\"token punctuation\">.\u003C\u002Fspan>token\u003Cspan class=\"token punctuation\">)\u003C\u002Fspan> \u003Cspan class=\"token punctuation\">{\u003C\u002Fspan>\n      config\u003Cspan class=\"token punctuation\">.\u003C\u002Fspan>headers\u003Cspan class=\"token punctuation\">.\u003C\u002Fspan>Authorization \u003Cspan class=\"token operator\">=\u003C\u002Fspan> \u003Cspan class=\"token template-string\">\u003Cspan class=\"token template-punctuation string\">`\u003C\u002Fspan>\u003Cspan class=\"token string\">Bearer \u003C\u002Fspan>\u003Cspan class=\"token interpolation\">\u003Cspan class=\"token interpolation-punctuation punctuation\">${\u003C\u002Fspan>store\u003Cspan class=\"token punctuation\">.\u003C\u002Fspan>state\u003Cspan class=\"token punctuation\">.\u003C\u002Fspan>token\u003Cspan class=\"token interpolation-punctuation punctuation\">}\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"token template-punctuation string\">`\u003C\u002Fspan>\u003C\u002Fspan>\n    \u003Cspan class=\"token punctuation\">}\u003C\u002Fspan>\n    \u003Cspan class=\"token keyword\">return\u003C\u002Fspan> config\n  \u003Cspan class=\"token punctuation\">}\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">)\u003C\u002Fspan>\n\u003Cspan class=\"token punctuation\">}\u003C\u002Fspan>",{"type":23,"html":341},"\u003Cp>If an interceptor has side effects, such as logging, it can skip that dry run by checking \u003Ccode>config[Symbol.for('druxt.processCache.probe')]\u003C\u002Fcode>. If an interceptor is an \u003Ccode>async\u003C\u002Fcode> function, the cache skips it and only sees its token when the first response arrives, so set that token on the Axios defaults instead. \u003Ccode>@nuxtjs\u002Fauth-next\u003C\u002Fcode> already does this unless \u003Ccode>token.global\u003C\u002Fcode> is off. Menus work the same way, including when an interceptor adds credentials only to menu requests.\u003C\u002Fp>","Signed-in requests skip the cache",{"type":18,"layout":19,"regions":344,"title":355},{"content":345},[346,348,353],{"type":23,"html":347},"\u003Cp>\u003Ccode>v-model\u003C\u002Fcode> on the \u003Ccode>Druxt\u003C\u002Fcode> component now updates when the module changes its value (\u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fdruxt\u002Fdruxt.js\u002Fissues\u002F1005\">#1005\u003C\u002Fa>), so an entity form reports each edit to its parent:\u003C\u002Fp>",{"type":78,"title":349,"language":350,"code":351,"highlighted":352},"pages\u002Fedit\u002F_uuid.vue","vue","\u003Ctemplate>\n  \u003Cdiv>\n    \u003CDruxt\n      v-model=\"entity\"\n      module=\"entity-form\"\n      :props-data=\"{ type: 'node--page', uuid }\"\n    \u002F>\n    \u003Cpre>{{ entity }}\u003C\u002Fpre>\n  \u003C\u002Fdiv>\n\u003C\u002Ftemplate>\n\n\u003Cscript>\nexport default {\n  asyncData: ({ params }) => ({ uuid: params.uuid }),\n  data: () => ({ entity: undefined }),\n}\n\u003C\u002Fscript>","\u003Cspan class=\"token tag\">\u003Cspan class=\"token tag\">\u003Cspan class=\"token punctuation\">&lt;\u003C\u002Fspan>template\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">>\u003C\u002Fspan>\u003C\u002Fspan>\n  \u003Cspan class=\"token tag\">\u003Cspan class=\"token tag\">\u003Cspan class=\"token punctuation\">&lt;\u003C\u002Fspan>div\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">>\u003C\u002Fspan>\u003C\u002Fspan>\n    \u003Cspan class=\"token tag\">\u003Cspan class=\"token tag\">\u003Cspan class=\"token punctuation\">&lt;\u003C\u002Fspan>Druxt\u003C\u002Fspan>\n      \u003Cspan class=\"token attr-name\">v-model\u003C\u002Fspan>\u003Cspan class=\"token attr-value\">\u003Cspan class=\"token punctuation attr-equals\">=\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">\"\u003C\u002Fspan>entity\u003Cspan class=\"token punctuation\">\"\u003C\u002Fspan>\u003C\u002Fspan>\n      \u003Cspan class=\"token attr-name\">module\u003C\u002Fspan>\u003Cspan class=\"token attr-value\">\u003Cspan class=\"token punctuation attr-equals\">=\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">\"\u003C\u002Fspan>entity-form\u003Cspan class=\"token punctuation\">\"\u003C\u002Fspan>\u003C\u002Fspan>\n      \u003Cspan class=\"token attr-name\">:props-data\u003C\u002Fspan>\u003Cspan class=\"token attr-value\">\u003Cspan class=\"token punctuation attr-equals\">=\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">\"\u003C\u002Fspan>{ type: 'node--page', uuid }\u003Cspan class=\"token punctuation\">\"\u003C\u002Fspan>\u003C\u002Fspan>\n    \u003Cspan class=\"token punctuation\">\u002F>\u003C\u002Fspan>\u003C\u002Fspan>\n    \u003Cspan class=\"token tag\">\u003Cspan class=\"token tag\">\u003Cspan class=\"token punctuation\">&lt;\u003C\u002Fspan>pre\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">>\u003C\u002Fspan>\u003C\u002Fspan>{{ entity }}\u003Cspan class=\"token tag\">\u003Cspan class=\"token tag\">\u003Cspan class=\"token punctuation\">&lt;\u002F\u003C\u002Fspan>pre\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">>\u003C\u002Fspan>\u003C\u002Fspan>\n  \u003Cspan class=\"token tag\">\u003Cspan class=\"token tag\">\u003Cspan class=\"token punctuation\">&lt;\u002F\u003C\u002Fspan>div\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">>\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"token tag\">\u003Cspan class=\"token tag\">\u003Cspan class=\"token punctuation\">&lt;\u002F\u003C\u002Fspan>template\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">>\u003C\u002Fspan>\u003C\u002Fspan>\n\n\u003Cspan class=\"token tag\">\u003Cspan class=\"token tag\">\u003Cspan class=\"token punctuation\">&lt;\u003C\u002Fspan>script\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">>\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"token script\">\u003Cspan class=\"token language-javascript\">\n\u003Cspan class=\"token keyword\">export\u003C\u002Fspan> \u003Cspan class=\"token keyword\">default\u003C\u002Fspan> \u003Cspan class=\"token punctuation\">{\u003C\u002Fspan>\n  \u003Cspan class=\"token function-variable function\">asyncData\u003C\u002Fspan>\u003Cspan class=\"token operator\">:\u003C\u002Fspan> \u003Cspan class=\"token punctuation\">(\u003C\u002Fspan>\u003Cspan class=\"token parameter\">\u003Cspan class=\"token punctuation\">{\u003C\u002Fspan> params \u003Cspan class=\"token punctuation\">}\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">)\u003C\u002Fspan> \u003Cspan class=\"token operator\">=>\u003C\u002Fspan> \u003Cspan class=\"token punctuation\">(\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">{\u003C\u002Fspan> \u003Cspan class=\"token literal-property property\">uuid\u003C\u002Fspan>\u003Cspan class=\"token operator\">:\u003C\u002Fspan> params\u003Cspan class=\"token punctuation\">.\u003C\u002Fspan>uuid \u003Cspan class=\"token punctuation\">}\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">)\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">,\u003C\u002Fspan>\n  \u003Cspan class=\"token function-variable function\">data\u003C\u002Fspan>\u003Cspan class=\"token operator\">:\u003C\u002Fspan> \u003Cspan class=\"token punctuation\">(\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">)\u003C\u002Fspan> \u003Cspan class=\"token operator\">=>\u003C\u002Fspan> \u003Cspan class=\"token punctuation\">(\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">{\u003C\u002Fspan> \u003Cspan class=\"token literal-property property\">entity\u003C\u002Fspan>\u003Cspan class=\"token operator\">:\u003C\u002Fspan> \u003Cspan class=\"token keyword\">undefined\u003C\u002Fspan> \u003Cspan class=\"token punctuation\">}\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">)\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">,\u003C\u002Fspan>\n\u003Cspan class=\"token punctuation\">}\u003C\u002Fspan>\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"token tag\">\u003Cspan class=\"token tag\">\u003Cspan class=\"token punctuation\">&lt;\u002F\u003C\u002Fspan>script\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">>\u003C\u002Fspan>\u003C\u002Fspan>",{"type":23,"html":354},"\u003Cp>A value you set while the entity is loading is now kept when the entity arrives (\u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fdruxt\u002Fdruxt.js\u002Fissues\u002F1036\">#1036\u003C\u002Fa>). A field rendered in another component's slot reads its own entity's data (\u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fdruxt\u002Fdruxt.js\u002Fissues\u002F1020\">#1020\u003C\u002Fa>). \u003Ccode>v-model\u003C\u002Fcode> now works on every module alongside druxt-entity, so exposed Views filters apply (\u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fdruxt\u002Fdruxt.js\u002Fissues\u002F1037\">#1037\u003C\u002Fa>). Changing a filter on page three of a view returns you to page one, as Drupal does (\u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fdruxt\u002Fdruxt.js\u002Fissues\u002F1032\">#1032\u003C\u002Fa>).\u003C\u002Fp>","v-model that follows the form",{"type":18,"layout":19,"regions":357,"title":367},{"content":358},[359,361,365],{"type":23,"html":360},"\u003Cp>A failed \u003Ccode>druxt\u002FgetResource\u003C\u002Fcode> request now includes its status code, so you can send a 401 to the login page and treat a 404 as missing (\u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fdruxt\u002Fdruxt.js\u002Fissues\u002F1013\">#1013\u003C\u002Fa>). A request that never reaches Drupal reports 500.\u003C\u002Fp>",{"type":78,"title":362,"language":225,"code":363,"highlighted":364},"Send a 401 to the login page","async asyncData({ store, params, redirect }) {\n  const resource = await store.dispatch('druxt\u002FgetResource', {\n    type: 'node--page',\n    id: params.id,\n  })\n  if (resource.error?.statusCode === 401) {\n    return redirect('\u002Fuser\u002Flogin')\n  }\n  return { resource }\n},","\u003Cspan class=\"token keyword\">async\u003C\u002Fspan> \u003Cspan class=\"token function\">asyncData\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">(\u003C\u002Fspan>\u003Cspan class=\"token parameter\">\u003Cspan class=\"token punctuation\">{\u003C\u002Fspan> store\u003Cspan class=\"token punctuation\">,\u003C\u002Fspan> params\u003Cspan class=\"token punctuation\">,\u003C\u002Fspan> redirect \u003Cspan class=\"token punctuation\">}\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">)\u003C\u002Fspan> \u003Cspan class=\"token punctuation\">{\u003C\u002Fspan>\n  \u003Cspan class=\"token keyword\">const\u003C\u002Fspan> resource \u003Cspan class=\"token operator\">=\u003C\u002Fspan> \u003Cspan class=\"token keyword\">await\u003C\u002Fspan> store\u003Cspan class=\"token punctuation\">.\u003C\u002Fspan>\u003Cspan class=\"token function\">dispatch\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">(\u003C\u002Fspan>\u003Cspan class=\"token string\">'druxt\u002FgetResource'\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">,\u003C\u002Fspan> \u003Cspan class=\"token punctuation\">{\u003C\u002Fspan>\n    \u003Cspan class=\"token literal-property property\">type\u003C\u002Fspan>\u003Cspan class=\"token operator\">:\u003C\u002Fspan> \u003Cspan class=\"token string\">'node--page'\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">,\u003C\u002Fspan>\n    \u003Cspan class=\"token literal-property property\">id\u003C\u002Fspan>\u003Cspan class=\"token operator\">:\u003C\u002Fspan> params\u003Cspan class=\"token punctuation\">.\u003C\u002Fspan>id\u003Cspan class=\"token punctuation\">,\u003C\u002Fspan>\n  \u003Cspan class=\"token punctuation\">}\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">)\u003C\u002Fspan>\n  \u003Cspan class=\"token keyword\">if\u003C\u002Fspan> \u003Cspan class=\"token punctuation\">(\u003C\u002Fspan>resource\u003Cspan class=\"token punctuation\">.\u003C\u002Fspan>error\u003Cspan class=\"token operator\">?.\u003C\u002Fspan>statusCode \u003Cspan class=\"token operator\">===\u003C\u002Fspan> \u003Cspan class=\"token number\">401\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">)\u003C\u002Fspan> \u003Cspan class=\"token punctuation\">{\u003C\u002Fspan>\n    \u003Cspan class=\"token keyword\">return\u003C\u002Fspan> \u003Cspan class=\"token function\">redirect\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">(\u003C\u002Fspan>\u003Cspan class=\"token string\">'\u002Fuser\u002Flogin'\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">)\u003C\u002Fspan>\n  \u003Cspan class=\"token punctuation\">}\u003C\u002Fspan>\n  \u003Cspan class=\"token keyword\">return\u003C\u002Fspan> \u003Cspan class=\"token punctuation\">{\u003C\u002Fspan> resource \u003Cspan class=\"token punctuation\">}\u003C\u002Fspan>\n\u003Cspan class=\"token punctuation\">}\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">,\u003C\u002Fspan>",{"type":23,"html":366},"\u003Cp>JSON:API links now reach the browser as paths, even when Drupal builds them with a different scheme or host, such as \u003Ccode>https:\u002F\u002F\u003C\u002Fcode> behind a proxy. Client-side navigation stays on your frontend (\u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fdruxt\u002Fdruxt.js\u002Fissues\u002F833\">#833\u003C\u002Fa>). \u003Ccode>DruxtSiteMixin\u003C\u002Fcode> also imports in client-side code without pulling Node's \u003Ccode>fs\u003C\u002Fcode> into the bundle (\u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fdruxt\u002Fdruxt.js\u002Fissues\u002F545\">#545\u003C\u002Fa>). Thanks to \u003Ca href=\"https:\u002F\u002Fgithub.com\u002FSebastix\">Sebastix\u003C\u002Fa> for reporting that one.\u003C\u002Fp>","When a resource fails",{"type":18,"layout":19,"regions":369,"title":381},{"content":370},[371,373,377,379],{"type":23,"html":372},"\u003Cp>Upgrading druxt-site brings the other six packages with it. Druxt now requires axios 0.35.0 or later, so that the bundle holds one copy (\u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fdruxt\u002Fdruxt.js\u002Fissues\u002F1029\">#1029\u003C\u002Fa>). Install both in one command:\u003C\u002Fp>",{"type":78,"title":374,"language":80,"code":375,"highlighted":376},"Upgrade through druxt-site","npm i druxt-site@0.15.2 axios@0.35.0","\u003Cspan class=\"token function\">npm\u003C\u002Fspan> i druxt-site@0.15.2 axios@0.35.0",{"type":23,"html":378},"\u003Cp>If your \u003Ccode>package.json\u003C\u002Fcode> lists any other Druxt package directly, such as druxt-schema, add it to the command too. Otherwise the older copy stays at the top of \u003Ccode>node_modules\u003C\u002Fcode>, \u003Ccode>nuxt build\u003C\u002Fcode> loads it, and an old druxt-schema still fails on Canvas.\u003C\u002Fp>",{"type":23,"html":380},"\u003Cp>Empty strings behave differently too. The \u003Ccode>value\u003C\u002Fcode> of a module, field or exposed filter now stays \u003Ccode>''\u003C\u002Fcode> instead of Vue reading it as \u003Ccode>true\u003C\u002Fcode>, and a custom field that emits \u003Ccode>''\u003C\u002Fcode> passes it to its parent. If your code checks for \u003Ccode>undefined\u003C\u002Fcode> to detect a cleared field, check for \u003Ccode>''\u003C\u002Fcode> as well.\u003C\u002Fp>","Upgrading",{"type":18,"layout":19,"regions":383},{"content":384},[385,387,389],{"type":23,"html":386},"\u003Cp>Nuxt 2 is end of life. 0.x is for sites already running on it, and I want those sites solid before 1.0.0. New sites should start on Druxt 2. Next is 0.26.0, the multilingual release, due 8 December. It's the last 0.x before the 1.0.0 release candidate. 1.0.0 is due 2 February and Druxt 2 is due 20 April, both on the \u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fdruxt\u002Fdruxt.js\u002Fmilestones\">milestones page\u003C\u002Fa>.\u003C\u002Fp>",{"type":23,"html":388},"\u003Cp>Which Canvas components does your site use, and which would you want rendered first?\u003C\u002Fp>",{"type":108,"description":390,"url":391,"gitpod":12},"\u003Cp>Druxt is open source on GitHub. The demo's source is in \u003Ca href=\"https:\u002F\u002Fgithub.com\u002FDecipher\u002Fdemo-druxt-canvas\">Decipher\u002Fdemo-druxt-canvas\u003C\u002Fa>, ready to fork and point at your own Drupal site. Sponsorship keeps the 0.x line getting fixes like these while I build Druxt 2.\u003C\u002Fp>","https:\u002F\u002Fgithub.com\u002Fdruxt\u002Fdruxt.js",[393,394,395],{"path":274,"source":117},{"path":122,"source":117},{"path":396,"source":120},"\u002Fwriting\u002Fdruxt-drupal-13x-resource-list-yours-20260909",{"loc":119},"articles-data\u002Fdruxt-0252-drupal-canvas-sites-no-drupal-required-20261124",[127],"ayngo7_GtYWX3ySenYLBTVxNkifBt0Fq5utgJVEdi6g",{"id":402,"title":403,"articleType":6,"categories":404,"date":405,"description":406,"extension":11,"feedImage":12,"hiddenCategories":407,"meta":408,"paragraphs":409,"path":116,"readingTime":113,"related":529,"sitemap":533,"stem":534,"topics":535,"__hash__":536},"articleEntries\u002Farticles-data\u002Fvale-100-prose-linting-drupal-20261028.json","Vale 1.0.0; prose linting for Drupal",[8],"2026-10-28T16:20:00+11:00","Vale (for Drupal) holds every validated save to your style guide, from the node form or over JSON:API, and refuses the ones that break it.",[14],{},[410,417,423,448,462,480,496,509,519,524],{"type":18,"layout":19,"regions":411},{"content":412},[413,415],{"type":23,"html":414},"\u003Cp>Drupal is 25 this year, and its code has had linters for a long time. Its words haven't, and with Drupal AI writing straight into the node form, more of them now come from a model. A search of drupal.org turns up readability scores and spellcheckers, but nothing that holds a save to your own style guide.\u003C\u002Fp>",{"type":23,"html":416},"\u003Cp>Vale (for Drupal) does that with the \u003Ca href=\"https:\u002F\u002Fvale.sh\">Vale\u003C\u002Fa> prose linter. Break an error-level rule and the save is refused, or only the publish if drafts should save freely. \u003Ccode>1.0.0\u003C\u002Fcode> is out now for Drupal 10.3, 11 and 12, and needs the Vale binary on your server.\u003C\u002Fp>",{"type":18,"title":418,"layout":19,"regions":419},"Doesn't CI already do this?",{"content":420},[421],{"type":23,"html":422},"\u003Cp>Vale in CI is the right tool for Markdown in a repository. Content in Drupal arrives through a save instead: the node form, a Fully Decoupled frontend over JSON:API, a workspace being published. The module checks there, on the server, whatever editor the author used.\u003C\u002Fp>",{"type":18,"title":424,"layout":19,"regions":425},"Setting it up",{"content":426},[427,429,433,435,438,440,442],{"type":23,"html":428},"\u003Cp>\u003Ccode>drush vale:install\u003C\u002Fcode> puts the binary in \u003Ccode>bin\u002F\u003C\u002Fcode> beside your web root, checked against its published SHA-256:\u003C\u002Fp>",{"type":78,"title":430,"code":431,"language":80,"highlighted":432},"Install the module and Vale, on a Composer site with Drush","composer require drupal\u002Fvale\ndrush en vale\ndrush vale:install","\u003Cspan class=\"token function\">composer\u003C\u002Fspan> require drupal\u002Fvale\ndrush en vale\ndrush vale:install",{"type":23,"html":434},"\u003Cp>Write a \u003Ccode>.vale.ini\u003C\u002Fcode>, run \u003Ccode>bin\u002Fvale sync\u003C\u002Fcode> beside it, deploy the \u003Ccode>styles\u003C\u002Fcode> directory with the site, and point \u003Ccode>settings.php\u003C\u002Fcode> at both:\u003C\u002Fp>",{"type":78,"title":170,"language":171,"code":436,"highlighted":437},"$settings['vale_binary'] = $app_root . '\u002F..\u002Fbin\u002Fvale';\n$settings['vale_config'] = $app_root . '\u002F..\u002F.vale.ini';\n\n\u002F\u002F Optional.\n$config['vale.settings']['publish_only'] = TRUE;\n$config['vale.settings']['workspace_mode'] = 'block';\n\u002F\u002F Keyed by your Markdown text format's machine name.\n$config['vale.settings']['formats'] = ['markdown' => 'md'];","\u003Cspan class=\"token variable\">$settings\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">[\u003C\u002Fspan>\u003Cspan class=\"token string single-quoted-string\">'vale_binary'\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">]\u003C\u002Fspan> \u003Cspan class=\"token operator\">=\u003C\u002Fspan> \u003Cspan class=\"token variable\">$app_root\u003C\u002Fspan> \u003Cspan class=\"token operator\">.\u003C\u002Fspan> \u003Cspan class=\"token string single-quoted-string\">'\u002F..\u002Fbin\u002Fvale'\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">;\u003C\u002Fspan>\n\u003Cspan class=\"token variable\">$settings\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">[\u003C\u002Fspan>\u003Cspan class=\"token string single-quoted-string\">'vale_config'\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">]\u003C\u002Fspan> \u003Cspan class=\"token operator\">=\u003C\u002Fspan> \u003Cspan class=\"token variable\">$app_root\u003C\u002Fspan> \u003Cspan class=\"token operator\">.\u003C\u002Fspan> \u003Cspan class=\"token string single-quoted-string\">'\u002F..\u002F.vale.ini'\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">;\u003C\u002Fspan>\n\n\u003Cspan class=\"token comment\">\u002F\u002F Optional.\u003C\u002Fspan>\n\u003Cspan class=\"token variable\">$config\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">[\u003C\u002Fspan>\u003Cspan class=\"token string single-quoted-string\">'vale.settings'\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">]\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">[\u003C\u002Fspan>\u003Cspan class=\"token string single-quoted-string\">'publish_only'\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">]\u003C\u002Fspan> \u003Cspan class=\"token operator\">=\u003C\u002Fspan> \u003Cspan class=\"token constant boolean\">TRUE\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">;\u003C\u002Fspan>\n\u003Cspan class=\"token variable\">$config\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">[\u003C\u002Fspan>\u003Cspan class=\"token string single-quoted-string\">'vale.settings'\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">]\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">[\u003C\u002Fspan>\u003Cspan class=\"token string single-quoted-string\">'workspace_mode'\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">]\u003C\u002Fspan> \u003Cspan class=\"token operator\">=\u003C\u002Fspan> \u003Cspan class=\"token string single-quoted-string\">'block'\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">;\u003C\u002Fspan>\n\u003Cspan class=\"token comment\">\u002F\u002F Keyed by your Markdown text format's machine name.\u003C\u002Fspan>\n\u003Cspan class=\"token variable\">$config\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">[\u003C\u002Fspan>\u003Cspan class=\"token string single-quoted-string\">'vale.settings'\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">]\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">[\u003C\u002Fspan>\u003Cspan class=\"token string single-quoted-string\">'formats'\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">]\u003C\u002Fspan> \u003Cspan class=\"token operator\">=\u003C\u002Fspan> \u003Cspan class=\"token punctuation\">[\u003C\u002Fspan>\u003Cspan class=\"token string single-quoted-string\">'markdown'\u003C\u002Fspan> \u003Cspan class=\"token operator\">=>\u003C\u002Fspan> \u003Cspan class=\"token string single-quoted-string\">'md'\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">]\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">;\u003C\u002Fspan>",{"type":23,"html":439},"\u003Cp>Then tick \u003Cem>Check with Vale\u003C\u002Fem> under \u003Cem>Prose checks\u003C\u002Fem> in a text field's settings, and the Status report confirms it.\u003C\u002Fp>",{"type":23,"html":441},"\u003Cp>Each field can set a minimum level, or change any rule's level or turn it off. With publish-only mode on, drafts save freely and the publish is held to the rules, following Content Moderation when it's installed.\u003C\u002Fp>",{"type":30,"alt":443,"caption":444,"width":445,"height":446,"src":447},"A Drupal edit form after a refused save. Two warnings ending \"Blocks publishing\" sit above an error that names the ai-tells HedgingPhrases and AICompoundPhrases rules, the line and the matched text.","\u003Cp>On druxtjs.org: a hedge and a cliché in a text paragraph, and the publish refused until they go.\u003C\u002Fp>",1015,455,"\u002Fimages\u002Fwriting\u002Fvale-100-prose-linting-drupal-20261028\u002Fvale-druxtjs-publish-refused.png",{"type":18,"title":449,"layout":19,"regions":450},"Writing your own rules",{"content":451},[452,454,458,460],{"type":23,"html":453},"\u003Cp>Published styles are a start, but your own rules matter most: product names, words your organisation avoids, phrases your editors overuse. Each rule is a short YAML file in a folder under \u003Ccode>styles\u003C\u002Fcode>, kept in your codebase and deployed with the site:\u003C\u002Fp>",{"type":78,"title":455,"language":190,"code":456,"highlighted":457},"styles\u002FHouse\u002FTerms.yml","extends: substitution\nmessage: \"Use '%s' instead of '%s'.\"\nlevel: error\nignorecase: false\nswap:\n  drupal: Drupal\n  headless: Fully Decoupled","\u003Cspan class=\"token key atrule\">extends\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">:\u003C\u002Fspan> substitution\n\u003Cspan class=\"token key atrule\">message\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">:\u003C\u002Fspan> \u003Cspan class=\"token string\">\"Use '%s' instead of '%s'.\"\u003C\u002Fspan>\n\u003Cspan class=\"token key atrule\">level\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">:\u003C\u002Fspan> error\n\u003Cspan class=\"token key atrule\">ignorecase\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">:\u003C\u002Fspan> \u003Cspan class=\"token boolean important\">false\u003C\u002Fspan>\n\u003Cspan class=\"token key atrule\">swap\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">:\u003C\u002Fspan>\n  \u003Cspan class=\"token key atrule\">drupal\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">:\u003C\u002Fspan> Drupal\n  \u003Cspan class=\"token key atrule\">headless\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">:\u003C\u002Fspan> Fully Decoupled",{"type":23,"html":459},"\u003Cp>Add \u003Ccode>House\u003C\u002Fcode> to \u003Ccode>BasedOnStyles\u003C\u002Fcode> in \u003Ccode>.vale.ini\u003C\u002Fcode>, and a save with \"headless drupal\" in it is refused. \u003Ccode>drush vale:check node.article.body \"Some text.\"\u003C\u002Fcode> tries a rule against a field before an editor meets it. Levels are the site builder's call, so start a new rule at warning and promote it once you trust it.\u003C\u002Fp>",{"type":23,"html":461},"\u003Cp>Vale's \u003Ca href=\"https:\u002F\u002Fvale.sh\u002Fdocs\u002Fstyles\">styles documentation\u003C\u002Fa> covers the other checks, from banned words to sentence length, and you can browse published styles in \u003Ca href=\"https:\u002F\u002Fvale.sh\u002Fexplorer\">Vale's explorer\u003C\u002Fa>. The rules this post was held to are in this site's \u003Ca href=\"https:\u002F\u002Fgithub.com\u002FDecipher\u002Fstuar.tc\u002Fblob\u002Fmain\u002F.vale.ini\">\u003Ccode>.vale.ini\u003C\u002Fcode>\u003C\u002Fa>.\u003C\u002Fp>",{"type":18,"title":463,"layout":19,"regions":464},"Over JSON:API",{"content":465},[466,468,472,474,478],{"type":23,"html":467},"\u003Cp>This is the part I built it for. On a Fully Decoupled site, a \u003Ca href=\"https:\u002F\u002Fdruxtjs.org\">Druxt\u003C\u002Fa> or Nuxt frontend writes over JSON:API, and the check runs in the entity's validation, which those writes go through as well as the form. Post a body with a repeated word, with Vale's built-in style on, and you get a 422 that points at the field:\u003C\u002Fp>",{"type":78,"title":469,"code":470,"language":11,"highlighted":471},"POST \u002Fjsonapi\u002Fnode\u002Farticle, with \"Check the the docs.\" in the body","{\n  \"errors\": [\n    {\n      \"title\": \"Unprocessable Content\",\n      \"status\": \"422\",\n      \"detail\": \"body.0.value: Body: Vale.Repetition: 'the' is repeated! (line 1: \\\"the the\\\")\",\n      \"source\": {\n        \"pointer\": \"\u002Fdata\u002Fattributes\u002Fbody\u002Fvalue\"\n      }\n    }\n  ]\n}","\u003Cspan class=\"token punctuation\">{\u003C\u002Fspan>\n  \u003Cspan class=\"token property\">\"errors\"\u003C\u002Fspan>\u003Cspan class=\"token operator\">:\u003C\u002Fspan> \u003Cspan class=\"token punctuation\">[\u003C\u002Fspan>\n    \u003Cspan class=\"token punctuation\">{\u003C\u002Fspan>\n      \u003Cspan class=\"token property\">\"title\"\u003C\u002Fspan>\u003Cspan class=\"token operator\">:\u003C\u002Fspan> \u003Cspan class=\"token string\">\"Unprocessable Content\"\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">,\u003C\u002Fspan>\n      \u003Cspan class=\"token property\">\"status\"\u003C\u002Fspan>\u003Cspan class=\"token operator\">:\u003C\u002Fspan> \u003Cspan class=\"token string\">\"422\"\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">,\u003C\u002Fspan>\n      \u003Cspan class=\"token property\">\"detail\"\u003C\u002Fspan>\u003Cspan class=\"token operator\">:\u003C\u002Fspan> \u003Cspan class=\"token string\">\"body.0.value: Body: Vale.Repetition: 'the' is repeated! (line 1: \\\"the the\\\")\"\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">,\u003C\u002Fspan>\n      \u003Cspan class=\"token property\">\"source\"\u003C\u002Fspan>\u003Cspan class=\"token operator\">:\u003C\u002Fspan> \u003Cspan class=\"token punctuation\">{\u003C\u002Fspan>\n        \u003Cspan class=\"token property\">\"pointer\"\u003C\u002Fspan>\u003Cspan class=\"token operator\">:\u003C\u002Fspan> \u003Cspan class=\"token string\">\"\u002Fdata\u002Fattributes\u002Fbody\u002Fvalue\"\u003C\u002Fspan>\n      \u003Cspan class=\"token punctuation\">}\u003C\u002Fspan>\n    \u003Cspan class=\"token punctuation\">}\u003C\u002Fspan>\n  \u003Cspan class=\"token punctuation\">]\u003C\u002Fspan>\n\u003Cspan class=\"token punctuation\">}\u003C\u002Fspan>",{"type":23,"html":473},"\u003Cp>Several errors in one value share that entry, one per line of \u003Ccode>detail\u003C\u002Fcode>, each naming its field. With publish-only mode on, a refused publish comes back on the entity, at \u003Ccode>\u002Fdata\u003C\u002Fcode>, still naming the field. Warnings and suggestions come back in \u003Ccode>meta.vale\u003C\u002Fcode>, on a refused write or a successful one, with \u003Ccode>checked\u003C\u002Fcode> false if Vale couldn't run:\u003C\u002Fp>",{"type":78,"title":475,"language":11,"code":476,"highlighted":477},"meta.vale on a 201, with a warning","{\n  \"meta\": {\n    \"vale\": {\n      \"checked\": true,\n      \"alerts\": [\n        {\n          \"entity_type\": \"node\",\n          \"bundle\": \"article\",\n          \"id\": \"a22048fc-b0ec-4a9b-a80b-14be85498d81\",\n          \"field\": \"body\",\n          \"delta\": 0,\n          \"rule\": \"Microsoft.Adverbs\",\n          \"level\": \"warning\",\n          \"message\": \"Remove 'very' if it's not important to the meaning of the statement.\",\n          \"line\": 1,\n          \"start\": 9,\n          \"end\": 12,\n          \"match\": \"very\",\n          \"description\": \"\",\n          \"link\": \"https:\u002F\u002Flearn.microsoft.com\u002Fen-us\u002Fstyle-guide\u002Fword-choice\u002Fuse-simple-words-concise-sentences\"\n        }\n      ]\n    }\n  }\n}","\u003Cspan class=\"token punctuation\">{\u003C\u002Fspan>\n  \u003Cspan class=\"token property\">\"meta\"\u003C\u002Fspan>\u003Cspan class=\"token operator\">:\u003C\u002Fspan> \u003Cspan class=\"token punctuation\">{\u003C\u002Fspan>\n    \u003Cspan class=\"token property\">\"vale\"\u003C\u002Fspan>\u003Cspan class=\"token operator\">:\u003C\u002Fspan> \u003Cspan class=\"token punctuation\">{\u003C\u002Fspan>\n      \u003Cspan class=\"token property\">\"checked\"\u003C\u002Fspan>\u003Cspan class=\"token operator\">:\u003C\u002Fspan> \u003Cspan class=\"token boolean\">true\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">,\u003C\u002Fspan>\n      \u003Cspan class=\"token property\">\"alerts\"\u003C\u002Fspan>\u003Cspan class=\"token operator\">:\u003C\u002Fspan> \u003Cspan class=\"token punctuation\">[\u003C\u002Fspan>\n        \u003Cspan class=\"token punctuation\">{\u003C\u002Fspan>\n          \u003Cspan class=\"token property\">\"entity_type\"\u003C\u002Fspan>\u003Cspan class=\"token operator\">:\u003C\u002Fspan> \u003Cspan class=\"token string\">\"node\"\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">,\u003C\u002Fspan>\n          \u003Cspan class=\"token property\">\"bundle\"\u003C\u002Fspan>\u003Cspan class=\"token operator\">:\u003C\u002Fspan> \u003Cspan class=\"token string\">\"article\"\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">,\u003C\u002Fspan>\n          \u003Cspan class=\"token property\">\"id\"\u003C\u002Fspan>\u003Cspan class=\"token operator\">:\u003C\u002Fspan> \u003Cspan class=\"token string\">\"a22048fc-b0ec-4a9b-a80b-14be85498d81\"\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">,\u003C\u002Fspan>\n          \u003Cspan class=\"token property\">\"field\"\u003C\u002Fspan>\u003Cspan class=\"token operator\">:\u003C\u002Fspan> \u003Cspan class=\"token string\">\"body\"\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">,\u003C\u002Fspan>\n          \u003Cspan class=\"token property\">\"delta\"\u003C\u002Fspan>\u003Cspan class=\"token operator\">:\u003C\u002Fspan> \u003Cspan class=\"token number\">0\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">,\u003C\u002Fspan>\n          \u003Cspan class=\"token property\">\"rule\"\u003C\u002Fspan>\u003Cspan class=\"token operator\">:\u003C\u002Fspan> \u003Cspan class=\"token string\">\"Microsoft.Adverbs\"\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">,\u003C\u002Fspan>\n          \u003Cspan class=\"token property\">\"level\"\u003C\u002Fspan>\u003Cspan class=\"token operator\">:\u003C\u002Fspan> \u003Cspan class=\"token string\">\"warning\"\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">,\u003C\u002Fspan>\n          \u003Cspan class=\"token property\">\"message\"\u003C\u002Fspan>\u003Cspan class=\"token operator\">:\u003C\u002Fspan> \u003Cspan class=\"token string\">\"Remove 'very' if it's not important to the meaning of the statement.\"\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">,\u003C\u002Fspan>\n          \u003Cspan class=\"token property\">\"line\"\u003C\u002Fspan>\u003Cspan class=\"token operator\">:\u003C\u002Fspan> \u003Cspan class=\"token number\">1\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">,\u003C\u002Fspan>\n          \u003Cspan class=\"token property\">\"start\"\u003C\u002Fspan>\u003Cspan class=\"token operator\">:\u003C\u002Fspan> \u003Cspan class=\"token number\">9\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">,\u003C\u002Fspan>\n          \u003Cspan class=\"token property\">\"end\"\u003C\u002Fspan>\u003Cspan class=\"token operator\">:\u003C\u002Fspan> \u003Cspan class=\"token number\">12\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">,\u003C\u002Fspan>\n          \u003Cspan class=\"token property\">\"match\"\u003C\u002Fspan>\u003Cspan class=\"token operator\">:\u003C\u002Fspan> \u003Cspan class=\"token string\">\"very\"\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">,\u003C\u002Fspan>\n          \u003Cspan class=\"token property\">\"description\"\u003C\u002Fspan>\u003Cspan class=\"token operator\">:\u003C\u002Fspan> \u003Cspan class=\"token string\">\"\"\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">,\u003C\u002Fspan>\n          \u003Cspan class=\"token property\">\"link\"\u003C\u002Fspan>\u003Cspan class=\"token operator\">:\u003C\u002Fspan> \u003Cspan class=\"token string\">\"https:\u002F\u002Flearn.microsoft.com\u002Fen-us\u002Fstyle-guide\u002Fword-choice\u002Fuse-simple-words-concise-sentences\"\u003C\u002Fspan>\n        \u003Cspan class=\"token punctuation\">}\u003C\u002Fspan>\n      \u003Cspan class=\"token punctuation\">]\u003C\u002Fspan>\n    \u003Cspan class=\"token punctuation\">}\u003C\u002Fspan>\n  \u003Cspan class=\"token punctuation\">}\u003C\u002Fspan>\n\u003Cspan class=\"token punctuation\">}\u003C\u002Fspan>",{"type":23,"html":479},"\u003Cp>So a Fully Decoupled editor gets the same feedback as the node form, without rebuilding the rules in JavaScript.\u003C\u002Fp>",{"type":18,"title":481,"layout":19,"regions":482},"Checking before the save",{"content":483},[484,486,490,494],{"type":23,"html":485},"\u003Cp>\u003Ccode>POST \u002Fvale\u002Fcheck\u003C\u002Fcode> returns the alerts a field would get, with the sentence around each, and saves nothing. It's built for an editor that checks as you type, in Druxt or anywhere else.\u003C\u002Fp>",{"type":78,"title":487,"language":11,"code":488,"highlighted":489},"POST \u002Fvale\u002Fcheck","{\n  \"entity_type\": \"node\",\n  \"bundle\": \"article\",\n  \"field\": \"body\",\n  \"format\": \"basic_html\",\n  \"text\": \"\u003Cp>Check the the docs. This step is very easy to miss.\u003C\u002Fp>\"\n}","\u003Cspan class=\"token punctuation\">{\u003C\u002Fspan>\n  \u003Cspan class=\"token property\">\"entity_type\"\u003C\u002Fspan>\u003Cspan class=\"token operator\">:\u003C\u002Fspan> \u003Cspan class=\"token string\">\"node\"\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">,\u003C\u002Fspan>\n  \u003Cspan class=\"token property\">\"bundle\"\u003C\u002Fspan>\u003Cspan class=\"token operator\">:\u003C\u002Fspan> \u003Cspan class=\"token string\">\"article\"\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">,\u003C\u002Fspan>\n  \u003Cspan class=\"token property\">\"field\"\u003C\u002Fspan>\u003Cspan class=\"token operator\">:\u003C\u002Fspan> \u003Cspan class=\"token string\">\"body\"\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">,\u003C\u002Fspan>\n  \u003Cspan class=\"token property\">\"format\"\u003C\u002Fspan>\u003Cspan class=\"token operator\">:\u003C\u002Fspan> \u003Cspan class=\"token string\">\"basic_html\"\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">,\u003C\u002Fspan>\n  \u003Cspan class=\"token property\">\"text\"\u003C\u002Fspan>\u003Cspan class=\"token operator\">:\u003C\u002Fspan> \u003Cspan class=\"token string\">\"&lt;p>Check the the docs. This step is very easy to miss.&lt;\u002Fp>\"\u003C\u002Fspan>\n\u003Cspan class=\"token punctuation\">}\u003C\u002Fspan>",{"type":78,"title":491,"language":11,"code":492,"highlighted":493},"The response","{\n  \"checked\": true,\n  \"publish_only\": true,\n  \"alerts\": [\n    {\n      \"rule\": \"Vale.Repetition\",\n      \"level\": \"error\",\n      \"message\": \"'the' is repeated!\",\n      \"match\": \"the the\",\n      \"sentence\": \"Check the the docs.\"\n    },\n    {\n      \"rule\": \"Microsoft.Adverbs\",\n      \"level\": \"warning\",\n      \"message\": \"Remove 'very' if it's not important to the meaning of the statement.\",\n      \"match\": \"very\",\n      \"sentence\": \"This step is very easy to miss.\",\n      \"link\": \"https:\u002F\u002Flearn.microsoft.com\u002Fen-us\u002Fstyle-guide\u002Fword-choice\u002Fuse-simple-words-concise-sentences\"\n    }\n  ]\n}","\u003Cspan class=\"token punctuation\">{\u003C\u002Fspan>\n  \u003Cspan class=\"token property\">\"checked\"\u003C\u002Fspan>\u003Cspan class=\"token operator\">:\u003C\u002Fspan> \u003Cspan class=\"token boolean\">true\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">,\u003C\u002Fspan>\n  \u003Cspan class=\"token property\">\"publish_only\"\u003C\u002Fspan>\u003Cspan class=\"token operator\">:\u003C\u002Fspan> \u003Cspan class=\"token boolean\">true\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">,\u003C\u002Fspan>\n  \u003Cspan class=\"token property\">\"alerts\"\u003C\u002Fspan>\u003Cspan class=\"token operator\">:\u003C\u002Fspan> \u003Cspan class=\"token punctuation\">[\u003C\u002Fspan>\n    \u003Cspan class=\"token punctuation\">{\u003C\u002Fspan>\n      \u003Cspan class=\"token property\">\"rule\"\u003C\u002Fspan>\u003Cspan class=\"token operator\">:\u003C\u002Fspan> \u003Cspan class=\"token string\">\"Vale.Repetition\"\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">,\u003C\u002Fspan>\n      \u003Cspan class=\"token property\">\"level\"\u003C\u002Fspan>\u003Cspan class=\"token operator\">:\u003C\u002Fspan> \u003Cspan class=\"token string\">\"error\"\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">,\u003C\u002Fspan>\n      \u003Cspan class=\"token property\">\"message\"\u003C\u002Fspan>\u003Cspan class=\"token operator\">:\u003C\u002Fspan> \u003Cspan class=\"token string\">\"'the' is repeated!\"\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">,\u003C\u002Fspan>\n      \u003Cspan class=\"token property\">\"match\"\u003C\u002Fspan>\u003Cspan class=\"token operator\">:\u003C\u002Fspan> \u003Cspan class=\"token string\">\"the the\"\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">,\u003C\u002Fspan>\n      \u003Cspan class=\"token property\">\"sentence\"\u003C\u002Fspan>\u003Cspan class=\"token operator\">:\u003C\u002Fspan> \u003Cspan class=\"token string\">\"Check the the docs.\"\u003C\u002Fspan>\n    \u003Cspan class=\"token punctuation\">}\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">,\u003C\u002Fspan>\n    \u003Cspan class=\"token punctuation\">{\u003C\u002Fspan>\n      \u003Cspan class=\"token property\">\"rule\"\u003C\u002Fspan>\u003Cspan class=\"token operator\">:\u003C\u002Fspan> \u003Cspan class=\"token string\">\"Microsoft.Adverbs\"\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">,\u003C\u002Fspan>\n      \u003Cspan class=\"token property\">\"level\"\u003C\u002Fspan>\u003Cspan class=\"token operator\">:\u003C\u002Fspan> \u003Cspan class=\"token string\">\"warning\"\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">,\u003C\u002Fspan>\n      \u003Cspan class=\"token property\">\"message\"\u003C\u002Fspan>\u003Cspan class=\"token operator\">:\u003C\u002Fspan> \u003Cspan class=\"token string\">\"Remove 'very' if it's not important to the meaning of the statement.\"\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">,\u003C\u002Fspan>\n      \u003Cspan class=\"token property\">\"match\"\u003C\u002Fspan>\u003Cspan class=\"token operator\">:\u003C\u002Fspan> \u003Cspan class=\"token string\">\"very\"\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">,\u003C\u002Fspan>\n      \u003Cspan class=\"token property\">\"sentence\"\u003C\u002Fspan>\u003Cspan class=\"token operator\">:\u003C\u002Fspan> \u003Cspan class=\"token string\">\"This step is very easy to miss.\"\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">,\u003C\u002Fspan>\n      \u003Cspan class=\"token property\">\"link\"\u003C\u002Fspan>\u003Cspan class=\"token operator\">:\u003C\u002Fspan> \u003Cspan class=\"token string\">\"https:\u002F\u002Flearn.microsoft.com\u002Fen-us\u002Fstyle-guide\u002Fword-choice\u002Fuse-simple-words-concise-sentences\"\u003C\u002Fspan>\n    \u003Cspan class=\"token punctuation\">}\u003C\u002Fspan>\n  \u003Cspan class=\"token punctuation\">]\u003C\u002Fspan>\n\u003Cspan class=\"token punctuation\">}\u003C\u002Fspan>",{"type":23,"html":495},"\u003Cp>A caller needs the \u003Cem>Use the Vale check endpoint\u003C\u002Fem> permission and edit access to the field, and a cookie session sends an \u003Ccode>X-CSRF-Token\u003C\u002Fcode>.\u003C\u002Fp>",{"type":18,"title":497,"layout":19,"regions":498},"Before a workspace goes live",{"content":499},[500,502,504],{"type":23,"html":501},"\u003Cp>Before a workspace is published, the module checks everything in it. With \u003Ccode>workspace_mode\u003C\u002Fcode> set to \u003Ccode>block\u003C\u002Fcode>, the publish is refused while anything has an error or a value can't be checked, even though an ordinary save goes through when Vale can't run. The default, \u003Ccode>advise\u003C\u002Fcode>, publishes and lists the findings.\u003C\u002Fp>",{"type":23,"html":503},"\u003Cp>Publish-only mode and workspaces suit each other. Inside a workspace every save is a draft, including an edit to a page that's already live, so editors save freely and the workspace's publish is where the rules apply, in \u003Ccode>advise\u003C\u002Fcode> mode as well as \u003Ccode>block\u003C\u002Fcode>. \u003Ccode>drush vale:lint --workspace=stage\u003C\u002Fcode> runs the same check from a deploy script.\u003C\u002Fp>",{"type":30,"alt":505,"caption":506,"width":149,"height":507,"src":508},"Two Drupal messages after a refused workspace publish. The error lists a Vale.Repetition and a Microsoft.Contractions finding on the body of a node called Release notes, then a summary: Stage, 2 prose errors, 1 warning or suggestion. A warning below lists a Microsoft.Adverbs finding.","\u003Cp>Publishing the Stage workspace, refused: two errors in a draft, and the warning listed beside them.\u003C\u002Fp>",393,"\u002Fimages\u002Fwriting\u002Fvale-100-prose-linting-drupal-20261028\u002Fvale-workspace-publish-refused.png",{"type":18,"title":510,"layout":19,"regions":511},"Before you install",{"content":512},[513,515,517],{"type":23,"html":514},"\u003Cp>Vale ships as one binary, and it has to be on every web server and in the CLI container. \u003Ccode>drush vale:install\u003C\u002Fcode> covers Linux and macOS. On a container host, build it into every image that serves Drupal or runs Drush, as druxtjs.org does on Lagoon, and add \u003Ccode>gcompat\u003C\u002Fcode> on Alpine. Other managed hosts are \u003Ca href=\"https:\u002F\u002Fgithub.com\u002FDecipher\u002Fvale\u002Fissues\u002F33\">on the 1.1.0 list\u003C\u002Fa>.\u003C\u002Fp>",{"type":23,"html":516},"\u003Cp>On a test site, Vale added about 55 ms to an uncached JSON:API save of a short paragraph, and nothing when the text hadn't changed, because results are cached until the text or the styles do. If Vale is missing or times out, the content saves and the author is told it wasn't checked, unless you set \u003Ccode>fail_closed\u003C\u002Fcode>.\u003C\u002Fp>",{"type":23,"html":518},"\u003Cp>For saves that skip validation, like a migration, \u003Ccode>drush vale:lint\u003C\u002Fcode> checks the content afterwards and exits with 1, so a deploy can depend on it. Any text field you opt in is checked, on a Drupal CMS site too. The title is a base field rather than one you opt in, and Canvas keeps its text in component props, so neither is checked.\u003C\u002Fp>",{"type":18,"layout":19,"regions":520},{"content":521},[522],{"type":108,"description":523,"url":110,"gitpod":12,"drupalUrl":111},"\u003Cp>The code is on GitHub, and the issue queue is on Drupal.org. If your editors rely on Vale, sponsoring is what funds the next release.\u003C\u002Fp>",{"type":18,"layout":19,"regions":525},{"content":526},[527],{"type":23,"html":528},"\u003Cp>Next up are hooks for other modules and summary fields, with AI-suggested rewrites further out. What would you want it to do for your editors?\u003C\u002Fp>",[530,531,532],{"path":271,"source":117},{"path":396,"source":120},{"path":274,"source":120},{"loc":116},"articles-data\u002Fvale-100-prose-linting-drupal-20261028",[126,278,279],"jIfZ1m3EcLvLdyV6ccQrzRgjt7vyTYhIrFawUoKM9RU",1796102534604]