Closed silasb closed 7 years ago
Okay, I think I figured it out. article.destination_path
can't start with a forward-slash.
Here is my change to handle the destination_path
if article.data.has_key? 'permalink'
article.destination_path = ::Middleman::Util.normalize_path article.data['permalink']
else
article.destination_path = template_path @permalink_template, article
end
Does anyone thing this is a good feature to add? I can do a formal PR with tests if needed.
Hiya
Do you know you can include
---
slug : new-path/to-post
---
In the frontmatter
This will override the blog.permalink = "{category}/{title}.html" from the config.rb.
@silasb Did my post clear this up - closing - please re-open if its still an issue.
Haven't had time to check. I'll look at it next time I get a blog post ready.
—Silas
On Thu, Mar 23, 2017 at 8:23 PM, Ian Warner notifications@github.com wrote:
Closed #328 https://github.com/middleman/middleman-blog/issues/328.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/middleman/middleman-blog/issues/328#event-1013462113, or mute the thread https://github.com/notifications/unsubscribe-auth/AACe3kBjeD4UZFyE3jx2M7IQ1ew5AHlSks5row0GgaJpZM4LMfMB .
I'm trying to get a post to have a custom URL/permalink. Lets say that I have a blog post titled "Uses" and I want it to be located at
/uses
. I know I could easily create a custom page outside the blog engine, but I want to include comments as well, which means that it makes sense to be a blog post.I've started hacking on this with custom frontmatter:
permalink: /test
for right now. I've modified some middleman-blog code to make thearticle.destination_path
equal to thepermalink
frontmatter. My sitemap looks like this:But when I click the link in the http://localhost:4567/test/ I get 404 not found. So it looks like it's not picking up the new route, but looking through the middleman-blog code I can't figure out how it works. I feel like I'm getting close, but it's not 'clicking.' Any help would be appreciated.