Closed dimayakovlev closed 3 years ago
I see what went wrong, v2.1.0 was an attempt to resolve an issue with root-prefixes. I'll have a fix shortly.
v2.1.1 should fix this, by making the route-sanitizing more narrow and specific to media - thus also reversing the change that broke canonical URLs.
Thank you for fix!
Tried updated version but canonical links incorrect anyway.
{{ page.url(true, true) }}
prints correct link while browse page from browser, but in static page copy there is no slash after domain name.
That should be resolved in v2.1.2, which avoids reducing route prefixes unless they match //
.
That should be resolved in v2.1.2, which avoids reducing route prefixes unless they match
//
.
Unfortunately, this causes a problem with scheme part of url. http://site.com
will be converted to http:/site.com
.
That's odd, it shouldn't be applied to domains, only routes. I'll take a look later today.
I went back to a simpler iteration, which in testing is closer to the intended function of the method that caused the carnage. Could you test v2.1.3?
Now canonical urls are correct.
I'm not tested early releases with absolute_urls
Grav option, but now I tried it. If absolute_urls: true
assets urls are incorrect:
<link rel="icon" type="image/png" href="http://localhost/user/themes/quark/images/favicon.png" />
<link rel="canonical" href="http://localhost/test/sub" />
<link href="/assets/localhost/user/plugins/form/assets/form-styles.css" type="text/css" rel="stylesheet">
<link href="/assets/localhost/user/themes/quark/css-compiled/spectre.min.css" type="text/css" rel="stylesheet">
<link href="/assets/localhost/user/themes/quark/css-compiled/theme.min.css" type="text/css" rel="stylesheet">
<link href="/assets/localhost/user/themes/quark/css/custom.css" type="text/css" rel="stylesheet">
<link href="/assets/localhost/user/themes/quark/css/line-awesome.min.css" type="text/css" rel="stylesheet">
<script src="/assets/localhost/system/assets/jquery/jquery-2.x.min.js"></script>
The plugin has no support for absolute_urls
, as that is beyond the intended use-case. The main focus for the plugin is to be able to output indices and static copies that can run domain-independent.
Plugin v.2.1.0, Grav v.1.6.27, all settings are default.
This is head of the created static version of home page
/user/data/persist/static/index.html
. There are no slashes in assets links, in link parameters and in canonical url.This is head of the created static version of typography page
/user/data/persist/static/typography/index.html
. Assets links are fine, link parameters are fine, but missing slash in canonical url after domain. Same error with canonical url on all other pages.