Skip to content

Commit

Permalink
Attributions: Replace contributor list by link in /about
Browse files Browse the repository at this point in the history
Fixes gh-602
Closes gh-603
  • Loading branch information
arthurvr authored and scottgonzalez committed Jan 6, 2015
1 parent 6ba9e1c commit c636c55
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 85 deletions.
4 changes: 0 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

<h2 id="getting-help">Getting Help</h2>

If you're struggling to get any part of the site working properly, or have any questions, we're here to help.
Expand Down
81 changes: 1 addition & 80 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,85 +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 ) {

// Check for a value in case this is a new file and there is no git log
return value && 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();

Expand All @@ -130,7 +51,7 @@ jqueryContent.postPreprocessors.page = (function() {
post.menuOrder = menuOrder;
}

contributorAttribution( post, postPath, callback );
callback( null, post );
};
})();

Expand Down
4 changes: 4 additions & 0 deletions page/about.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 `<textarea>`.

## Contributing

This project wouldn't have been possible without all our [awesome contributors](https://github.com/jquery/learn.jquery.com/graphs/contributors?type=a). If you feel like something on the site is open for improvements, you can contribute [on GitHub](https://github.com/jquery/learn.jquery.com). Feel free to check out [the contributing guide](contributing/) for more in-depth information.

<h2 id="beta">About the Beta</h2>

Though this resource will never truly be "done," the current version of this site should still be considered something of a preview. We still have a number of improvements we want to make to the content, user experience, and site build before we're ready to call it a "final release." At the same time, however, it's important for us to open the doors now so we can begin providing better docs to people who need them right away and spread the word about this effort. If you're interested in helping us reach the finish line, we invite you to please read more about how [you can get involved with contributing](/contributing/)!
2 changes: 1 addition & 1 deletion page/style-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Each article should have the following header (see below as some metatags are op
}</script>
```

The `source` and `attribution` properties are optional, and should be used primarily if you are importing an article from an outside source where it was published before being donated for inclusion in the learn site. You should **not** include these properties if you are adding a new article or editing an existing one, as your contribution will be acknowledged via the git commit logs.
The `source` and `attribution` properties are optional, and should be used primarily if you are importing an article from an outside source where it was published before being donated for inclusion in the learn site. You should **not** include these properties if you are writing a new article or editing an existing one.

### Code Blocks

Expand Down

0 comments on commit c636c55

Please sign in to comment.