feat: add correct link to article in new site
Thanks to the changes in electronjs.org-new we can now generate a
direct link to the exact article a user is visiting to make the
transition from one to another easier.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Rel cf657d5f30
This commit is contained in:
Родитель
16d80c174c
Коммит
7d1fa0678b
11
server.js
11
server.js
|
@ -84,6 +84,17 @@ app.use(
|
|||
referrerPolicy: false,
|
||||
})
|
||||
)
|
||||
|
||||
// Helper to generate the redirects to the right document in the new docs paths
|
||||
hbs.registerHelper('new-docs', (currentPage) => {
|
||||
// This particular page is the root for the docs in the new site
|
||||
if (!currentPage || currentPage.endsWith('tutorial/introduction')) {
|
||||
return '/docs/latest/'
|
||||
} else {
|
||||
return currentPage.replace('docs/', 'docs/latest/')
|
||||
}
|
||||
})
|
||||
|
||||
if (isProduction) {
|
||||
const jsManifest = require(path.join(
|
||||
__dirname,
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
<div class="announcement-banner-contrast">
|
||||
Want to check our <a href="/docs/latest/">beta docs site</a>? We'd love your feedback.
|
||||
Want to check our <a href="{{new-docs page.url}}">beta docs site</a>? We'd love your feedback.
|
||||
</div>
|
||||
|
|
Загрузка…
Ссылка в новой задаче