Skip to content

Commit

Permalink
Update the language display on the homepage (prettier#5901)
Browse files Browse the repository at this point in the history
* Update the language display on the homepage

* Remove trailing slash from URLs

* HTTP → HTTPS

* Remove Python
  • Loading branch information
j-f1 authored Feb 26, 2019
1 parent 723a047 commit aec3978
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 47 deletions.
66 changes: 31 additions & 35 deletions website/data/languages.yml
Original file line number Diff line number Diff line change
@@ -1,55 +1,51 @@
- name: JavaScript
showName: false
showName: true
image: /images/languages/tools_js.svg
variants:
- "[`ES2017`](https://github.com/tc39/proposals/blob/master/finished-proposals.md)"
- "[`JSX`](https://facebook.github.io/jsx/)"
- "[`Flow`](https://flow.org/)"
- "[`TypeScript`](https://www.typescriptlang.org/)"
- "[`JSON`](http://json.org/)"
- "[JSX](https://facebook.github.io/jsx/)"
- "[Flow](https://flow.org)"
- "[TypeScript](https://www.typescriptlang.org)"
- "[JSON](https://json.org)"
- name: HTML
showName: false
showName: true
image: /images/languages/tools_html.svg
variants:
- "`HTML5`"
- "[`Vue`](https://vuejs.org/)"
- "[`Angular`](https://angular.io/)"
- "[Vue](https://vuejs.org)"
- "[Angular](https://angular.io)"
- name: CSS
showName: false
showName: true
image: /images/languages/tools_css.svg
variants:
- "`CSS3+`"
- "[`Less`](http://lesscss.org/)"
- "[`SCSS`](http://sass-lang.com)"
- "[`styled-components`](http://styled-components.com) 💅"
- "[`styled-jsx`](http://npmjs.com/styled-jsx)"
- "[Less](http://lesscss.org)"
- "[SCSS](https://sass-lang.com)"
- "[`styled-components`](https://styled-components.com) 💅"
- "[`styled-jsx`](https://npmjs.com/styled-jsx)"
- name: GraphQL
showName: false
nameLink: https://graphql.org
showName: true
image: /images/languages/tools_gql.svg
variants:
- "[`GraphQL`](http://graphql.org/)"
- "[`GraphQL Schemas`](http://graphql.org/learn/schema/)"
- "[GraphQL Schemas](https://graphql.org/learn/schema/)"
- name: Markdown
showName: false
showName: true
image: /images/languages/tools_md.svg
variants:
- "[`CommonMark`](http://commonmark.org/)"
- "[`GitHub Flavored Markdown`](https://github.github.com/gfm/)"
- "[`MDX`](https://mdxjs.com/)"
- "[CommonMark](https://commonmark.org)"
- "[GitHub-Flavored Markdown](https://github.github.com/gfm/)"
- "[MDX](https://mdxjs.com)"
- name: YAML
showName: false
nameLink: https://yaml.org
showName: true
image: /images/languages/tools_yaml.svg
variants:
- "[`YAML`](http://yaml.org/)"
- name: Work in Progress
variants: []
- name: Community Plugins
showName: true
image: /images/languages/tools_wip.svg
variants:
- "[`Elm`](https://github.com/gicentre/prettier-plugin-elm) (via [`elm-format`](https://github.com/avh4/elm-format))"
- "[`Java`](https://github.com/jhipster/prettier-java)"
- "[`PHP`](https://github.com/prettier/plugin-php)"
- "[`PostgreSQL`](https://github.com/benjie/prettier-plugin-pg-sql/)"
- "[`Python`](https://github.com/prettier/plugin-python)"
- "[`Ruby`](https://github.com/prettier/plugin-ruby)"
- "[`Swift`](https://github.com/prettier/plugin-swift)"
- "[`TOML`](https://github.com/bd82/toml-tools/tree/master/packages/prettier-plugin-toml)"
- "[Elm](https://github.com/gicentre/prettier-plugin-elm) (via [`elm-format`](https://github.com/avh4/elm-format))"
- "[Java](https://github.com/jhipster/prettier-java)"
- "[PHP](https://github.com/prettier/plugin-php)"
- "[PostgreSQL](https://github.com/benjie/prettier-plugin-pg-sql/)"
- "[Ruby](https://github.com/prettier/plugin-ruby)"
- "[Swift](https://github.com/prettier/plugin-swift)"
- "[TOML](https://github.com/bd82/toml-tools/tree/master/packages/prettier-plugin-toml)"
19 changes: 12 additions & 7 deletions website/pages/en/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ TldrSection.propTypes = {
language: PropTypes.string
};

const Language = ({ name, showName, image, variants }) => (
const Language = ({ name, nameLink, showName, image, variants }) => (
<div
className="languageCategory"
style={{
Expand All @@ -122,19 +122,24 @@ const Language = ({ name, showName, image, variants }) => (
}}
>
<img src={image} style={{ width: "50px", padding: "0 20px" }} />
<div>
{showName && <p className="accented">{name}</p>}
<ul>
{showName && (
<li className="accented">
{nameLink ? <a href={nameLink}>{name}</a> : name}
</li>
)}
{variants.map(variant => (
<div key={variant}>
<li key={variant}>
<MarkdownBlock>{variant}</MarkdownBlock>
</div>
</li>
))}
</div>
</ul>
</div>
);

Language.propTypes = {
name: PropTypes.string,
nameLink: PropTypes.string,
showName: PropTypes.bool,
image: PropTypes.string,
variants: PropTypes.array
Expand All @@ -149,7 +154,7 @@ const LanguagesSection = () => {
last.length < 2 &&
last.reduce((sum, lang) => sum + lang.variants.length, 0) +
language.variants.length <
5
9
) {
last.push(language);
} else {
Expand Down
18 changes: 13 additions & 5 deletions website/static/overrides.css
Original file line number Diff line number Diff line change
Expand Up @@ -148,17 +148,25 @@ em {
vertical-align: sub;
}

.languagesSection h2 {
.languagesSection h2,
.languagesSection .accented,
.languagesSection .accented a {
color: #c596c7 !important;
}

.languagesSection .accented {
color: #c596c7 !important;
.languagesSection .languageCategory ul {
margin: 0;
padding: 0;
list-style-type: none;
}

.languagesSection .languageCategory p {
.languagesSection .languageCategory p,
.languagesSection .languageCategory a {
font-size: 1rem;
padding: 0;
}
.languagesSection .languageCategory code {
font-size: 0.8rem;
}

.editorSupportSection h2 {
color: #5ab3b3 !important;
Expand Down

0 comments on commit aec3978

Please sign in to comment.