dynamic title tag (#10575)

* dynamic title tag

* dynamic title tag
This commit is contained in:
Nikolay Tyukaev 2022-02-22 12:05:55 +03:00 committed by GitHub
parent 4afd8667cf
commit 100fff83bf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -27,6 +27,7 @@ var wapSection = 'openvinotoolkit';
$(document).ready(function () {
createVersions();
updateTitleTag();
init_col_sections();
init_switchers();
handleSwitcherParam();
@ -44,6 +45,13 @@ function getPageUrlWithVersion(version) {
return encodeURI(newURL);
}
function updateTitleTag() {
var title = $('title');
var currentVersion = getCurrentVersion();
var newTitle = (title.text() + ' — Version(' + currentVersion + ')').replace(/\s+/g, ' ').trim();
title.text(newTitle);
}
function getCurrentVersion() {
var protocol = window.location.protocol + "//";
var index = window.location.href.indexOf(protocol);