-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[BUG] redirection monimpacttransport
- Loading branch information
Showing
6 changed files
with
54 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,47 @@ | ||
var shell = require('shelljs') | ||
var fs = require('fs') | ||
var shell = require("shelljs"); | ||
var fs = require("fs"); | ||
|
||
const getLastVersion = function () { | ||
let result = 'unknown' | ||
const data = fs.readFileSync('./CHANGELOG.md', 'utf8') | ||
let result = "unknown"; | ||
const data = fs.readFileSync("./CHANGELOG.md", "utf8"); | ||
// Define the regular expression pattern to match version numbers | ||
const versionPattern = /^##\s\[?(\d+\.\d+\.\d+)\]?(?:.*?)$/m | ||
const versionPattern = /^##\s\[?(\d+\.\d+\.\d+)\]?(?:.*?)$/m; | ||
|
||
// Search for version numbers in the CHANGELOG | ||
const versions = data.match(versionPattern) | ||
const versions = data.match(versionPattern); | ||
|
||
if (versions && versions.length > 1) { | ||
// The latest version will be the second match | ||
result = versions[1] | ||
console.log('Latest release version:', result) | ||
result = versions[1]; | ||
console.log("Latest release version:", result); | ||
} else { | ||
console.log('No release versions found in the CHANGELOG.') | ||
console.log("No release versions found in the CHANGELOG."); | ||
} | ||
return result | ||
} | ||
return result; | ||
}; | ||
|
||
const nextConfig = { | ||
reactStrictMode: true, | ||
compiler: { | ||
styledComponents: true, | ||
}, | ||
i18n: { | ||
locales: ['fr'], | ||
defaultLocale: 'fr', | ||
locales: ["fr"], | ||
defaultLocale: "fr", | ||
}, | ||
env: { | ||
thebuildid: | ||
getLastVersion() + '-' + shell.exec('git rev-parse --short HEAD'), | ||
customKey: 'my-value', | ||
thebuildid: getLastVersion() + "-" + shell.exec("git rev-parse --short HEAD"), | ||
customKey: "my-value", | ||
}, | ||
} | ||
async redirects() { | ||
return [ | ||
{ | ||
source: "/iframes/transport/itineraire", | ||
destination: "/button.html", | ||
permanent: false, | ||
}, | ||
]; | ||
}, | ||
}; | ||
|
||
module.exports = nextConfig | ||
module.exports = nextConfig; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<div style="display: flex; justify-content: center; align-items: center; height: 100%; font-family: Verdana"> | ||
<a | ||
target="_blank" | ||
title="Impact du transport sur le climat (ouvre le site impactCO2 dans un nouvel onglet)" | ||
href="https://impactco2.fr/transport/itineraire" | ||
style=" | ||
background-color: rgb(38, 130, 124); | ||
color: white; | ||
cursor: pointer; | ||
display: block; | ||
padding: 1rem; | ||
border-radius: 8px; | ||
text-decoration: none; | ||
text-align: center; | ||
" | ||
> | ||
Découvrir l'impact carbone du transport sur le climat | ||
</a> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters