colinta / StrangeCase

It's yet another static site generator. Have you seen jekyll? hyde? Yup. Like those.
http://colinta.com/projects/StrangeCase.html
Other
49 stars 7 forks source link

extension stripping does not work #23

Closed wichert closed 12 years ago

wichert commented 12 years ago

My config.yaml looks like this:

strip_extensions: ['.html']
strip_metadata_from_name: true
strip_metadata_from_target_name: true
root_url: /new/
configurators:
  - strange_case.extensions.configurators.created_at_from_name
  - strange_case.extensions.configurators.order_from_name
  - strange_case.extensions.configurators.file_ctime
  - strange_case.extensions.configurators.file_mtime
  - strange_case.extensions.configurators.strip_extensions

at the site root I have a template which does this:

{% for article in site.articles %}
<h3><a href="{{ article.url }}">{{ article.title }}</a></h3>
{% endfor %}

The URLs generated do get a .html extension.

colinta commented 12 years ago

duh, I followed up with the statement "URLs should not be editable", and made them uneditable, even by configurators.

they are editable now, but that's a necessary evil, the trade-off being that strip_extensions should work again.

I've pushed the fix (v4.1.8), but i'm gonna write a "site" test to make sure.

On May 7, 2012, at 3:50 PM, Wichert Akkerman wrote:

My config.yaml looks like this:

strip_extensions: ['.html']
strip_metadata_from_name: true
strip_metadata_from_target_name: true
root_url: /new/
configurators:
 - strange_case.extensions.configurators.created_at_from_name
 - strange_case.extensions.configurators.order_from_name
 - strange_case.extensions.configurators.file_ctime
 - strange_case.extensions.configurators.file_mtime
 - strange_case.extensions.configurators.strip_extensions

at the site root I have a template which does this:

{% for article in site.articles %}
<h3><a href="{{ article.url }}">{{ article.title }}</a></h3>
{% endfor %}

The URLs generated do get a .html extension.


Reply to this email directly or view it on GitHub: https://github.com/colinta/StrangeCase/issues/23

colinta commented 12 years ago

test added (test_strip_extensions_site.py), test passes. let me know is your mileage varies.

wichert commented 12 years ago

That fixes URL stripping. But now the order and date are no longer stripped from the URL, but they are stripped from the generated filename.

colinta commented 12 years ago

I can't recreate this, I'll try it on your site. If you're able to recreate it in a test (see strange_case/tests/test_strip_extensions_and_meta_site.py) that would be peachy.

colinta commented 12 years ago

I thought I bumped the version number, but I was remiss. v4.1.7 has been pushed and published to PyPi.