Skip to content

Commit

Permalink
fix: remove text-size preference
Browse files Browse the repository at this point in the history
  • Loading branch information
jobara committed Jan 28, 2025
1 parent febf2aa commit 2afe279
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 1 deletion.
32 changes: 32 additions & 0 deletions eleventy.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,38 @@ export default function eleventy(eleventyConfig) {
</inclusive-disclosure>`;
});

/*
Provide a custom duplicate of eleventy-plugin-fluid's uioInit shortcode in
order to run it without the text-size preference.
*/
eleventyConfig.addShortcode("uioCustomInit", (locale, direction) => {
let options = {
preferences: ["fluid.prefs.lineSpace", "fluid.prefs.textFont", "fluid.prefs.contrast", "fluid.prefs.tableOfContents", "fluid.prefs.enhanceInputs"],
auxiliarySchema: {
terms: {
templatePrefix: "/lib/infusion/src/framework/preferences/html",
messagePrefix: "/lib/infusion/src/framework/preferences/messages"
},
"fluid.prefs.tableOfContents": {
enactor: {
tocTemplate: "/lib/infusion/src/components/tableOfContents/html/TableOfContents.html",
tocMessage: "/lib/infusion/src/framework/preferences/messages/tableOfContents-enactor.json",
ignoreForToC: {
ignoreClass: ".flc-toc-ignore"
}
}
}
},
prefsEditorLoader: {
lazyLoad: true
},
locale: locale,
direction: direction
};

return `<script>fluid.uiOptions.multilingual(".flc-prefsEditor-separatedPanel", ${JSON.stringify(options)});</script>`;
});

eleventyConfig.addTransform("parse", parse);

eleventyConfig.addPassthroughCopy({
Expand Down
2 changes: 1 addition & 1 deletion src/_includes/layouts/base.njk
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,6 @@
{% endblock %}
</main>
{% include "partials/global/footer.njk" %}
{% uioInit lang %}
{% uioCustomInit lang, supportedLanguages[lang].dir %}
</body>
</html>

0 comments on commit 2afe279

Please sign in to comment.