Jekyll - Errors with paths

Asked

Viewed 21 times

0

I’m developing a blog in Jekyll and is making some mistakes with the URL’s.

When I use {{ site.url }} and I don’t put the bar after this variable, the paths are as follows: localhost:4000assets, only when I compile the production version, the paths are right:

Examples of how I used variables:

{% for post in paginator.posts  %}
  <h2>
    <a href="{{site.url}}{{ post.url |  slugify}}">{{ post.title }}</a>
  </h2>
{% endfor %}

Example of how it looks:

Another question related to that, is that I downloaded a plugin that generates the sitemap.xml and robots.txt and uses the site.url for their creation. However, the paths are coming out in the format: http://www.brunofolle.com.br//contato

Robots.txt and sitemap.xml link:

This is the settings of URL in the _config.yml:

url: "http://www.brunofolle.com.br/"
baseurl: "/" 
permalink: /:title/

I tried to take the bar off the base URL, and the start bar of permalink but did not resolve.

Does anyone have any idea?

1 answer

0

I will answer my question because I was able to solve... In case other people have the same problem, maybe this answer will help them.

Well, in the {{ post.url | slugify}} I pulled the slugify, leaving it that way: {{ post.url }}.

And the _config.yml was like this:

url: "https://brunofolle.com.br"
baseurl: "/" 
permalink: /:title/

Browser other questions tagged

You are not signed in. Login or sign up in order to post.