Closed Sogl closed 2 years ago
This should be fixed in the latest version.
@rhukster The same problem in latest langswitcher. Grav and plugins are up to date.
@Sogl -- AFAIK, this issue does not impact SEO. http://sitename.com/pl/metodyka
is available for trackers and listed in the sitemap. http://sitename.com/pl/metodologiya
is not listed in the sitemap and, I believe, only generated on the fly upon clicking PL in the Langswitcher section where you have RU PL
.
Also, for SEO, it is generally useful to set the canonical link in the page's frontmatter, i.e.:
routes:
canonical: '/pl/metodyka'
I understand that it would be better to have a flawlessly working Langswitcher, but until the issue is fixed the workaround ensures that the SEO setup of your site is adequate.
Question: Is metodologiya
your 'home' folder as in 01.metodologiya
? If so, then this would partly answer your question.
Please try the latest version of the 'develop' branch. I've rewritten this logic.
@rhukster The same problem using latest 3.0.1
langswitcher.
can you please put together a little test package for me? a user/config/system.yaml, plus a couple of pages that exhibit this behavior. I have tried to recreate your setup based on your description, and can't recreate the issue.
@rhukster Here
RU URL: /ru/blog/naturalnye-chisla-muzyka-kalendar-i-astrologiya-pifagora
PL URL: /pl/blog/liczby-naturalne-muzyka-kalendarz-i-astrologia-pitagorasa
I started from a fresh grav install, copied over your user/pages/blog folder and system.yaml, then installed latest langswitcher. Changed theme to quark
and loaded the site. As you can see in the video below, it's showing with the correct polish slug no matter what I do. I also added slugs for the blog.md level to make it clearer for myself (not being able to read either language).
https://user-images.githubusercontent.com/1084697/187743913-388589ee-d6f2-40dc-9539-dc82d5596ed5.mp4
Is this not what you are seeing? This is version 3.0.1 of langswitcher btw.
BTW if you have overriden the langswitcher twig, that might be your problem, you need to use the updated version from this version of langswitcher.
Is this not what you are seeing? This is version 3.0.1 of langswitcher btw.
I see my problem as before... In your video all works fine.
BTW if you have overriden the langswitcher twig, that might be your problem, you need to use the updated version from this version of langswitcher.
I don't see any langswitcher.yaml
in my template (I use inherited Typhoon):
@rhukster Can I send you full site in zip? I'm only need your email
@Sogl -- for nailing down the error:
Have you set any site wide routes or redirects?
The langswitcher.html.twig should be located in /user/plugins/langswitcher/templates/partials
.
If you have other langswitcher.html.twig
in other folders, possibly /user/themes/YOUR-THEME/templates/*
, then delete these. You would only need a copy of that file in there to preserve personal tweaks in the file when updating the plugin in the future.
Have you set any site wide routes or redirects?
In production I only have http to https redirect (Secure (HTTPS)
Admin option) + concrete URLs redirects (moved from old Wordpress to new Grav site). On my dev/localhost I use http, no redirects.
The langswitcher.html.twig should be located in /user/plugins/langswitcher/templates/partials
Just reinstalled langswitcher with the same result. All langswitcher templates is here:
If you have other langswitcher.html.twig in other folders, possibly /user/themes/YOUR-THEME/templates/*, then delete these. You would only need a copy of that file in there to preserve personal tweaks in the file when updating the plugin in the future.
I use inherited Typhoon theme and don't have any typhoon/templates/*
or my-theme/templates/*
files like langswitcher.html.twig
(checked twice).
Checked in Quark theme and all works fine. So... it's Typhoon related issue according to dynamic creation of langs menu: https://github.com/getgrav/grav-premium-issues/issues/306
Closing here.
Don't know where exactly put this issue, let it be here.
I have site with default
ru
language and additionalpl
language. All folder names (URLs) based onru
title transliteration.For example, I have
02.metodologiya
folder,http://sitename.com/ru/metodologiya
as result URL.pl
version haveslug: metodyka
andhttp://sitename.com/pl/metodyka
URL.When I use default language (
http://sitename.com/ru/metodologiya
) and switch it topl
from langswitcher menu, my URL not changed to slug, only lang (http://sitename.com/pl/metodologiya
). But when I usepl
lang (http://sitename.com/pl/metodyka
) and switch it toru
, all works fine (http://sitename.com/ru/metodologiya
).As result, I have two URLs for second language:
http://sitename.com/pl/metodologiya
http://sitename.com/pl/metodyka
I think it's not good for SEO.
How to change this behavior? Maybe there is some option in the Admin panel?