Skip to content

Commit 135d93b

Browse files
Orta Theroxardatan
authored andcommitted
Remove 'stuff', add mobile support, some css tweaks and only allows expanding but not contracting
1 parent 7b94494 commit 135d93b

File tree

6 files changed

+57
-45
lines changed

6 files changed

+57
-45
lines changed

scripts/sort-libraries.js

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,20 @@ const getGitHubStats = async githubRepo => {
4848
publishedAt
4949
}
5050
}
51+
tags: refs(refPrefix: "refs/tags/", first: 1, orderBy: {field: TAG_COMMIT_DATE, direction: DESC}) {
52+
nodes {
53+
name
54+
target {
55+
... on Tag {
56+
target {
57+
... on Commit {
58+
pushedDate
59+
}
60+
}
61+
}
62+
}
63+
}
64+
}
5165
}
5266
}
5367
}
@@ -82,6 +96,7 @@ const getGitHubStats = async githubRepo => {
8296
}
8397
const stars = repo.stargazers.totalCount
8498
const commitHistory = repo.defaultBranchRef.target.history.edges
99+
85100
let hasCommitsInLast3Months = false;
86101
commitHistory.forEach(commit => {
87102
if (!commit.node.author.name.match(/bot/i)) {
@@ -91,10 +106,20 @@ const getGitHubStats = async githubRepo => {
91106
const formattedStars = numbro(stars).format({
92107
average: true,
93108
});
94-
let lastRelease;
109+
110+
const releases = [];
111+
if (repo.tags && repo.tags.nodes && repo.tags.nodes.length && repo.tags.nodes[0].target.target && repo.tags.nodes[0].target.target.pushedDate) {
112+
releases.push(repo.tags.nodes[0].target.target.pushedDate);
113+
}
95114
if (repo.releases && repo.releases.nodes && repo.releases.nodes.length) {
96-
lastRelease = repo.releases.nodes[0].publishedAt;
115+
releases.push(repo.releases.nodes[0].publishedAt)
97116
}
117+
if(owner.includes("graphql")) {
118+
console.log({ releases, repoName })
119+
}
120+
121+
const lastRelease = releases.filter(Boolean).sort().reverse()[0]
122+
98123
return {
99124
hasCommitsInLast3Months,
100125
stars,

src/assets/css/_css/code.less

Lines changed: 23 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,11 @@
5555
.intro-note {
5656
margin-top: 43px;
5757
display: flex;
58-
strong {
58+
p {
5959
width: 50%;
60+
margin-top: 0;
6061
margin-right: 5%;
61-
font-size: 24px;
62+
font-size: 18px;
6263
font-family: "Rubik", "Helvetica Neue", Helvetica, Arial, sans-serif;
6364
line-height: 32px;
6465
}
@@ -122,7 +123,7 @@
122123
color: #000;
123124
.article_title {
124125
text-align: left;
125-
font-size: 24px;
126+
font-size: 22px;
126127
color: #000;
127128
font-weight: bold;
128129
font-family: "Rubik", "Helvetica Neue", Helvetica, Arial, sans-serif;
@@ -133,6 +134,9 @@
133134
.language-header {
134135
display: flex;
135136
flex-direction: row;
137+
@media screen and (max-width: 600px) {
138+
flex-direction: column;
139+
}
136140
justify-content: space-between;
137141
.language-title {
138142
margin: 0 0 10px 0;
@@ -159,11 +163,17 @@
159163
.library-info {
160164
display: flex;
161165
flex-direction: row;
166+
@media screen and (max-width: 600px) {
167+
flex-direction: column;
168+
}
162169
justify-content: space-between;
163170
margin-top: 36px;
164171
margin-bottom: 40px;
165172
.library-details {
166173
width: 30%;
174+
@media screen and (max-width: 600px) {
175+
width: 100%;
176+
}
167177
.library-name {
168178
font-size: 24px;
169179
font-weight: bold;
@@ -192,18 +202,22 @@
192202
}
193203
}
194204
.library-howto {
205+
@media screen and (max-width: 600px) {
206+
width: 100%;
207+
}
195208
width: 60%;
196209
position: relative;
197210
.library-howto-content {
198211
overflow: hidden;
212+
pre.prism {
213+
margin: 1em 0;
214+
}
215+
199216
&.not-expanded {
200217
max-height: 450px;
201218
}
202-
&.expanded {
203-
max-height: none;
204-
border-bottom-style: solid;
205-
border-bottom-color: #C4C4C4;
206-
border-bottom-width: 3px;
219+
&.expanded img {
220+
display: none;
207221
}
208222
p {
209223
margin: 0;
@@ -251,10 +265,7 @@
251265
}
252266
}
253267
&.expanded {
254-
width: 100%;
255-
height: 30px;
256-
text-align: center;
257-
transform: rotate(180deg);
268+
display: none;
258269
}
259270
}
260271
}

src/components/Footer/index.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ const getLinks = (sourcePath: string): FooterLinks[] => [
3131
{ text: "Languages", href: "/code/#languages" },
3232
{ text: "Tools", href: "/code/#tools" },
3333
{ text: "Services", href: "/code/#services" },
34-
{ text: "More Stuff", href: "/code/#more-stuff" },
3534
],
3635
},
3736
{

src/content/code/more-stuff/awesome-graphql.md

Lines changed: 0 additions & 8 deletions
This file was deleted.

src/content/code/slug-map.json

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"go": "Go",
1111
"groovy": "Groovy",
1212
"haskell": "Haskell",
13-
"java-kotlin-android": "Java / Kotlin / Android",
13+
"java-kotlin-android": "Java / Kotlin",
1414
"javascript": "JavaScript",
1515
"julia": "Julia",
1616
"perl": "Perl",
@@ -21,11 +21,10 @@
2121
"rust": "Rust",
2222
"scala": "Scala",
2323
"ocaml-reason": "OCaml / Reason",
24-
"swift-objective-c-ios": "Swift / Objective-C iOS",
24+
"swift-objective-c-ios": "Swift / Objective-C",
2525
"language-support": "Language Support",
2626
"client": "Client",
2727
"server": "Server",
2828
"tools": "Tools",
29-
"services": "Services",
30-
"more-stuff": "More Stuff"
29+
"services": "Services"
3130
}

src/pages/code.tsx

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ export function buildLibraryContent(library: any, pageContext: any) {
104104
{overflown && (
105105
<div
106106
className={`library-howto-expand ${expanded ? 'expanded' : 'not-expanded'}`}
107-
onClick={() => setExpanded(!expanded)}>
107+
onClick={() => setExpanded(true)}>
108108
<img src="/img/downarrow.svg" className="library-howto-expand-anchor" />
109109
</div>
110110
)}
@@ -196,7 +196,7 @@ export function buildLanguagesContent(pageContext: any) {
196196

197197
export default ({ pageContext }: any) => {
198198
return (
199-
<Layout title="Code" className="code" pageContext={pageContext}>
199+
<Layout title="GraphQL Code Libraries, Tools and Services" className="code" pageContext={pageContext}>
200200
<div className="code-hero">
201201
<div className="code-hero-inner">
202202
<h1>Code</h1>
@@ -207,11 +207,11 @@ export default ({ pageContext }: any) => {
207207
<div className="documentationContent">
208208
<div className="inner-content">
209209
<div className="intro-note">
210-
<strong>
210+
<p>
211211
Because GraphQL is a communication pattern, there are many tools
212212
to help you get started working which support GraphQL in all
213213
sorts of languages.
214-
</strong>
214+
</p>
215215
<div className="goto-section">
216216
<p>Go to</p>
217217
<div className="sections">
@@ -224,9 +224,6 @@ export default ({ pageContext }: any) => {
224224
<AnchorLink to="#services" title="Services">
225225
<h3>Services</h3>
226226
</AnchorLink>
227-
<AnchorLink to="#more-stuff" title="More Stuff">
228-
<h3>More Stuff</h3>
229-
</AnchorLink>
230227
</div>
231228
</div>
232229
</div>
@@ -252,17 +249,6 @@ export default ({ pageContext }: any) => {
252249
</AnchorLink>
253250
</h2>
254251
{buildLibraryList(pageContext.otherLibraries.Services, pageContext)}
255-
<h2>
256-
<a className="anchor" id="more-stuff"></a>
257-
More Stuff
258-
<AnchorLink className="hash-link" to="#more-stuff">
259-
#
260-
</AnchorLink>
261-
</h2>
262-
{buildLibraryList(
263-
pageContext.otherLibraries["More Stuff"],
264-
pageContext
265-
)}
266252
</div>
267253
</div>
268254
</section>

0 commit comments

Comments
 (0)