docs: Add meta tag for image preview (#988)

I think this should work. Need to deploy it to be sure as it can be
tested locally. Can be tested here.

2 things about this solution:
* All pages have a same meta tag, i.e, lancedb banner
* If needed, we can automatically use the first image of each page and
generate meta tags using the ultralytics mkdocs plugin that we did for
this purpose - https://github.com/ultralytics/mkdocs
This commit is contained in:
Ayush Chaurasia
2024-02-19 14:07:31 +05:30
committed by GitHub
parent ca6f55b160
commit b5aad2d856
2 changed files with 7 additions and 0 deletions

View File

@@ -206,6 +206,7 @@ extra_css:
extra_javascript:
- "extra_js/init_ask_ai_widget.js"
- "extra_js/meta_tag.js"
extra:
analytics:

View File

@@ -0,0 +1,6 @@
window.addEventListener('load', function() {
var meta = document.createElement('meta');
meta.setAttribute('property', 'og:image');
meta.setAttribute('content', '/assets/lancedb_and_lance.png');
document.head.appendChild(meta);
});