Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Navbar logos are not working. #772

Closed
otabekoff opened this issue Jan 21, 2023 · 5 comments · Fixed by #874
Closed

Navbar logos are not working. #772

otabekoff opened this issue Jan 21, 2023 · 5 comments · Fixed by #874
Assignees

Comments

@otabekoff
Copy link

Docus is not getting logo-dark.svg and logo-light.svg files as logo for dark and light modes. I've replaced them with my own SVG logos. But it is not working.

My header settings of app.config.ts file are like below:

    header: {
      logo: true,
      showLinkIcon: true,
      exclude: []
    },
@otabekoff
Copy link
Author

otabekoff commented Jan 21, 2023

I looked for the node_modules folder and found AppHeaderLogo.vue component in @nuxt-themes/docus/components/app directory. Then I found this:
image

In the above image, it is told that logo constant value is what the value the user set in docus.value.header?.logo. Does it equal to docus.header.logo of app.config.ts?

Ok, the next, in the NuxtLink, component tag of Vue is used.

But below it is told to use Logo.vue component with v-else-if. It is only the docus logo. Else, the title is being used with v-else-if.

Let's now look at the v-if. It is written to the <component>.

It is <component :is="logo" v-if="logo && typeof logo === 'string'" />.

What means the :is="logo" if we set logo: true in app.config.ts, then it is equal to is="true".

Also, let's look at the v-if. Let's say we set logo: "/logo.svg" in app.config.ts. Then, v-if logic will be like this: "/logo.svg" && true.

So, as a final result we will have 3 options:

  • Logo + Title
  • Logo only
  • Title only

This looks normal. But what about light mode logo and dark mode logo? Why doesn't below sytnax is not supported?

logo: {
    light: ""
    dark: ""
}

After you do some changes and make final edit. Please add more info about this in docus.dev website, please.

Additional researches:
I've set logo: "/logo.svg" also logo: "logo.svg" in the header of app.config.ts. But it doesn't work. I also have my custom logo.svg, logo-light.svg and logo-dark.svg files.

VSCode is saying logo accepts only Boolean or undefined values.
image

But it was intended to accept Boolean and string values. Do you know what is being?

@otabekoff
Copy link
Author

otabekoff commented Jan 21, 2023

If you are going to say "You should create a Logo.vue component and then use it. After that tag's is renders your Vue component as logo" as you did in AppHeaderLogo, why header.logo is not accepting string? Please, fix that. Also, it is a hard way to do it. the logo.dark and logo.light syntax is more easiest way of doing it for any user.

Also, what about removing of your Docus logo and then begin creating your docs with logo using logo.dark and logo.light syntax?

@YesidMarin
Copy link

YesidMarin commented Mar 27, 2023

Any update @bdrtsky, is this feature possible in a short time?

@bdrtsky
Copy link
Contributor

bdrtsky commented Mar 31, 2023

@YesidMarin you can check this PR if you want #874
Should be released in few days.

@YesidMarin
Copy link

@bdrtsky thank you! I will be waiting for updates!"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants