From a147fb4e9e882ab75bd3a9c3b8cd1afd9f0d2aae Mon Sep 17 00:00:00 2001 From: Arthur Verschaeve Date: Sat, 3 Jan 2015 22:52:24 +0100 Subject: [PATCH] Attributions: replace contributor list by link in `/about` --- CONTRIBUTING.md | 4 --- Gruntfile.js | 79 +-------------------------------------------- page/about.md | 4 +++ page/style-guide.md | 2 +- 4 files changed, 6 insertions(+), 83 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index aeeab8e1..a7e7057f 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -83,10 +83,6 @@ For more advice on managing your fork and submitting pull requests to the jQuery Yes! Take a look at our [style guide](http://learn.jquery.com/style-guide) for more information on authoring and formatting conventions. -## How Will My Contribution Be Acknowledged? - -We will build the attribution of an article based on the git commit logs and present this information on the site. -

Getting Help

If you're struggling to get any part of the site working properly, or have any questions, we're here to help. diff --git a/Gruntfile.js b/Gruntfile.js index 0d34de5a..3a4a394b 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -40,83 +40,6 @@ function getOrderMap() { return map; } -function contributorAttribution( post, fileName, callback ) { - var contribs, - parseRE = /^(.*)<(.*)>$/; - - // Read contributors from git file information - spawnback( "git", [ - "log", - "--follow", // Trace history through file rename operations - "--diff-filter=AM", // Only consider "Add" and "Modify" operations - "--format=%aN <%aE>", - fileName - ], function( error, result ) { - if ( error ) { - return callback( error ); - } - - contribs = result.trimRight().split( /\r?\n/g ) - - // Reduce to a unique list of contributors - .filter(function( value, index, array ) { - return array.indexOf( value ) === index; - }) - - // Convert to structured objects - .map(function( contributor ) { - var matches = parseRE.exec( contributor ); - return { - name: matches[ 1 ].trim(), - email: matches[ 2 ] - }; - }) - - // Alphabetize by 'last name' (relatively crude) - .sort(function( a, b ) { - return a.name.split( " " ).pop().toLowerCase() < - b.name.split( " " ).pop().toLowerCase() ? - -1 : 1; - }); - - // Handle "legacy" content - content authored outside of the learn site - // and attributed with metadata in the file, - // push those contributors to the front of the list - if ( post.attribution ) { - post.attribution.forEach(function( contributor ) { - var contrib, matches; - - if ( contributor === "jQuery Fundamentals" ) { - contrib = { - name: "jQuery Fundamentals", - email: "github@jquery.com" - }; - } else { - matches = parseRE.exec( contributor ); - contrib = { - name: matches[ 1 ].trim(), - email: matches[ 2 ] - }; - } - - if ( post.source ) { - contrib.source = post.source; - } - - contribs.unshift( contrib ); - }); - } - - post.customFields = post.customFields || []; - post.customFields.push({ - key: "contributors", - value: JSON.stringify( contribs ) - }); - - callback( null, post ); - }); -} - jqueryContent.postPreprocessors.page = (function() { var orderMap = getOrderMap(); @@ -128,7 +51,7 @@ jqueryContent.postPreprocessors.page = (function() { post.menuOrder = menuOrder; } - contributorAttribution( post, postPath, callback ); + callback( null, post ); }; })(); diff --git a/page/about.md b/page/about.md index 770579a3..907c7aac 100644 --- a/page/about.md +++ b/page/about.md @@ -28,6 +28,10 @@ The first is Rebecca Murphey's [jQuery Fundamentals](http://jqfundamentals.com/l The second is [docs.jquery.com](http://docs.jquery.com), that erstwhile chestnut still living out its final days before it will be shut down in early 2013. Since we've moved the API documentation for jQuery Core off that domain, we needed a place that could serve a similar need – documentation (that anyone can contribute to) that gets into the "how-to" and FAQs – without clumsy barriers to entry like finding the right person to set you up with a special wiki account and forcing all authoring into a `