New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix pretty permalinks in server auto #691
Conversation
👍 |
I feel like there are more tests I need to write. |
coverage looks good to me. the only thing I would do is to run it through a coverage tool and double check. |
+1 |
this will need to be updated when/if we merge #963 |
Do we care about this anymore? Seems like almost no one is interested in this functionality |
What is this and what does it have to do with server auto? |
I'm interested in it. My /blog currently hardcodes this feature, so index.html: < a href="/blog{{ post.url | remove:'.html' }}">{{ post.title }} |
@@ -202,7 +204,7 @@ def render(layouts, site_payload) | |||
def destination(dest) | |||
# The url needs to be unescaped in order to preserve the correct filename | |||
path = File.join(dest, CGI.unescape(self.url)) | |||
path = File.join(path, "index.html") if template[/\.html$/].nil? | |||
path = File.join(path, "index.html") if template[/\.html$/].nil? && self.site.permalink_style != :pretty_flat |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe the condition could be unless template.end_with?(".html") || self.site.permalink_style == :pretty_flat
, is more readable this way to me
Implementation of #219 for posts, not just pages.