-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: improve opengraph and browser meta appearance (#332)
- Loading branch information
1 parent
5fce61f
commit 31e2041
Showing
26 changed files
with
157 additions
and
5 deletions.
There are no files selected for viewing
Binary file added
BIN
+9.03 KB
packages/components/.storybook/assets/favicon/android-icon-192x192.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
41 changes: 41 additions & 0 deletions
41
packages/components/.storybook/assets/favicon/manifest.json
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,41 @@ | ||
{ | ||
"name": "App", | ||
"icons": [ | ||
{ | ||
"src": "/android-icon-36x36.png", | ||
"sizes": "36x36", | ||
"type": "image/png", | ||
"density": "0.75" | ||
}, | ||
{ | ||
"src": "/android-icon-48x48.png", | ||
"sizes": "48x48", | ||
"type": "image/png", | ||
"density": "1.0" | ||
}, | ||
{ | ||
"src": "/android-icon-72x72.png", | ||
"sizes": "72x72", | ||
"type": "image/png", | ||
"density": "1.5" | ||
}, | ||
{ | ||
"src": "/android-icon-96x96.png", | ||
"sizes": "96x96", | ||
"type": "image/png", | ||
"density": "2.0" | ||
}, | ||
{ | ||
"src": "/android-icon-144x144.png", | ||
"sizes": "144x144", | ||
"type": "image/png", | ||
"density": "3.0" | ||
}, | ||
{ | ||
"src": "/android-icon-192x192.png", | ||
"sizes": "192x192", | ||
"type": "image/png", | ||
"density": "4.0" | ||
} | ||
] | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 +1,58 @@ | ||
<link href="./images/sds-favicon.png" rel="icon" type="image/png" /> | ||
<link rel="shortcut icon" href="./favicon/favicon.ico" /> | ||
<link rel="apple-touch-icon" sizes="57x57" href="./favicon/apple-icon-57x57.png" /> | ||
<link rel="apple-touch-icon" sizes="60x60" href="./favicon/apple-icon-60x60.png" /> | ||
<link rel="apple-touch-icon" sizes="72x72" href="./favicon/apple-icon-72x72.png" /> | ||
<link rel="apple-touch-icon" sizes="76x76" href="./favicon/apple-icon-76x76.png" /> | ||
<link rel="apple-touch-icon" sizes="114x114" href="./favicon/apple-icon-114x114.png" /> | ||
<link rel="apple-touch-icon" sizes="120x120" href="./favicon/apple-icon-120x120.png" /> | ||
<link rel="apple-touch-icon" sizes="144x144" href="./favicon/apple-icon-144x144.png" /> | ||
<link rel="apple-touch-icon" sizes="152x152" href="./favicon/apple-icon-152x152.png" /> | ||
<link rel="apple-touch-icon" sizes="180x180" href="./favicon/apple-icon-180x180.png" /> | ||
<link rel="icon" type="image/png" sizes="192x192" href="./favicon/android-icon-192x192.png" /> | ||
<link rel="icon" type="image/png" sizes="32x32" href="./favicon/favicon-32x32.png" /> | ||
<link rel="icon" type="image/png" sizes="96x96" href="./favicon/favicon-96x96.png" /> | ||
<link rel="icon" type="image/png" sizes="16x16" href="./favicon/favicon-16x16.png" /> | ||
<link rel="manifest" href="./favicon/manifest.json" /> | ||
<meta name="msapplication-TileColor" content="#ffffff" /> | ||
<meta name="msapplication-TileImage" content="./favicon/ms-icon-144x144.png" /> | ||
<meta name="theme-color" content="#ffffff" /> | ||
<meta | ||
name="description" | ||
content="Interactive documentation for Union Investment's Solid Design System, the robust foundation for Union Investment's digital presence." | ||
/> | ||
|
||
<!-- Google / Search Engine Tags --> | ||
<meta itemprop="name" content="Solid Design System by Union Investment" /> | ||
<meta | ||
itemprop="description" | ||
content="Interactive documentation for Union Investment's Solid Design System, the robust foundation for Union Investment's digital presence." | ||
/> | ||
<meta | ||
itemprop="image" | ||
content="https://solid-design-system.fe.union-investment.de/x.x.x/storybook/images/sds-signet_meta.png" | ||
/> | ||
|
||
<!-- Facebook Meta Tags --> | ||
<meta property="og:url" content="https://solid-design-system.fe.union-investment.de/x.x.x/storybook/index.html" /> | ||
<meta property="og:type" content="website" /> | ||
<meta property="og:title" content="Solid Design System by Union Investment" /> | ||
<meta | ||
property="og:description" | ||
content="Interactive documentation for Union Investment's Solid Design System, the robust foundation for Union Investment's digital presence." | ||
/> | ||
<meta | ||
property="og:image" | ||
content="https://solid-design-system.fe.union-investment.de/x.x.x/storybook/images/sds-signet_meta.png" | ||
/> | ||
|
||
<!-- Twitter Meta Tags --> | ||
<meta name="twitter:card" content="summary_large_image" /> | ||
<meta name="twitter:title" content="Solid Design System by Union Investment" /> | ||
<meta | ||
name="twitter:description" | ||
content="Interactive documentation for Union Investment's Solid Design System, the robust foundation for Union Investment's digital presence." | ||
/> | ||
<meta | ||
name="twitter:image" | ||
content="https://solid-design-system.fe.union-investment.de/x.x.x/storybook/images/sds-signet_meta.png" | ||
/> |
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
54 changes: 54 additions & 0 deletions
54
packages/components/scripts/storybook/node-modify-storybook.cjs
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,54 @@ | ||
const fs = require('fs'); | ||
const path = require('path'); | ||
|
||
/** | ||
* Change the generated browser title to "Solid Design System by Union Investment". | ||
*/ | ||
const searchDir = 'dist/storybook/sb-manager'; | ||
const searchText = 'u22C5 Storybook'; | ||
const replaceText = 'u22C5 Solid Design System by Union Investment (Storybook)'; | ||
function replaceTextInFiles(directory) { | ||
fs.readdir(directory, (err, files) => { | ||
if (err) { | ||
console.error('❌ Error reading directory:', err); | ||
return; | ||
} | ||
files.forEach(file => { | ||
const filePath = path.join(directory, file); | ||
fs.readFile(filePath, 'utf8', (err, content) => { | ||
if (err) { | ||
console.error('❌ Error reading file:', err); | ||
return; | ||
} | ||
const updatedContent = content.replace(new RegExp(searchText, 'g'), replaceText); | ||
if (updatedContent !== content) { | ||
fs.writeFile(filePath, updatedContent, 'utf8', err => { | ||
if (err) { | ||
console.error('❌ Error writing file:', err); | ||
} else { | ||
console.log(`✅ Replaced text in ${file}`); | ||
} | ||
}); | ||
} | ||
}); | ||
}); | ||
}); | ||
} | ||
replaceTextInFiles(searchDir); | ||
|
||
/** | ||
* Change the generated index.html document title to "Solid Design System by Union Investment" and remove generated favicon link to use custom tag from manager-header.html. | ||
*/ | ||
try { | ||
const filePath = '../../dist/storybook/index.html'; | ||
const document = fs.readFileSync(path.resolve(__dirname, filePath), 'utf8'); | ||
const output = document | ||
.replace(/<title>@storybook\/cli - Storybook<\/title>/, `<title>Solid Design System by Union Investment</title>`) | ||
.replace(/<link rel="icon" type="image\/svg\+xml" href=".*" \/>/, ''); | ||
fs.writeFileSync(path.resolve(__dirname, filePath), output); | ||
console.log('✅ index.html document rewrite complete.'); | ||
} catch (error) { | ||
console.log('❌ Document rewrite failed.'); | ||
console.error(error); | ||
process.exit(1); | ||
} |
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