Skip to content

Commit d241aff

Browse files
author
Hugues Tennier
authored
Merge branch 'next-design-iteration' into pnh/what-is-jamstack-expansion
2 parents f94ed5a + 0d80406 commit d241aff

File tree

17 files changed

+106
-35
lines changed

17 files changed

+106
-35
lines changed

.eleventy.js

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
const lodashGet = require("lodash/get");
12

23
module.exports = function(eleventyConfig) {
34

@@ -103,6 +104,36 @@ module.exports = function(eleventyConfig) {
103104
return yaml.safeDump(obj)
104105
});
105106

107+
// sort an array of objects by one object key value
108+
// can also get fancy and do a lodash.get selector string too
109+
// see https://lodash.com/docs/4.17.15#get
110+
eleventyConfig.addFilter('sortKey', (arr, selector) => {
111+
return arr.sort((a, b) => {
112+
let aKey = lodashGet(a, selector).toLowerCase();
113+
let bKey = lodashGet(b, selector).toLowerCase();
114+
if(aKey < bKey) {
115+
return -1;
116+
} else if(aKey > bKey) {
117+
return 1;
118+
}
119+
return 0;
120+
});
121+
});
122+
123+
eleventyConfig.addFilter('sortTools', (arr, githubData) => {
124+
return arr.sort((a, b) => {
125+
let aKey = githubData[a.data.repo] ? (githubData[a.data.repo].stars || 0) : 0;
126+
let bKey = githubData[b.data.repo] ? (githubData[b.data.repo].stars || 0) : 0;
127+
if(aKey < bKey) {
128+
return 1;
129+
} else if(aKey > bKey) {
130+
return -1;
131+
}
132+
return 0;
133+
});
134+
});
135+
136+
106137
// favicons files
107138
eleventyConfig.addPassthroughCopy("src/site/browserconfig.xml");
108139
eleventyConfig.addPassthroughCopy("src/site/site.webmanifest");

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
"fast-glob": "^3.2.4",
2929
"gray-matter": "^4.0.2",
3030
"js-yaml": "^3.13.1",
31+
"lodash": "^4.17.20",
3132
"luxon": "^1.23.0",
3233
"markdown-it": "^11.0.1",
3334
"netlify-plugin-minify-html": "^0.2.2",

