|
1 |
| -const dev = process.env.NODE_ENV !== 'production' |
| 1 | +const dev = process.env.NODE_ENV !== "production"; |
2 | 2 |
|
3 | 3 | const caseStudies = async () => {
|
4 |
| - const { devData } = await import('../helpers/dev/caseStudies.js'); |
| 4 | + const { devData } = await import("../helpers/dev/caseStudies.js"); |
5 | 5 |
|
6 |
| - // if (dev) { |
7 |
| - // return devData; |
8 |
| - // } |
| 6 | + // if (dev) { |
| 7 | + // return devData; |
| 8 | + // } |
9 | 9 |
|
10 |
| - const co2js = await fetch('https://www.thegreenwebfoundation.org/wp-json/wp/v2/posts?per_page=100&categories=43,34').then(resp => resp.json()).then(data => data.filter(item => item.categories.includes(43) && item.categories.includes(34))) |
| 10 | + const co2js = await fetch( |
| 11 | + "https://www.thegreenwebfoundation.org/wp-json/wp/v2/posts?per_page=100&categories=43,34", |
| 12 | + ) |
| 13 | + .then((resp) => resp.json()) |
| 14 | + .then((data) => |
| 15 | + data.filter( |
| 16 | + (item) => item.categories.includes(43) && item.categories.includes(34), |
| 17 | + ), |
| 18 | + ); |
11 | 19 |
|
12 |
| - // This is temporary until we've got more case studies. Since they won't all live on our website, we need to figure out a way to get them all in one place. |
13 |
| - const gaw = [ |
14 |
| - { |
15 |
| - featured_media: "https://browser-worker.fershad.workers.dev/?title=Making+this+website+respond+to+your+local+energy+grid&page=https://fershad.com/writing/making-this-website-grid-aware/", |
16 |
| - title: { |
17 |
| - rendered: "Making this website respond to your local energy grid" |
18 |
| - }, |
19 |
| - excerpt: { |
20 |
| - rendered: "Fershad Irani covers the technical steps I've taken to make this website respond to a visitor's energy grid. It also touches on the design changes that happen as a result, and the performance and energy impacts of those changes." |
21 |
| - }, |
22 |
| - link: "https://fershad.com/writing/making-this-website-grid-aware/" |
23 |
| - } |
24 |
| - ] |
| 20 | + // This is temporary until we've got more case studies. Since they won't all live on our website, we need to figure out a way to get them all in one place. |
| 21 | + const gaw = [ |
| 22 | + { |
| 23 | + featured_media: |
| 24 | + "https://branch.climateaction.tech/wp-content/uploads/2025/07/Branch-in-grid-aware-high-intensity-mode.jpg", |
| 25 | + title: { |
| 26 | + rendered: "Designing a Grid-Aware Branch", |
| 27 | + }, |
| 28 | + excerpt: { |
| 29 | + rendered: |
| 30 | + "Issue 9 of Branch arrives with a fresh site redesign. This new design builds on valuable feedback we’ve received from you, our community, and some brand-new ideas we’ve been exploring as part of Green Web Foundation’s Grid-aware Websites project.", |
| 31 | + }, |
| 32 | + link: "https://branch.climateaction.tech/issues/issue-9/designing-a-grid-aware-branch/", |
| 33 | + }, |
| 34 | + { |
| 35 | + featured_media: |
| 36 | + "https://browser-worker.fershad.workers.dev/?title=Making+this+website+respond+to+your+local+energy+grid&page=https://fershad.com/writing/making-this-website-grid-aware/", |
| 37 | + title: { |
| 38 | + rendered: "Making this website respond to your local energy grid", |
| 39 | + }, |
| 40 | + excerpt: { |
| 41 | + rendered: |
| 42 | + "Fershad Irani covers the technical steps I've taken to make this website respond to a visitor's energy grid. It also touches on the design changes that happen as a result, and the performance and energy impacts of those changes.", |
| 43 | + }, |
| 44 | + link: "https://fershad.com/writing/making-this-website-grid-aware/", |
| 45 | + }, |
| 46 | + ]; |
25 | 47 |
|
26 |
| - return {co2js, gaw}; |
27 |
| -} |
| 48 | + return { co2js, gaw }; |
| 49 | +}; |
28 | 50 |
|
29 | 51 | module.exports = caseStudies;
|
0 commit comments