Skip to content

Commit

Permalink
8720 contributor links (#9101)
Browse files Browse the repository at this point in the history
* Updating maching token URL

* adding link for PHP versions

* Contributor links start

* Revert "adding link for PHP versions"

This reverts commit fb2d5fb.

* Revert "Updating maching token URL"

This reverts commit 63a93fb.

* Apply Prettier formatting

* github link

* Apply Prettier formatting

---------

Co-authored-by: Pantheon Bot <[email protected]>
  • Loading branch information
stevector and Pantheon Bot authored Feb 5, 2025
1 parent de5ab54 commit 6838844
Showing 1 changed file with 35 additions and 43 deletions.
78 changes: 35 additions & 43 deletions src/templates/contributor.js
Original file line number Diff line number Diff line change
@@ -1,50 +1,46 @@
import React from "react"
import { graphql, Link } from "gatsby"
import Layout from "../layout/layout"
import SEO from "../layout/seo"
import ContributorLink from "../components/ContributorLink"
import React from 'react';
import { graphql, Link } from 'gatsby';
import Layout from '../layout/layout';
import SEO from '../layout/seo';
import ContributorLink from '../components/ContributorLink';

import { Container, TwoItemLayout } from "@pantheon-systems/pds-toolkit-react"
import { Container, TwoItemLayout } from '@pantheon-systems/pds-toolkit-react';

const links = [
{
property: "url",
icon: "user",
property: 'url',
icon: 'user',
},
{
property: "github",
icon: "github",
property: 'github',
icon: 'github',
},
{
property: "drupal",
icon: "drupal",
property: 'drupal',
icon: 'drupal',
},
{
property: "wordpress",
icon: "wordpress",
property: 'wordpress',
icon: 'wordpress',
},
{
property: "twitter",
icon: "twitter",
property: 'twitter',
icon: 'twitter',
},
{
property: "linkedin",
icon: "linkedin",
property: 'linkedin',
icon: 'linkedin',
},
]
];

// Set container width for search and main content.
const containerWidth = "standard"
const containerWidth = 'standard';

class ContributorTemplate extends React.Component {
render() {
const contributor = this.props.data.contributorYaml
const docs =
this.props.data.allDocs != null ? this.props.data.allDocs.edges : []
let printedGuides = []
let printedOverview = []
const contributor = this.props.data.contributorYaml;

console.log(contributor)
// console.log(contributor)

return (
<Layout containerWidth={containerWidth} footerBorder>
Expand All @@ -70,11 +66,11 @@ class ContributorTemplate extends React.Component {
{links.map((link, i) => {
const url = contributor.hasOwnProperty(link.property)
? contributor[link.property]
: null
: null;
if (url !== null) {
return (
<ContributorLink key={i} url={url} icon={link.icon} />
)
);
}
})}
</div>
Expand All @@ -84,29 +80,24 @@ class ContributorTemplate extends React.Component {
slot="second-item"
className="docs-contributor__contributions"
>
<h2>Contributions</h2>
<ul className="docs-contributor__list">
{docs.map(({ node }) => {
return (
<li key={node.id}>
<Link to={`/${node.publicURL}`}>
{node.frontmatter.title}
</Link>
</li>
)
})}
</ul>
<h2>
<a
href={`https://github.com/pantheon-systems/documentation/commits?author=${contributor.yamlId}`}
>
See contributions on GitHub
</a>
</h2>
</div>
</TwoItemLayout>
</div>
</Container>
</main>
</Layout>
)
);
}
}

export default ContributorTemplate
export default ContributorTemplate;

export const pageQuery = graphql`
query ContributorById($id: String!) {
Expand Down Expand Up @@ -137,6 +128,7 @@ export const pageQuery = graphql`
id
frontmatter {
title
permalink
}
fileAbsolutePath
}
Expand All @@ -151,4 +143,4 @@ export const pageQuery = graphql`
}
}
}
`
`;

0 comments on commit 6838844

Please sign in to comment.