Skip to content

Commit

Permalink
Revert "docs: fix absolute paths in related rules shortcode to work f…
Browse files Browse the repository at this point in the history
…rom /docs (eslint#15892)"

This reverts commit 94c8d13.
  • Loading branch information
srijan-deepsource committed May 30, 2022
1 parent d0e8ff0 commit aa2289b
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions docs/.eleventy.js
Expand Up @@ -25,15 +25,6 @@ const {
module.exports = function(eleventyConfig) {
let now = new Date();

/*
* The site is loaded from /docs on eslint.org and so we need to adjust
* the path prefix so URLs are evaluated correctly.
*
* The path prefix is turned off for deploy previews so we can properly
* see changes before deployed.
*/
const pathPrefix = process.env.CONTEXT === "deploy-preview" ? "" : "/docs";

/*****************************************************************************************
* Filters
* ***************************************************************************************/
Expand Down Expand Up @@ -189,7 +180,7 @@ module.exports = function(eleventyConfig) {

rules.forEach(function(rule) {
let list_item = `<li class="related-rules__list__item">
<a href="${pathPrefix}/rules/${rule}">
<a href="/rules/${rule}">
<span>${rule}</span>
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" aria-hidden="true" focusable="false">
<path d="M5 12H19M19 12L12 5M19 12L12 19" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />
Expand Down Expand Up @@ -352,7 +343,14 @@ module.exports = function(eleventyConfig) {
return {
passthroughFileCopy: true,

pathPrefix,
/*
* The site is loaded from /docs on eslint.org and so we need to adjust
* the path prefix so URLs are evaluated correctly.
*
* The path prefix is turned off for deploy previews so we can properly
* see changes before deployed.
*/
pathPrefix: process.env.CONTEXT === "deploy-preview" ? "" : "/docs",

markdownTemplateEngine: 'njk',
dataTemplateEngine: 'njk',
Expand Down

0 comments on commit aa2289b

Please sign in to comment.