nue icon indicating copy to clipboard operation
nue copied to clipboard

Simple Blog Post cannot load hero image & "Invalid date"?

Open gokacinlar opened this issue 1 year ago • 4 comments

Hi. I was trying to build a simple blog with bun create nue@latest command but when I add another "blog-name.md" into the "posts" section, hero image of the post never shows up and date cannot be displayed. Its content appears but hero & date never works. Here's a preview:

hero

The content are exactly the same (its from the example blog posts I'm using that comes with Nue) with different names, one fails to work which is the file I created.

I'm in a Windows environment, running Nue in WSL2.

gokacinlar avatar Aug 08 '24 20:08 gokacinlar

Hey @gokacinlar. Do you maybe have a simple reproduction? It would probably help, to have a small repository or zip with your changes, or a short description, what exactly you modified.

Maybe you can also try to remove the generated .dist directory and rerun nue, to see if that helps.

nobkd avatar Aug 10 '24 19:08 nobkd

Hello @nobkd.

Maybe you can also try to remove the generated .dist directory and rerun nue, to see if that helps.

Unfortunately, this doesn't work. Here's the project I've been working on.

project.zip

I've changed nothing serious in .yaml files, just added a {new Date().getFullYear()} to footer.

gokacinlar avatar Aug 10 '24 20:08 gokacinlar

Hey, I found the issue. One file contains CRLF line endings, the other only LF. The file with CRLF (\r\n) line endings fails. I suspect, you copied the content of the first file to the second one, and your editor saved the new file with the Windows style line endings.

I will try to create a PR, that fixes this. For now, you'll have to ensure, your editor saves your files with LF (\n) line endings.

nobkd avatar Aug 10 '24 21:08 nobkd

Can you confirm, that if works with lf line endings?

nobkd avatar Aug 11 '24 12:08 nobkd

Hi @nobkd. I tested it this morning using Nano in WSL2 and now it works.

Screenshot 2024-08-12 2 20 49 PM

In VSCode, you can choose whether you want to use CRLF or LF in bottom bar, this also works:

Screenshot 2024-08-12 2 27 17 PM

gokacinlar avatar Aug 12 '24 11:08 gokacinlar

Good to hear. Thanks for testing :)

nobkd avatar Aug 12 '24 14:08 nobkd