middleman / middleman-blog

Blog Engine Extension for Middleman
https://middlemanapp.com
MIT License
326 stars 179 forks source link

Broken links with relative_links and kramdown #259

Closed Tuckie closed 9 months ago

Tuckie commented 9 years ago

I currently have a blog post with a .html.md.erb extension.

When attempting to get a link to another page:

You can access this new feature [here](/more/feature.html).

I get an incorrect link:

<p>You can access this new feature <a href="more/feature/">here</a>.</p>

But, if I also include the erb link_to helper:

You can access this new feature [here](/more/feature.html).

You can access this new feature <%= link_to('here','/more/feature.html') %>

It works just fine:

<p>You can access this new feature <a href="../../../../../more/feature/">here</a></p>
<p>You can access this new feature <a href="../../../../../more/feature/">here</a></p>

Any idea as to why markdown without a link_to doesn't work? This only acts up within blog posts.

I'm currently on middleman (3.4.0) & middleman-blog (3.5.3).

Relevant bit of my config.rb:

# Use relative URLs
set :relative_links, true
activate :relative_assets

activate :blog do |blog|
  # set options on blog
  blog.paginate = true
  blog.prefix = 'news'
  blog.sources = ':year-:month-:day-:title.html'
  blog.layout = 'news_layout'
  blog.taglink = 'tags/{tag}.html'
  blog.tag_template = 'tag.html'
  blog.month_template = 'calendar.html'
  blog.year_template = 'calendar.html'
  blog.day_template = false
  blog.publish_future_dated = true
end

activate :directory_indexes
Tuckie commented 9 years ago

I've created a reduced test case illustrating the issue here: https://github.com/Tuckie/middleman-blog-test

iwarner commented 7 years ago

Hiya will need to create some Fixtures for this - but as this is Middleman 3 I am not sure it will be top priority - have you tested this with 4 now ?

Tuckie commented 7 years ago

Looks good in 4 now; feel free to close or add some fixtures, whichever you prefer.

Thanks!