Skip to content

Commit 7b88ec9

Browse files
add legacy warning
1 parent af00c0a commit 7b88ec9

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

scripts/legacy-warning.js

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
/* global hexo */
2+
3+
hexo.extend.filter.register('after_render:html', function (str) {
4+
const warningMessage = `
5+
<div style="text-align: center; padding: 10px; width: 100%; color: lightcoral">
6+
⚠️ This is a legacy version of the React tutorial. Please visit <a href="https://docs.meteor.com/tutorials/react/" style="color: coral">docs.meteor.com/tutorials/react</a> for the current version.
7+
</div>
8+
`;
9+
10+
return str.replace(/<div class="content">/, `<div class="content" data-injected>${warningMessage}`);
11+
});

0 commit comments

Comments
 (0)