Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion website/core/Header.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,19 @@ var React = require('React');
var slugify = require('slugify');

var Header = React.createClass({
contextTypes: {
permalink: React.PropTypes.string
},

render: function() {
var slug = slugify(this.props.toSlug || this.props.children);
var H = 'h' + this.props.level;
var base = this.context.permalink || '';
return (
<H {...this.props}>
<a className="anchor" name={slug}></a>
{this.props.children}
{' '}<a className="hash-link" href={'#' + slug}>#</a>
{' '}<a className="hash-link" href={base + '#' + slug}>#</a>
</H>
);
}
Expand Down
8 changes: 8 additions & 0 deletions website/layout/AutodocsLayout.js
Original file line number Diff line number Diff line change
Expand Up @@ -448,6 +448,14 @@ var Modal = React.createClass({
});

var Autodocs = React.createClass({
childContextTypes: {
permalink: React.PropTypes.string
},

getChildContext: function() {
return {permalink: this.props.metadata.permalink};
},

renderFullDescription: function(docs) {
if (!docs.fullDescription) {
return;
Expand Down
8 changes: 8 additions & 0 deletions website/layout/DocsLayout.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,14 @@ var React = require('React');
var Site = require('Site');

var DocsLayout = React.createClass({
childContextTypes: {
permalink: React.PropTypes.string
},

getChildContext: function() {
return {permalink: this.props.metadata.permalink};
},

render: function() {
var metadata = this.props.metadata;
var content = this.props.children;
Expand Down
8 changes: 8 additions & 0 deletions website/layout/PageLayout.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,14 @@ var Site = require('Site');
var Marked = require('Marked');

var support = React.createClass({
childContextTypes: {
permalink: React.PropTypes.string
},

getChildContext: function() {
return {permalink: this.props.metadata.permalink};
},

render: function() {
var metadata = this.props.metadata;
var content = this.props.children;
Expand Down
7 changes: 7 additions & 0 deletions website/src/react-native/support.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,13 @@ var center = require('center');
var H2 = require('H2');

var support = React.createClass({
childContextTypes: {
permalink: React.PropTypes.string
},

getChildContext: function() {
return {permalink: 'support.html'};
},
render: function() {
return (
<Site section="support" title="Support">
Expand Down