Skip to content

Commit

Permalink
Merge pull request #665 from Klimatbyran/staging
Browse files Browse the repository at this point in the history
Release to production
  • Loading branch information
Greenheart authored Jun 24, 2024
2 parents ee58c91 + 198b494 commit 116af51
Show file tree
Hide file tree
Showing 13 changed files with 491 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
1 change: 1 addition & 0 deletions __tests__/components/CompanyView.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import StartPage from '../../pages/index'
import StyledComponentsWrapper from '../utils/StyledComponentsWrapper'

vi.mock('../../public/icons/arrow-right-bold-green.svg', () => ({ default: () => 'svg' }))
vi.mock('../../public/icons/lucide/external-link.svg', () => ({ default: () => 'svg' }))

vi.mock('next-i18next', () => ({
useTranslation: vi.fn(() => ({
Expand Down
1 change: 1 addition & 0 deletions __tests__/components/RegionalView.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ vi.mock('../../public/icons/map.svg', () => ({ default: () => 'svg' }))
vi.mock('../../public/icons/arrow.svg', () => ({ default: () => 'svg' }))
vi.mock('../../public/icons/arrow-down.svg', () => ({ default: () => 'svg' }))
vi.mock('../../public/icons/arrow-right-bold-green.svg', () => ({ default: () => 'svg' }))
vi.mock('../../public/icons/lucide/external-link.svg', () => ({ default: () => 'svg' }))

vi.mock('next-i18next', () => ({
useTranslation: vi.fn(() => ({
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 116af51

Please sign in to comment.