Skip to content

Commit 8d94dba

Browse files
authored
Merge pull request #265 from carbonplan/plausible
plausible analytics
2 parents 64cf1d8 + 1f91cd8 commit 8d94dba

5 files changed

Lines changed: 13 additions & 5 deletions

File tree

components/projects/top.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ const Top = ({ data, filtered, tooltips, setTooltips }) => {
8484
data
8585
.filter((d) => filtered[d.id])
8686
.map((d) => d.metrics[1].value)
87-
.reduce((a, b) => a + b, 0)
87+
.reduce((a, b) => a + b, 0),
8888
)}
8989
</Badge>
9090
</FadeIn>

components/sidebar/brush.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ const Brush = ({ label, setBounds }) => {
3131
[0, 0],
3232
[100, 100],
3333
])
34-
.on('start brush', (e) => update(e, x, setBounds, label))
34+
.on('start brush', (e) => update(e, x, setBounds, label)),
3535
)
3636
}
3737
}, [])

pages/_app.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import { useState } from 'react'
1+
import React from 'react'
2+
import Script from 'next/script'
23
import { ThemeProvider } from 'theme-ui'
34
import '@carbonplan/components/fonts.css'
45
import '@carbonplan/components/globals.css'
@@ -7,6 +8,14 @@ import theme from '../theme'
78
const App = ({ Component, pageProps }) => {
89
return (
910
<ThemeProvider theme={theme}>
11+
{process.env.NEXT_PUBLIC_VERCEL_ENV === 'production' && (
12+
<Script
13+
strategy='lazyOnload'
14+
data-domain='carbonplan.org'
15+
data-api='https://carbonplan.org/proxy/api/event'
16+
src='https://carbonplan.org/js/script.file-downloads.outbound-links.js'
17+
/>
18+
)}
1019
<Component {...pageProps} />
1120
</ThemeProvider>
1221
)

pages/research/cdr-database/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const selectMetric = (d, name) => {
1212

1313
function Index() {
1414
const projects = collection.projects.sort((a, b) =>
15-
a.applicant.localeCompare(b.applicant)
15+
a.applicant.localeCompare(b.applicant),
1616
)
1717
const metrics = {
1818
volume: projects.map((d) => ({

scripts/build_projects.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,6 @@ def write_json(collection, output):
138138
@click.option('--output-csv', default='projects.csv', show_default=True)
139139
@click.option('--output-json', default='projects.json', show_default=True)
140140
def main(sources, output_projects, output_methods, output_numbers, output_csv, output_json):
141-
142141
projects = []
143142
metadata = get_cf_global_attrs(license='CC-BY-4.0', version=VERSION)
144143

0 commit comments

Comments
 (0)