Skip to content
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

Example for date_time_html is a bit misleading #3

Open
rbeeger opened this issue Aug 23, 2014 · 1 comment
Open

Example for date_time_html is a bit misleading #3

rbeeger opened this issue Aug 23, 2014 · 1 comment

Comments

@rbeeger
Copy link

rbeeger commented Aug 23, 2014

The example for date_time_html suggests that whatever format I specify in date_format, this octopress plugin will parse that format and create a html with a correctly classed span for each element.

That isn't the case however. As soon as I define in _octopress.yml

date_format: "%d-%b-%Y"

the generated code looks like this

<time class='entry-date' datetime='2014-08-13T00:17:32+02:00'>
  <span class='date'>13-Aug-2014</span> 
  <span class='time'>12:17 am</span>
</time>

I actually prefer it that way, but others might be surprised by this.

@imathis
Copy link
Member

imathis commented Aug 24, 2014

Hmm I should probably include more examples. In this case, the ordinal date format is customized so that it wraps each part with a span. Since it's really just parsing this through Ruby's string-from-time parser. if you want to achieve the same, you could do something like this:

date_format: "<span class='day'>%d</span>-<span class='month'>%b</span>-<span class='year'>%Y</span>"

I'll update the example to explain this better. Thanks for the push!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants