[SOLVED] Header and Footer of a Blog Post are not Rendered Correctly after Translation (mulilingual mode)

Hi guys,
I am trying from a few hours to translate my website into russian. I want to make it multilingual (english and russian). I followed the instructions here and I managed to translate a post and the homepage after tweaking config.toml file. However the images from the home page are not shown in the russian version. Moreover, the translated post is not rendered corectly (header and footer css is missing). The other things seem to be working correctly. Do you have any idea where the issue might be?

Please show us your code and read Requesting Help, otherwise we won’t be able to help.

Hi Martignony. I found out what causes the issue. It seems that styles.css and custom css are not loaded in the russian version. I checked the css urls that are included in header.html and i replaced the .Permalink with my website url and now it is working fine.

However, I do not think it is a good solution. Here is what I changed in header.html to make it include the css files for both languages:

<!-- Custom styles -->
	<link rel="stylesheet" href="https://yonkov.github.io/css/styles.css">
	<link rel="preload" href="https://yonkov.github.io/css/custom.css" as="style" onload="this.rel='stylesheet'">
	<noscript><link rel="stylesheet" href="https://yonkov.github.io/css/custom.css"></noscript>

Here is how it used to be, but it works only for the default (english) version of the website:

	<!-- Custom styles -->
<link rel="stylesheet" href="{{ .Permalink }}/css/styles.css">

How can i make it work using the .Permalink variable to refer the website name. Thanks for the help in advance.

Don’t use .permalink. Use instead something like this, because your CSS files aren’t localized:

1 Like