Update to Version 0.55.0

#1

I try to update to version 0.55.0. Hugo doesn’t render the markdown of the homepage correctly. How can I solve the warning?

hugo server
Building sites … WARN 2019/04/09 00:16:20 Page's .Hugo is deprecated and will be removed in a future release. Use the global hugo function.

                   | DE | EN  
+------------------+----+----+
  Pages            | 21 | 21  
  Paginator pages  |  0 |  0  
  Non-page files   |  0 |  0  
  Static files     | 23 | 23  
  Processed images |  0 |  0  
  Aliases          |  0 |  0  
  Sitemaps         |  1 |  1  
  Cleaned          |  0 |  0  

Total in 68 ms
Watching for changes in /home/example/Projects/homepage/{content,layouts,themes}
Watching for config changes in /home/example/Projects/homepage/config.toml
Environment: "development"
Serving pages from memory
Running in Fast Render Mode. For full rebuilds on change: hugo server --disableFastRender
Web Server is available at http://localhost:1313/ (bind address 127.0.0.1)
Environment: "development"
Web Server is available at http://localhost:1314/ (bind address 127.0.0.1)
Press Ctrl+C to stop
0 Likes

#2

The warning has nothing to do with not rendering the home page correctly. What is it not rendering correctly?

0 Likes

#4

Yes, this is probably because of the shortcode changes – see https://gohugo.io/news/0.55.0-relnotes/ – I assumed this would break something, but we had to do this sooner or later, as it is a good thing.

0 Likes

#5

I changed in all pages of my project from

{{% divmd class="item-1 card" %}} to {{< divmd class="item-1 card" >}}

but the error is always there.

0 Likes

#6

What error?

0 Likes

#7

If it’s the above. That is a warning, not an error. It works as it should.

But you should look for the string “.Hugo” in your templates and replace it with “hugo”.

0 Likes

#8

I changed from .Hugo to hugo. The warning message is gone.

0 Likes

#9

The site doesn’t render correctly.

0 Likes

#10

I experienced the same type of not rendering. If your shortcode has something like this <div>{{ .Inner }}</div> and you are calling it with {{% myshortcode %}} [This is a link](#) {{% /myshortcode %}} than everything inside the div is not rendered. However, the same div in the normal content would not be handled by blackfriday, so I figure it is the correct behaviour of not rendering.

Both ways the news state work fine though.

0 Likes

#11

Yes, we have some examples of the same in the Hugo Docs (which needs to be fixed). The old behaviour was odd (I take the blame for that), but the new way has much less negative side-effects than positive.

You can do something like:

 <div>{{ .Inner | markdownify }}</div> 
0 Likes

#12

Thank you for the help. It works fine.

I changed from

    {{% divmd class="item-1 card" %}} to {{< divmd class="item-1 card" >}}
    <div>{{ .Inner }}</div> to <div>{{ .Inner | markdownify }}</div>
0 Likes

#13

If your shortcode is in heavy use, you can also take the “lazy approach” as I did in the Hugo docs:

That commit is backwards compatible.

0 Likes