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

[BUG] custom-logo links are broken for child content (i.e. logo is not shown) #1147

Closed
deadratfink opened this issue Nov 19, 2021 · 0 comments
Assignees
Milestone

Comments

@deadratfink
Copy link

deadratfink commented Nov 19, 2021

Overview of the issue

The configured custom logo (on the top left) is not shown for content under Additional documentation (including child pages), Classes, Interfaces and Miscellaneous, but shown as expected on root level pages.

Examples:

  • Custom logo is shown initially
  • Clicking on Getting started: custom logo is shown
  • Clicking on README: custom logo is shown
  • Clicking on Additional documentation: custom logo is shown (and child pages menu is shown)
  • Clicking on Additional documentation => Any Child Page: logo disappears

A copy from Browser console for the compodoc-menu component shows that the relative link for the custom logo

<img alt="" class="img-responsive" data-type="custom-logo" src="images/my-logo.png">

is not correct for the current depth:

<compodoc-menu mode="normal">
        <nav>
            <ul class="list">
                <li class="title">
                    <a href="../index.html" data-type="index-link">
                        <img alt="" class="img-responsive" data-type="custom-logo" src="images/my-logo.png">
                    </a>
                </li>

                <li class="divider"></li>
                <div id="book-search-input" role="search"><input type="text" placeholder="Type to search"></div>
    ...
</compodoc-menu>

It should be:

<img alt="" class="img-responsive" data-type="custom-logo" src="../images/my-logo.png">

When I change the link in the Browser console to ../images/my-logo.png the logo is shown.

Prerequisites:

  • My custom logo my-logo.png is copied to ./readme/images/
  • My compodoc command as in my package.json scripts section (compodoc target: npm run compodoc):
compodoc -s -w -p tsconfig.json --theme laravel --disableTemplateTab --disableRoutesGraph --disableLifeCycleHooks --disableDomTree --disableStyleTab --hideGenerator --customLogo readme/my-logo.png --customFavicon readme/favicon.ico --includes readme --assetsFolder readme/images

NOTE: the favicon link is created correctly for child content pages:

<link rel="icon" type="image/x-icon" href="../images/favicon.ico">
Operating System, Node.js, npm, compodoc version(s)
  • macOS BigSur or Monterey (12.0.1)
  • Node.js v14, v16
  • compodoc v1.1.15
Angular configuration, a package.json file in the root folder
  • Not an Angular project, pure Node.js.
  • The package.json is in root folder as usual.
Compodoc installed globally or locally ?

Locally and is content generated by locally executed command.

If possible sourcecode of the file where it breaks

Unknown.

If possible your terminal logs before the error

Live reload enabled.

After clicking on a child page link:

Live reload enabled.
my-logo.png:1 GET http://127.0.0.1:8080/additional-documentation/images/my-logo.png 404 (Not Found)
Motivation for or Use Case

The custom logo is not shown for child content pages but should be shown for all pages (i.e. always).

Reproduce the error
  • Configure your project for a custom logo (as shown above)
  • Create any content under Additional documentation (maybe also child page structures) Classes, Interfaces or Miscellaneous in your summary.json
  • Click on any content under these topics
Related issues

None, at least I couldn't find one in open issues.

Suggest a Fix

Find the code where the custom-logo links are generated and add a ../ in front of each additional depth.

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

No branches or pull requests

2 participants