Skip to content

Commit

Permalink
added script to redirect to main site if embedded
Browse files Browse the repository at this point in the history
  • Loading branch information
zk2f authored and dummyuser committed Nov 30, 2024
1 parent fde68e9 commit 7c9f1f0
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions docs/.vitepress/config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,18 @@ export default defineConfig({
name: 'google-site-verification',
content: 'XCq-ZTw6VJPQ7gVNEOl8u0JRqfadK7WcsJ0H598Wv9E'
}
],
// Redirect to main site if embedded in iframe
[
'script',
{},
`
(function() {
if (window.self !== window.top) {
window.top.location = window.location.href;
}
})();
`
]
],
transformHead: async (context) => generateMeta(context, meta.hostname),
Expand Down

0 comments on commit 7c9f1f0

Please sign in to comment.