jpescador / hugo-future-imperfect

A ported theme with some extras for the Hugo static website engine
MIT License
309 stars 228 forks source link

Sometimes featuredpath get rendered wrong #139

Closed dakky closed 6 years ago

dakky commented 6 years ago

Expected Behavior

featuredpath option always gets rendered as "/img/YEAR/MONTH"

Current Behavior

Sometimes the URL for the images gets rendered wrong:

Here is a example:

<snip>
featured: "image.jpg"
featuredalt: "xxx"
featuredpath: "date"
---
</snip>

bad rendering (html source) in the post itself:

 

the preview in the "recent posts" sections looks fine:

<article class="mini-post">
   <header>
   <h3><a href="//localhost:1313/blog/2016/title/">...</a></h3>
   <time class="published" datetime='2016-08-26'>August 26, 2016</time>
   </header>
   <a href="//localhost:1313/blog/2016/title/" class="image featured">
   <img src="//localhost:1313/img/2016/08/image.jpg" alt="">
  </a>
</article>

Your Environment

Hugo Version: 0.40.2

Browser:Chrome

Desktop or Mobile: desktop

dakky commented 6 years ago

I'm closing this, as I can't reproduce this myself reliably

bjowes commented 6 years ago

Consider reopening this. I found it very reproducible on Hugo 0.51. The errors appear in the JS console which indicates that the paths were wrong. But the odd thing is that sometimes the paths seem to repair themselves on load - when inspecting the actual elements on the page, the paths are correct. Seems like some script is modifying the paths while the page is loading.

For a real world example, check out the demo page for the theme with Chrome. I get the errors every time there. https://themes.gohugo.io//theme/future-imperfect/blog/goisforlovers/

By the way - my current workaround is to avoid "date" and set the acutal path manually.