forked from github/docs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
59 changed files
with
727 additions
and
679 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// This middleware, exclusively in 'development' tries to spot flaws in | ||
// the content you're actively viewing. | ||
// The hopeful assumption is that if you're actively viewing this | ||
// page on localhost, you're actively working on its content. | ||
|
||
import path from 'path' | ||
|
||
import kleur from 'kleur' | ||
|
||
export default async function spotContentFlaws(req, res, next) { | ||
const { page } = req.context | ||
if (process.env.NODE_ENV === 'development' && page) { | ||
const trailingSlashRedirects = (page.redirect_from || []).filter( | ||
(uri) => uri.endsWith('/') && uri.startsWith('/') | ||
) | ||
if (trailingSlashRedirects.length > 0) { | ||
console.warn( | ||
`The page ${kleur.bold(path.relative(process.cwd(), page.fullPath))} has ${ | ||
trailingSlashRedirects.length | ||
} redirect_from entries that have a trailing slash\n ${kleur.yellow( | ||
trailingSlashRedirects.join('\n ') | ||
)}` | ||
) | ||
console.log( | ||
"If you're actively working on this page, consider", | ||
kleur.bold('deleting all trailing slashes in redirect_from.\n') | ||
) | ||
} | ||
} | ||
|
||
return next() | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 6 additions & 6 deletions
12
...cation/authenticating-users-for-your-github-enterprise-server-instance/index.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 5 additions & 5 deletions
10
...n/authenticating-users-for-your-github-enterprise-server-instance/using-ldap.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.