From 6bd235f3e62251d8763a552ab0042d59584de842 Mon Sep 17 00:00:00 2001 From: Darkelarious Date: Sat, 8 Mar 2025 15:56:30 +0100 Subject: Metadata and update to hotfix 4. Display thumbnails / snippets in 3rd party apps (like discord) and add map thumbnails + icons for multiple games. Minor fixes/optimisations. --- lib/MasterWebInterface/Util/Layout.pm | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'lib/MasterWebInterface/Util/Layout.pm') diff --git a/lib/MasterWebInterface/Util/Layout.pm b/lib/MasterWebInterface/Util/Layout.pm index fe7b5c5..4862f93 100755 --- a/lib/MasterWebInterface/Util/Layout.pm +++ b/lib/MasterWebInterface/Util/Layout.pm @@ -18,9 +18,18 @@ sub htmlHeader title "$o{title} :: $self->{site_name} masterserver"; Link type => 'image/x-icon', rel => 'shortcut icon', href => "/favicon.ico"; Link type => "text/css", rel => 'stylesheet', href => "/style/$self->{style}/style.css", media => "all"; + + # metadata for previews + meta property => "theme-color", content => ($self->{meta_color} // "#111111"); + meta property => "og:type", content => "website"; + meta property => "og:site_name", content => $self->{site_name}; + meta property => "og:title", content => substr($o{title},0,50); + meta property => "og:description", content => ($o{meta_desc} // ""); + meta property => "og:image", content => ($o{meta_img } // "/map/default/333networks.jpg"); + if ( $o{noindex} ) { - meta name => 'robots', content => 'noindex,nofollow,nosnippet,noodp,noarchive,noimageindex';end; + meta name => 'robots', content => 'noindex,nofollow,nosnippet,noodp,noarchive,noimageindex'; } end 'head'; -- cgit v1.2.3