src/css/tailwind.css

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,9 @@ dd a:focus {
5454
p+p {
5555
@apply mt-4;
5656
}
57-
57+
section.cards {
58+
max-width: 66rem;
59+
}
5860

5961
/*
6062
CTA links
@@ -65,7 +67,7 @@ a.cta:visited {
6567
@apply bg-pink-900;
6668
@apply text-white;
6769
@apply rounded-full;
68-
@apply text-xs;
70+
@apply text-sm;
6971
@apply font-semibold;
7072
@apply px-4;
7173
@apply py-2;
@@ -193,17 +195,17 @@ footer p a:focus {
193195
}
194196
.list-jams-logo > li:after {
195197
background-image: url("data:image/svg+xml,%3Csvg width='8' viewBox='0 0 12 13' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M6 0C2.68226 0 0 2.90578 0 6.5C0 10.0942 2.68226 13 6 13C9.31774 13 12 10.0942 12 6.5V0H6Z' fill='%235A5F75'/%3E%3C/svg%3E%0A");
196-
left: 2em;
198+
left: 3em;
197199
}
198200
.list-jams-logo-pink > li:after {
199201
background-image: url("data:image/svg+xml,%3Csvg width='8' viewBox='0 0 12 13' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M6 0C2.68226 0 0 2.90578 0 6.5C0 10.0942 2.68226 13 6 13C9.31774 13 12 10.0942 12 6.5V0H6Z' fill='%23F0047F'/%3E%3C/svg%3E%0A");
200-
left: 1em;
202+
left: 1.5em;
201203
}
202204
.list-jams-logo-border > li:before {
203205
@apply text-gray-400;
204206
content: "";
205207
position: absolute;
206-
left: 2.25em; /* 36px /16 */
208+
left: 3.25em; /* 36px /16 */
207209
top: 0;
208210
bottom: 0;
209211
border-left: 1px solid;
@@ -260,6 +262,14 @@ details[open] .summary-swap-open {
260262
}
261263

262264
/* special text treatment on home page */
265+
.hero-text {
266+
font-size: 2.5em;
267+
}
268+
@media (min-width: 40em) { /* 640px */
269+
.hero-text {
270+
font-size: 3em; /* 48px /16 */
271+
}
272+
}
263273
@media (min-width: 64em) { /* 1024px */
264274
.hero-text {
265275
font-size: 4em; /* 64px /16 */

src/site/_data/netlify.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
const PROD_URL = "https://www.jamstack.org";
2+
3+
module.exports = {
4+
/*
5+
See also Netlify ENV variables:
6+
process.env.CONTEXT === "production" ||
7+
process.env.CONTEXT === "deploy-preview" ||
8+
process.env.CONTEXT === "branch-deploy"
9+
10+
via https://docs.netlify.com/configure-builds/environment-variables/
11+
12+
*/
13+
deployUrl: process.env.CONTEXT === "production" ? PROD_URL : process.env.DEPLOY_PRIME_URL
14+
};

src/site/_includes/components/cards.njk

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@
77
{%- elseif loopIndex % 4 === 2 %} bg-gradient-card-seafoam
88
{%- elseif loopIndex % 4 === 3 %} bg-gradient-card-gold
99
{%- endif -%}">
10+
{%- if item.data.opensource -%}
11+
<div class="text-xxs mb-2">
12+
<span class="inline-block uppercase bg-black text-white leading-5 px-2 rounded">Open Source</span>
13+
</div>
14+
{% endif %}
1015
{{ item.data.title }}
1116
</div>
1217
<div class="p-4">

src/site/_includes/components/section-heading.njk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@
1212

1313

1414
{% macro benefit(title, icon, description ) %}
15-
<div class="flex content-start space-x-8 my-12">
15+
<div class="sm:flex sm:content-start sm:space-x-8 my-12">
1616

1717
{% if icon %}
18-
<svg role="img" aria-label="{{ title }}" aria-hidden="true" focusable="false" width="60" height="60" class="flex-none mt-2">
18+
<svg role="img" aria-label="{{ title }}" aria-hidden="true" focusable="false" width="60" height="60" class="flex-none my-2">
1919
<use xlink:href="{{ icon }}"></use>
2020
</svg>
2121
{% endif %}

src/site/_includes/footer.njk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<section>
2-
<footer class="py-20 text-blue-300">
2+
<footer class="py-20 text-blue-200">
33
<ul class="text-left md:flex justify-between">
44
<li class="p-2">&copy; {{ page.date | formatDate('yyyy') }} Netlify </li>
55
<li class="p-2"><a href="https://jamstack.org/slack">Chat on Slack</a></li>

src/site/_includes/header.njk

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@
1515

1616
<header class="page-header sm:flex sm:flex-col sm:h-screen">
1717
<a href="/" class="block text-white hover:text-pink-900 mx-8 py-8">
18-
<svg role="img" aria-label="Jamstack" aria-hidden="true" focusable="false" width="163" height="31"><use xlink:href="#logo-jamstack"></use></svg>
18+
<svg role="img" aria-hidden="true" focusable="false" width="163" height="31"><use xlink:href="#logo-jamstack"></use></svg>
19+
<span class="sr-only">Jamstack</span>
1920
</a>
2021
<details open data-force-state
2122
data-force-state-closed="(max-width: 39.9375em)"
@@ -39,20 +40,19 @@
3940
{% include "navigation-links.njk" %}
4041

4142
<div>
42-
<a href="https://jamstackconf.com/" class="block p-4 my-4 bg-gradient-jams hover:bg-gradient-pink-orange font-bold text-center">Jamstack Conf</a>
43-
44-
<div class="text-center text-sm mb-4">Connect with us</div>
45-
<div class="grid grid-cols-3 divide-x divide-gray-700">
43+
<div class="text-center text-sm mb-4 text-gray-300">Connect with us</div>
44+
<div class="grid grid-cols-3 divide-x divide-gray-700 text-gray-300">
4645
<a href="https://jamstack.org/slack" target="_BLANK" rel="noopener" class="flex items-center justify-center p-4 hover:text-pink-500">
4746
<svg role="img" aria-label="Slack" focusable="false" width="30" height="30" class="fill-current"><use xlink:href="#logo-slack"></use></svg>
4847
</a>
4948
<a href="https://twitter.com/jamstackconf" target="_BLANK" rel="noopener" class="flex items-center justify-center p-4 hover:text-pink-500">
5049
<svg role="img" aria-label="Twitter" focusable="false" width="34" height="28" class="fill-current"><use xlink:href="#logo-twitter"></use></svg>
5150
</a>
52-
<a href="{{ pkg.repository.url }}" target="_BLANK" rel="noopener" class="flex items-center justify-center p-4 hover:text-pink-500">
51+
<a href="https://github.com/jamstack/jamstack.org" target="_BLANK" rel="noopener" class="flex items-center justify-center p-4 hover:text-pink-500">
5352
<svg role="img" aria-label="GitHub" focusable="false" width="36" height="36" class="fill-current"><use xlink:href="#logo-github"></use></svg>
5453
</a>
5554
</div>
55+
<a href="https://jamstackconf.com/" class="block p-4 mt-4 bg-gradient-jams hover:bg-gradient-pink-orange font-bold text-center">Jamstack Conf</a>
5656
</div>
5757
</nav>
5858
</details>

src/site/_includes/layouts/base.njk

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
---
22
title: Jamstack | JavaScript, APIs, and Markup
33
description: What is the Jamstack? Why use the Jamstack? How do I get started? Learn what the Jamstack is all about and why it's the best approach for building faster, more secure websites.
4+
ogimage: "/img/og/default-og-image.png"
45
---
6+
57
<!doctype html>
68
<html lang="en">
79
<head>
@@ -18,12 +20,12 @@ description: What is the Jamstack? Why use the Jamstack? How do I get started? L
1820
<meta property="og:url" content="https://jamstack.org/">
1921
<meta property="og:description" content="{{ description }}">
2022
<meta property="og:type" content="website">
21-
<meta property="og:image" content="">
23+
<meta property="og:image" content="{{ netlify.deployUrl }}{{ ogimage }}">
2224
<meta property="twitter:card" content="summary_large_image">
2325
<meta property="twitter:url" content="https://jamstack.org/">
2426
<meta property="twitter:title" content="{{ title }} | Jamstack">
2527
<meta property="twitter:description" content="{{ description }}">
26-
<meta property="twitter:image" content="">
28+
<meta property="twitter:image" content="{{ netlify.deployUrl }}{{ ogimage }}">
2729
</head>
2830
<body class="bg-blue-900 text-blue-100 leading-relaxed antialiased">
2931
<svg width="0" height="0" aria-hidden="true" style="position: absolute;">

src/site/_includes/layouts/tool.njk

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,10 @@ layout: layouts/base.njk
5454
{%- endif %}
5555
</dl>
5656
<dl class="inline-block mb-4">
57+
{%- if opensource %}
58+
<dt class="inline-block font-bold mr-6">Open Source</dt>
59+
<dd class="inline-block sr-only">Yes</dd>
60+
{%- endif %}
5761
{%- if language %}
5862
<dt class="inline-block font-bold">Language:</dt>
5963
<dd class="inline-block mr-6">{{ language }}</dd>

0 commit comments

Comments
 (0)