Skip to content

Commit

Permalink
Merge pull request meteor#13363 from meteor/legacy-warning-v2-docs
Browse files Browse the repository at this point in the history
Add a legacy warning to the v2 docs
  • Loading branch information
denihs authored Sep 20, 2024
2 parents f465151 + 3504156 commit e544bd1
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 18 deletions.
18 changes: 0 additions & 18 deletions docs/scripts/kapa.js

This file was deleted.

35 changes: 35 additions & 0 deletions docs/scripts/legacy-warning.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/* global hexo */

hexo.extend.filter.register('after_render:html', function (str) {
const warningMessage = `
<div class="warning-banner">
<p>
⚠️ You're browsing the documentation for an old version of Meteor.js.
Check out the <a href="https://docs.meteor.com" target="_blank">v3 docs</a> and <a href="https://v3-migration-docs.meteor.com/" target="_blank">migration guide</a>.
</p>
</div>
`;

const css = `
<style>
.warning-banner {
text-align: center;
background-color: #fff3cd;
border: 1px solid #ffeeba;
color: #856404;
margin-bottom: 20px;
}
.warning-banner a {
color: #0056b3;
text-decoration: underline;
}
.warning-banner a:hover {
color: #003d82;
}
</style>
`;

const injectedContent = css + warningMessage;

return str.replace(/<div class="content">/, `<div class="content" data-injected>${injectedContent}`);
});

0 comments on commit e544bd1

Please sign in to comment.