diff --git a/docs/_includes/feedback.html b/docs/_includes/feedback.html index 9f5ea44857..ff2ad10e31 100644 --- a/docs/_includes/feedback.html +++ b/docs/_includes/feedback.html @@ -1,28 +1,15 @@ -{% set searchName = doc.tagName if doc.tagName else (title | slug) %} -{% set related = searchName | relatedItems %} -
To learn how to use our elements in your designs, visit the Elements section.
- {% else %} -To learn how to use our patterns in your designs, visit the Patterns section.
- {% endif %} - {% endsection %} +{% set related = (doc.tagName if doc.tagName else (title | slug)) | relatedItems %} - {% section %} -- To give feedback about anything on this page, - contact us. -
- {% endsection %} -To learn more about our other libraries, visit this page.
+ {% endif %} +{% endfeedback %} diff --git a/docs/_plugins/shortcodes.cjs b/docs/_plugins/shortcodes.cjs index c1ffdb2ecf..4fbcab5b62 100644 --- a/docs/_plugins/shortcodes.cjs +++ b/docs/_plugins/shortcodes.cjs @@ -4,10 +4,11 @@ const RenderInstallation = require('./shortcodes/renderInstallation.cjs'); const ExampleImage = require('./shortcodes/example.cjs'); const Cta = require('./shortcodes/cta.cjs'); const Alert = require('./shortcodes/alert.cjs'); -const Section = require('./shortcodes/section.cjs'); +const { Section } = require('./shortcodes/section.cjs'); const Demo = require('./shortcodes/demo.cjs'); const SpacerTokensTable = require('./shortcodes/spacerTokensTable.cjs'); const TokensTable = require('./shortcodes/tokensTable.cjs'); +const Feedback = require('./shortcodes/feedback.cjs'); const renderCodeDocs = require('./shortcodes/renderCodeDocs.cjs'); /** @typedef {import('@patternfly/pfe-tools/11ty/DocsPage').DocsPage} DocsPage */ @@ -18,17 +19,17 @@ const renderCodeDocs = require('./shortcodes/renderCodeDocs.cjs'); * @property {object} page * @property {object} eleventy */ - module.exports = function(eleventyConfig) { + eleventyConfig.addPlugin(Section); eleventyConfig.addPlugin(RepoStatus); eleventyConfig.addPlugin(Playground); eleventyConfig.addPlugin(RenderInstallation); eleventyConfig.addPlugin(ExampleImage); eleventyConfig.addPlugin(Cta); eleventyConfig.addPlugin(Alert); - eleventyConfig.addPlugin(Section); eleventyConfig.addPlugin(Demo); eleventyConfig.addPlugin(SpacerTokensTable); eleventyConfig.addPlugin(TokensTable); + eleventyConfig.addPlugin(Feedback); eleventyConfig.addPlugin(renderCodeDocs); }; diff --git a/docs/_plugins/shortcodes/feedback.cjs b/docs/_plugins/shortcodes/feedback.cjs new file mode 100644 index 0000000000..63d438d73c --- /dev/null +++ b/docs/_plugins/shortcodes/feedback.cjs @@ -0,0 +1,33 @@ +const { section } = require('./section.cjs'); + +module.exports = function(eleventyConfig) { + eleventyConfig.addPairedShortcode('feedback', + /** + * Demo + * A live component demo + * @param {string} content + * @param {object} options + * @param {string} options.headline (Optional) Text to go in the heading + * @param {string} options.palette Palette to apply, e.g. lightest, light see components/_section.scss + * @param {string} options.headingLevel The heading level, defaults to 3 + */ + function demoShortcode(content) { + return /* html*/` + +To learn more about our other libraries, visit this page.
+ `} + ${section.call(this, /* html */` ++ To give feedback about anything on this page, + contact us. +
+ `)} +To give feedback about anything on this page, contact us.
- {%- endcall %} - - {% call about.section("Other resources") -%} -To learn how to use our design system kit and libraries, visit this page.
- {%- endcall %} - -To learn how to use our design system kit and libraries, visit this page.
+{% endfeedback %} diff --git a/docs/design-code-status.njk b/docs/design-code-status.njk index ae57918e40..6edfe264b3 100644 --- a/docs/design-code-status.njk +++ b/docs/design-code-status.njk @@ -300,14 +300,8 @@ title: Design/code status {%- endcall %} -To see what foundations, tokens, elements, or patterns have been released recently, visit this page.
+{% endfeedback %} - {% call components.section("Feedback") -%} -To give feedback about anything on this page, contact us.
- {%- endcall %} - - {% call components.section("Release notes") -%} -To see what foundations or components have been released recently, visit this page.
- {%- endcall %} - -To learn how to use our elements in your designs, visit the Elements section.
+{% endfeedback %} diff --git a/docs/foundations/color.njk b/docs/foundations/color.njk index 0badbcc255..c7fada84d8 100644 --- a/docs/foundations/color.njk +++ b/docs/foundations/color.njk @@ -483,14 +483,8 @@ includeComponent: {%- endcall %} -To learn how to use our other foundations in your designs, visit the foundations section.
+{% endfeedback %} - {% call foundations.section("Feedback") -%} -To give feedback about anything on this page, contact us.
- {%- endcall %} - - {% call foundations.section("Foundations") -%} -To learn how to use our other foundations in your designs, visit the foundations section.
- {%- endcall %} - -To learn how to use our other foundations in your designs, visit the foundations section.
+{% endfeedback %} - {% call foundations.section("Feedback") -%} -To give feedback about anything on this page, contact us.
- {%- endcall %} - {% call foundations.section("Foundations") -%} -To learn how to use our other foundations in your designs, visit the foundations section.
- {%- endcall %} - -To learn how to use our other patterns in your designs, visit the Patterns section.
- {%- endcall %} - - {% call components.section("Feedback") -%} -To give feedback about anything on this page, contact us.
- {%- endcall %} - -To learn how to use our other foundations in your designs, visit the foundations section.
+{% endfeedback %} diff --git a/docs/foundations/spacing.njk b/docs/foundations/spacing.njk index d36ba42a0d..a98e2357f2 100644 --- a/docs/foundations/spacing.njk +++ b/docs/foundations/spacing.njk @@ -531,14 +531,8 @@ tags: {%- endcall %} -To learn how to use our other foundations in your designs, visit the foundations section.
+{% endfeedback %} - {% call foundations.section("Feedback") -%} -To give feedback about anything on this page, contact us.
- {%- endcall %} - - {% call foundations.section("Foundations") -%} -To learn how to use our other foundations in your designs, visit the foundations section.
- {%- endcall %} - -To give feedback about anything on this page, contact us.
- {%- endcall %} - - {% call foundations.section("Foundations") -%} -To learn how to use our other foundations in your designs, visit the foundations section.
- {%- endcall %} - -To learn how to use our other foundations in your designs, visit the foundations section.
+{% endfeedback %} diff --git a/docs/get-started.njk b/docs/get-started.njk index 64019d92e4..f282a0d045 100644 --- a/docs/get-started.njk +++ b/docs/get-started.njk @@ -47,17 +47,9 @@ order: 0 {%- endcall %} - - -To give feedback about anything on this page, contact us.
- {%- endcall %} -Our libraries include elements, patterns, icons, and product logos to help you design Red Hat experiences.
- {%- endcall %} -Our libraries include elements, patterns, + icons, + and product logos to help you design Red Hat experiences.
+{% endfeedback %} diff --git a/docs/get-started/design-system-kit.njk b/docs/get-started/design-system-kit.njk index aed54b1554..6cb5c3012e 100644 --- a/docs/get-started/design-system-kit.njk +++ b/docs/get-started/design-system-kit.njk @@ -204,17 +204,7 @@ includeComponent: {%- endcall %} - - -To give feedback about anything on this page, contact us.
- {%- endcall %} -To learn more about our other libraries, visit this page.
- {%- endcall %} -To learn more about our other libraries, visit this page.
+{% endfeedback %} diff --git a/docs/get-started/fts-starter-kit.njk b/docs/get-started/fts-starter-kit.njk index 99ace05ed7..3f34bb2f6c 100644 --- a/docs/get-started/fts-starter-kit.njk +++ b/docs/get-started/fts-starter-kit.njk @@ -229,17 +229,8 @@ tags: {%- endcall %} - +{% feedback %} +To learn more about our other libraries, visit this page.
+{% endfeedback %} -To give feedback about anything on this page, contact us.
- {%- endcall %} -To learn more about our other libraries, visit this page.
- {%- endcall %} -To learn more about how to use icons, visit our brand standards page.
+{% endfeedback %} -To give feedback about anything on this page, contact us.
- {%- endcall %} -To learn more about how to use icons, visit our brand standards page.
- {%- endcall %} -To give feedback about anything on this page, contact us.
- {%- endcall %} -To learn more about how to use product logos, visit our brand standards page.
- {%- endcall %} -To learn more about how to use product logos, visit our brand standards page.
+{% endfeedback %} diff --git a/docs/patterns/index.md b/docs/patterns/index.md index 2af544657a..7547c6a121 100644 --- a/docs/patterns/index.md +++ b/docs/patterns/index.md @@ -48,4 +48,7 @@ create uniform, accessible experiences. To request a new element or if updates need to be made to an existing element, [contact us](mailto:digital-design-system@redhat.com). -{% include 'feedback.html' %} +{% feedback %} +To learn how to use our patterns in your designs, visit the Patterns section.
+{% endfeedback %} diff --git a/docs/prerelease-notes.njk b/docs/prerelease-notes.njk index b619920a28..44bbe923dd 100644 --- a/docs/prerelease-notes.njk +++ b/docs/prerelease-notes.njk @@ -421,13 +421,4 @@ title: Beta release notes {%- endcall %} - - -To give feedback about anything on this page, contact us.
- {%- endcall %} - {% call components.section("Design and code status") -%} -To check the design and code status of a foundation or component, visit this page.
- {%- endcall %} -To check the design and code status of a foundation or component, visit this page.
+{% endfeedback %} +