Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rebuild hyperlink #2382

Merged
merged 41 commits into from
Aug 3, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
b6fedfa
Update link checking to use latest hyperlink. Replaces #1582
Munter Jul 23, 2018
d0f9ed5
Stop appending empty fragment to urls pointing ad no fragment identifier
Munter Jul 23, 2018
b70a775
Resolve relative hrefs from README's to their github.com url instead …
Munter Jul 25, 2018
958c136
Prefer https where available and also use https in examples
Munter Jul 25, 2018
fa437ea
Make non-fragment links inside headings visible
Munter Jul 25, 2018
63ae0bd
Update webpack docs china link
Munter Jul 25, 2018
00e8fbc
Fixed invalid edit links to index pages
Munter Jul 25, 2018
a317676
skip fragment check for vimdoc that is known to fail
Munter Jul 25, 2018
12dccb7
Fix broken link to migration guide from configuration/resolve
Munter Jul 25, 2018
de51fb0
Also resolve github README relative links when they don't start with …
Munter Jul 25, 2018
42b9d84
Add missing pages: Vote, Organization, Starter kits
Munter Jul 25, 2018
adcd3bd
Remove unused code
Munter Jul 25, 2018
422e7fa
Fix link that was redirected
Munter Jul 25, 2018
f400cd2
Open all target='_blank' links with rel='noopener' for security
Munter Jul 25, 2018
1c3ee46
Skip link checking img.shields.io
Munter Jul 25, 2018
fc4e876
Change order of markdown url rewriting to avoid errors
Munter Jul 25, 2018
b363414
Use lowercase variable name for node url module. See https://github.c…
Munter Jul 25, 2018
bd227a8
Update link to file-loader github repo
Munter Jul 26, 2018
ade9cb7
Rewrite links from https://npmjs.com to https://www.npmjs.com to avoi…
Munter Jul 26, 2018
1a19c2d
Skip checking links to npmjs.com/package that causes hyperlink to get…
Munter Jul 26, 2018
071407e
Updated organization projects urls to their redirect target
Munter Jul 26, 2018
73dec22
Update tool-list to get correct links for projects
Munter Jul 26, 2018
73779f7
Updated links to their redirect target
Munter Jul 26, 2018
43967dd
Remove jscs-loader. The project is deprecated, merged with eslint and…
Munter Jul 26, 2018
a8c6872
Update link to karma-webpack project
Munter Jul 26, 2018
076dd73
Remove link to named-modules-plugin, which is now in webpack core
Munter Jul 26, 2018
2ef4cb9
Added missing mini-css-extract-plugin to fetch script
Munter Jul 26, 2018
4932f17
Skip checking links to known deleted github users
Munter Jul 26, 2018
3ddaa42
Update broken fragments to work with new markdown generator
Munter Jul 26, 2018
2438e5b
Fixed more broken links
Munter Jul 27, 2018
710188c
Merge branch 'rebuild' into rebuild-hyperlink
montogeek Jul 27, 2018
972de53
infra(site) Copy assets when building
montogeek Jul 27, 2018
ebede53
Update github location for css-loader
Munter Jul 27, 2018
9e8fab8
Remove dead github accounts from contributors listings
Munter Jul 27, 2018
42cb344
infra(site) Fix fetchPackages script when running locally
montogeek Jul 27, 2018
cabd893
Fix internal fragmtn links in optimization.md
Munter Jul 27, 2018
5321534
Skip link checking or opencollective.com/webpack. Massive html respon…
Munter Jul 27, 2018
7b20e07
Remove link to non-existing named-modules-plugin
Munter Jul 29, 2018
21c589f
Use new release of hyperlink
Munter Jul 29, 2018
ab6f6c1
feat(infra) Travis optimization (#2404)
Munter Aug 2, 2018
e48c836
Merge branch 'rebuild' into rebuild-hyperlink
montogeek Aug 2, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/utilities/fetch-package-files.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ function fetchPackageFiles(options, cb) {
.then(body => {
// modify README to fit page structure in site
if (body && file === 'README.md') {
body = processReadme(body);
body = processReadme(body, { source: url });
}

let title = pkg.name;
Expand Down
7 changes: 6 additions & 1 deletion src/utilities/process-readme.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
module.exports = function processREADME(body) {
const Url = require('url');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use url


module.exports = function processREADME(body, options = {}) {
return body
.replace(/[^]*?<div align="center">([^]*?)<\/div>/, (match, content) => {
let parsed = content.match(/<p>([^]*?)<\/?p>/);
Expand All @@ -11,6 +13,9 @@ module.exports = function processREADME(body) {
// Modify links to keep them within the site
.replace(/https?:\/\/github.com\/(webpack|webpack-contrib)\/([-A-za-z0-9]+-loader\/?)([)"])/g, '/loaders/$2/$3')
.replace(/https?:\/\/github.com\/(webpack|webpack-contrib)\/([-A-za-z0-9]+-plugin\/?)([)"])/g, '/plugins/$2/$3')
// Replace local github links with absolute links to the github location
// EXAMPLE: [Contributing](./.github/CONTRIBUTING.md)
.replace(/\[([^\]]*)\]\((\.[^)]+)\)/g, (markdownLink, content, href) => `[${content}](${Url.resolve(options.source, href)})`)
// Replace any <h2> with `##`
.replace(/<h2[^>]*>/g, '## ')
.replace(/<\/h2>/g, '')
Expand Down