Skip to content

Commit

Permalink
[Issue 5553] [website] Add coding-guide page (apache#5594)
Browse files Browse the repository at this point in the history
* Add coding-guide page

* update config

* update contributing file
  • Loading branch information
Jennifer88huang-zz authored Nov 11, 2019
1 parent 96a9418 commit 2fbe5f5
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 1 deletion.
2 changes: 1 addition & 1 deletion site2/website/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ list of all PIPs is maintained in the Pulsar wiki at https://github.com/apache/p
## Code

To contribute code to Apache Pulsar, you’ll have to do a few administrative steps once, and then
follow the [Coding Guide](../coding_guide).
follow the [Coding Guide](../coding-guide).

### One-time Setup

Expand Down
2 changes: 2 additions & 0 deletions site2/website/core/Footer.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ class Footer extends React.Component {
const teamUrl = this.pageUrl('team', this.props.language)
const poweredByUrl = this.pageUrl('powered-by', this.props.language)
const contributingUrl = this.pageUrl('contributing', this.props.language)
const codingUrl = this.pageUrl('coding-guide', this.props.language)

const communityMenuJs = `
const community = document.querySelector("a[href='#community']").parentNode;
Expand All @@ -134,6 +135,7 @@ class Footer extends React.Component {
'<ul id="community-dropdown-items">' +
'<li><a href="${contactUrl}">Contact</a></li>' +
'<li><a href="${contributingUrl}">Contributing</a></li>' +
'<li><a href="${codingUrl}">Coding guide</a></li>' +
'<li><a href="${eventsUrl}">Events</a></li>' +
'<li><a href="${twitterUrl}" target="_blank">Twitter &#x2750</a></li>' +
'<li><a href="${wikiUrl}" target="_blank">Wiki &#x2750</a></li>' +
Expand Down
35 changes: 35 additions & 0 deletions site2/website/pages/en/coding-guide.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
const React = require('react');

const CompLibrary = require('../../core/CompLibrary');
const MarkdownBlock = CompLibrary.MarkdownBlock; /* Used to read markdown */
const Container = CompLibrary.Container;
const GridBlock = CompLibrary.GridBlock;

const CWD = process.cwd();

const siteConfig = require(`${CWD}/siteConfig.js`);

const codingGuide = require('fs').readFileSync(`${CWD}/coding-guide.md`, 'utf8')

class Coding extends React.Component {
render() {

return (
<div className="pageContainer">
<Container className="mainContainer documentContainer postContainer">
<div className="post">
<header className="postHeader">
<h1>Coding guide</h1>
<hr />
</header>
<MarkdownBlock>
{codingGuide}
</MarkdownBlock>
</div>
</Container>
</div>
);
}
}

module.exports = Coding;

0 comments on commit 2fbe5f5

Please sign in to comment.