Add SEO basics: separate EN/RU pages, sitemap, OG banner
Splits the landing page into / and /ru/ so each language can rank on its own, with hreflang links between them; boot.js/main.js now do a real navigation between the two instead of toggling text in place. Adds robots.txt and sitemap.xml, JSON-LD SoftwareApplication markup, Twitter Card tags, and a proper 1200x630 og-image.png in place of the SVG favicon for social previews. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
+12
-4
@@ -11,10 +11,11 @@
|
||||
|
||||
/* ------------------------------------------------------- the language */
|
||||
|
||||
var titleEl = document.querySelector("title");
|
||||
var description = document.querySelector('meta[name="description"]');
|
||||
var TITLE_EN = document.title;
|
||||
var TITLE_RU = "CursorLang — раскладка клавиатуры у курсора";
|
||||
var DESCRIPTION_EN = description.getAttribute("content");
|
||||
var TITLE_EN = titleEl.getAttribute("data-title-en");
|
||||
var TITLE_RU = titleEl.getAttribute("data-title-ru");
|
||||
var DESCRIPTION_EN = description.getAttribute("data-content-en");
|
||||
var DESCRIPTION_RU = description.getAttribute("data-content-ru");
|
||||
|
||||
function applyLanguage(lang) {
|
||||
@@ -44,8 +45,15 @@
|
||||
if (!button) { return; }
|
||||
|
||||
var lang = button.getAttribute("data-set-lang");
|
||||
applyLanguage(lang);
|
||||
remember("cursorlang.lang", lang);
|
||||
|
||||
// EN and RU live on separate URLs now, for search engines to rank
|
||||
// independently — switching language means a real navigation.
|
||||
var onRuPage = location.pathname.indexOf("/ru") === 0;
|
||||
if (lang === "ru" && !onRuPage) { location.href = "/ru/"; return; }
|
||||
if (lang === "en" && onRuPage) { location.href = "/"; return; }
|
||||
|
||||
applyLanguage(lang);
|
||||
});
|
||||
|
||||
/* ---------------------------------------------------------- the theme */
|
||||
|
||||
Reference in New Issue
Block a user