Docz: I can't get the theme config logo config to work

Created on 23 Nov 2018  路  7Comments  路  Source: doczjs/docz

Question

Description
In the default theme README it states:

// doczrc.js
export default {
  themeConfig: {
    logo: {
      src: '/path/of/my/logo',
      width: 150
    }
  }
}

I have tried with all kind of absolute and relative paths and I can't manage to display my logo. I guess it's because it doesn't get bundled ?

My logo is located at ./src/logo.svg and my doczrc.js looks like this:

export default {
    src: "./src",
    ...
    themeConfig: {
       ...
        logo: {
            src: "./logo.svg",
            width: 150
        }
    },
};

Thank you for your help ! 馃槃

question

Most helpful comment

Got a solution 馃帀

Thanks to this comment I learnt that Docz supports a public folder, so my config now looks like this:

export default {
  src: "./src",
  public: "./src/public",
  ...
  themeConfig: {
     ...
      logo: {
          src: "/public/logo.svg",
          width: 150
      }
   },
};

It works great ! I feel like the documentation of the default theme should be updated to either a working solution without using public folder (I don't know of any) and this public folder thing should be documented in the main package.

I can't really find any page on the website where configs like public or htmlContent are documented. I would like to do it, but where should it be placed ?

All 7 comments

@enzoferey Could you try with png? If the error happens, we investigate the problem

Same for PNG...

What I don't really understand is where and how the image gets bundled. Because in the theme side it's a webpack configuration that doesn't have any image rule. It just takes the image src provided in the config and sets a <img> with it as its src attribute. That basically means later when the docs are built if the path is "./logo.png" it will try to fetch it at localhost/logo.png, and as far as I know the routes are reserved for pages, not assets (how is it supposed to find it if I create a logo.mdx for example ?).

Got a solution 馃帀

Thanks to this comment I learnt that Docz supports a public folder, so my config now looks like this:

export default {
  src: "./src",
  public: "./src/public",
  ...
  themeConfig: {
     ...
      logo: {
          src: "/public/logo.svg",
          width: 150
      }
   },
};

It works great ! I feel like the documentation of the default theme should be updated to either a working solution without using public folder (I don't know of any) and this public folder thing should be documented in the main package.

I can't really find any page on the website where configs like public or htmlContent are documented. I would like to do it, but where should it be placed ?

Hi @enzoferey, you can send us a pull request on https://github.com/pedronauck/docz-website

Hi @pedronauck !

Sure, I can do that, however I feel like there have been many recent changes on configurations that are not reflected anywhere in the docs... Is there any other way than just looking at the source code and go throughout every roadmap page to know all the configurations settings currently supported ?

For sure @enzoferey, has a description on each release with that information. You can get see on that maybe which is in the documentation and which isn't.

Seems the public folder thing is still not properly documented... I had to came here to find the solution. Any update to the documentation soon?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

brunolemos picture brunolemos  路  3Comments

tsnolan23 picture tsnolan23  路  3Comments

danburzo picture danburzo  路  3Comments

w0wka91 picture w0wka91  路  3Comments

wldcordeiro picture wldcordeiro  路  3Comments