You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi Jeff, thank you for your lessons and your answers! How to add social share buttons to Blazor?
So far I've managed to get an active page address and sharing links.
Links are taken from: https://github.com/bradvin/social-share-urls
But I could only get index.htmltitle and meta description tag contents by using JavaScript.
This is my separate Blazor component, Social.razor:
JavaScript to get an active page title, inserted into index.html <script>window.getTitle = () => { return document.title; };</script>
JavaScript to get meta description contents, inserted into index.html:
<script>
window.getDescription = () => {
var metas = document.getElementsByTagName('meta');
for(var i in metas) {
if (typeof(metas[i].name) != 'undefined' && metas[i].name.toLowerCase() == "description") {
return encodeURIComponent(metas[i].content);
}
}
return '';
}
</script>
My question, how to get t:
PageTitle from the active page
description from <meta name="description" content="MegaSuperExcellPage"> inside HeadContent
primary image url for the active page and image dimensions?
It looks like that it is possible without JavaScript
The text was updated successfully, but these errors were encountered:
Hi Jeff, thank you for your lessons and your answers!
How to add social share buttons to Blazor?
So far I've managed to get an active page address and sharing links.
Links are taken from: https://github.com/bradvin/social-share-urls
But I could only get
index.html
title
and metadescription
tag contents by using JavaScript.This is my separate Blazor component, Social.razor:
JavaScript to get an active page title, inserted into index.html
<script>window.getTitle = () => { return document.title; };</script>
JavaScript to get meta description contents, inserted into index.html:
My question, how to get t:
PageTitle
from the active page<meta name="description" content="MegaSuperExcellPage">
insideHeadContent
It looks like that it is possible without JavaScript
The text was updated successfully, but these errors were encountered: