Coder Social home page Coder Social logo

Comments (7)

noahcampbell avatar noahcampbell commented on May 19, 2024

Can you provide the front matter you're using?

What format is that in? I would expect a 'T' between the date and time.

from hugo.

arsatiki avatar arsatiki commented on May 19, 2024

This doesn't work:

---
title: Lisää kiinalaista shakkia
date: 2010-05-14 01:56:52+08:00
---

Neither does it work with T.
---
title: Kiinalaista nappulaa
date: 2010-05-02T15:29:31+08:00
---

But without a time it does work.

---
title: Hei maailma
date: 2010-04-26
---

The format is sort of ISO 8601, although with a space instead of T. Before today I thought the standard allows space instead of T, but now I can't find the reference to that anywhere. So it actually might not. No biggie, I can use T, although it is slightly less human-friendly. Many implementations however, allow a space there, it seems.

from hugo.

noahcampbell avatar noahcampbell commented on May 19, 2024

I have a fix for this, but I'm sorting out some challenges with the golang support for timezones. The fix hasn't been merged into master yet.

I can investigate allowing a "missing T" parser too...but it'll require some more testing.

I'm actually curious how you'd like to see a date parsing error be reported.

from hugo.

arsatiki avatar arsatiki commented on May 19, 2024

All right. I took a look at RFC 3339 and this is what it says about the separator:

NOTE: Per [ABNF] and ISO8601, the "T" and "Z" characters in this
syntax may alternatively be lower case "t" or "z" respectively. […]
Applications that generate this format SHOULD use
upper case letters.

Also, about space:

NOTE: ISO 8601 defines date and time separated by "T".
Applications using this syntax may choose, for the sake of
readability, to specify a full-date and full-time separated by
(say) a space character.

So allowing or not allowing a space or lower-case t is actually your call. As an end-user I'd very much like that since it's easier on the eyes, but your call.

from hugo.

arsatiki avatar arsatiki commented on May 19, 2024

Excellent news, Noah! Thank you very much.

Other parsing errors, such as not having quotes around a title that contains colons seem to simply kill hugo. This is somewhat depressing when I'm running it in server mode...

Perhaps I'm too Unix-spoiled, but a single line per file to stderr seems about right.

from hugo.

PerpetualBeta avatar PerpetualBeta commented on May 19, 2024

It would be nice to be able to control the output format of .Date, for example: http://www.php.net/manual/en/function.date.php

Also, when outputting the .Date variable the "+" before the timezone delta is HTML-entity encoded. I don't think this is appropriate. It can cause problems, for example, when printed inside <time datetime=""> and then that field is subsequently parsed (by JavaScript…)

from hugo.

github-actions avatar github-actions commented on May 19, 2024

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

from hugo.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.