Skip to content

Commit

Permalink
Merge pull request #664 from Klimatbyran/feature/add-company-report
Browse files Browse the repository at this point in the history
Feature/add company report
  • Loading branch information
Greenheart authored Jun 24, 2024
2 parents d43721a + cbb9855 commit 322c04b
Show file tree
Hide file tree
Showing 11 changed files with 489 additions and 12 deletions.
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ module.exports = {
'airbnb/hooks',
'plugin:@typescript-eslint/recommended',
'plugin:jsx-a11y/recommended',
'plugin:@next/next/recommended',
],
parser: '@typescript-eslint/parser',
parserOptions: {
Expand Down
2 changes: 1 addition & 1 deletion components/PageWrapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const WrapInner = styled.div<{ compact?: boolean }>`
`)}
@media only screen and (${devices.tablet}) {
padding: 32px 24px;
padding: 0 24px 32px;
}
`

Expand Down
22 changes: 16 additions & 6 deletions next.config.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
const { i18n } = require('./next-i18next.config')
require('dotenv').config()

// eslint-disable-next-line @typescript-eslint/no-var-requires
const withBundleAnalyzer = require('@next/bundle-analyzer')({
enabled: process.env.ANALYZE === 'true',
})

const paths = [
const datasetPaths = [
'utslappen',
'koldioxidbudgetarna',
'klimatplanerna',
Expand Down Expand Up @@ -39,10 +40,19 @@ module.exports = withBundleAnalyzer({

// Redirects configuration
async redirects() {
return paths.map((path) => ({
source: `/${path}/:slug*`,
destination: '/',
permanent: true,
}))
// Use Vercel-defined base URL by default to get the correct base URL in preview deployments too.
const baseURL = process.env.NEXT_PUBLIC_BASE_URL ?? `https://${process.env.NEXT_PUBLIC_VERCEL_URL}`
return [
...datasetPaths.map((path) => ({
source: `/${path}/:slug*`,
destination: '/',
permanent: true,
})),
{
source: '/bolagsklimatkollen',
destination: `${baseURL}/2024-06-Bolagsklimatkollen.pdf`,
permanent: false,
},
]
},
})
Loading

0 comments on commit 322c04b

Please sign in to comment.