mrcrmn / docc

A starter documentation theme for Gridsome. Featuring instant search, great navigation and a dark mode!
https://docc-theme.netlify.com
MIT License
126 stars 32 forks source link

Images not showing when using external directory as content directory #29

Open Hamdy opened 3 years ago

Hamdy commented 3 years ago

Hi,

I've this case where I load markdown from an absolute path or a path that is not in project directory and there is no problem with that, all markdown is displayed correctly except images I use absolute paths for images like ![]("/home/hamdy/wikis/github/info_wiki2020/index/img/demo_site_overview.png") but images are not shown! how can I overcome this?

my config looks like

{
      use: '@gridsome/source-filesystem',
      options: {
        baseDir: '/home/hamdy/wikis/',
        path: '**/*.md',
        typeName: 'MarkdownPage',
        remark: {
          externalLinksTarget: '_blank',
          externalLinksRel: ['noopener', 'noreferrer'],
          plugins: [
            '@gridsome/remark-prismjs'
          ]
        }
      }
    },
infotexture commented 3 years ago

@Hamdy Place the images in the static/ folder and reference them like this:

![](/demo_site_overview.png)

See https://github.com/mrcrmn/docc/tree/master/static