From c6cbf8a9a93c7672e66fc25bee825b0f6184ed2c Mon Sep 17 00:00:00 2001 From: Srijan Saurav <68371686+srijan-deepsource@users.noreply.github.com> Date: Mon, 30 May 2022 16:19:26 +0530 Subject: [PATCH] Revert "chore: Refactor rule docs format (#15869)" This reverts commit f8cb53c80a6fe71fdad45a644852efa3cbac2a0a. --- docs/.eleventy.js | 2 ++ docs/src/_includes/components/docs-toc.html | 4 +-- docs/src/_includes/layouts/doc.html | 29 +-------------------- docs/src/rules/block-scoped-var.md | 8 +++--- docs/src/rules/no-ternary.md | 8 +++--- 5 files changed, 15 insertions(+), 36 deletions(-) diff --git a/docs/.eleventy.js b/docs/.eleventy.js index b9e27c8fd7b..56ce2de99f1 100644 --- a/docs/.eleventy.js +++ b/docs/.eleventy.js @@ -126,6 +126,8 @@ module.exports = function(eleventyConfig) { eleventyConfig.addNunjucksAsyncShortcode("link", async function(link) { const { body: html, url } = await got(link); const metadata = await metascraper({ html, url }); + + const encodedURL = encodeURIComponent(link); const the_url = (new URL(link)); // same as url const domain = the_url.hostname; diff --git a/docs/src/_includes/components/docs-toc.html b/docs/src/_includes/components/docs-toc.html index 20befc02d3e..94e9a6672fe 100644 --- a/docs/src/_includes/components/docs-toc.html +++ b/docs/src/_includes/components/docs-toc.html @@ -1,8 +1,8 @@ diff --git a/docs/src/_includes/layouts/doc.html b/docs/src/_includes/layouts/doc.html index b8fbd3b9847..b3f301f76ed 100644 --- a/docs/src/_includes/layouts/doc.html +++ b/docs/src/_includes/layouts/doc.html @@ -13,39 +13,12 @@ {% include 'components/docs-index.html' %} - {# Add in related rules and further reading sections to content so TOC is accurate #} - {% set all_content = content %} - {% if related_rules %} - {% set related_rules_content %} - - {% related_rules related_rules %} - {% endset %} - - {% set all_content = [all_content, related_rules_content] | join %} - {% endif %} - - {% if further_reading %} - {% set further_reading_content %} -

Further Reading

- {# async shortcodes don't work here so need to manually insert later #} - {% endset %} - - {% set all_content = [all_content, further_reading_content] | join %} - {% endif %} -

{{ title }}

{% include 'components/docs-toc.html' %} - {{ all_content | safe }} - - {# now insert the async-fetched link data if necessary #} - {% if further_reading %} - {% for url in further_reading %} - {% link url %} - {% endfor %} - {% endif %} + {{ content | safe }}