DEV Community

Discussion on: Build a static generated blog with Nuxt v2.13.0 and @nuxt/content

Collapse
 
muhaddimu profile image
Muhaddis • Edited

I am not getting any errors in the console. Even though, I have tried to console.log(error)in the catch block.

For some reasons, the same code is working in the Vue slug.vue Component but not inside the Markdown files. Tried console logging the parameters before the return, it's showing the correct path but the image is not displaying.

Tried this approach, it's working fine:

 imgSrc() {
      try {
        return require(`~/content${this.src}`)
      } catch (error) {
        return null
      }
    }

See: github.com/MuhaddiMu/Portfolio/blo...

Now I have to pass the complete path relevant path /blog/slug-here/images/Featured.png

Fixed the typo in the comment. Is capital file name really matters?