posit-dev / product-doc-theme

Shared theme for Posit product documentation
https://docs.posit.co/
MIT License
5 stars 1 forks source link

Footer - posit icon/image is 404ing on build #11

Closed AshleyHenry15 closed 7 months ago

AshleyHenry15 commented 7 months ago

The following entries are the issue:

https://github.com/posit-dev/product-doc-theme/blob/e00b403af733618452ece5776c24bfa9d9bfd230/_extensions/posit-docs/_extension.yml#L39-L42

I added:

right:
          - text: "<img src='assets/images/posit-logo-black-TM.svg' id='navbar-right-logo'>"
            url: "https://posit.co/"

to the _extension.yml

Confirmed that the SVG does in fact exist in that directory/path. Installed extension in rstudio-pro/docs/server directory and build the docs. The icon is "broken" and I am getting a:

GET: /
  /assets/images/posit-logo-black-TM.svg (404: Not Found)

Additionally, the id='navbar-right-logo is a property in the scss file local in workbench at the moment, I may want to add that to the extension scss as well.

Without it, the icon is too big and won't display.

/* Posit logo - navbar */
#navbar-right-logo {
  width: 70px;
  min-width: 70px;
}
AshleyHenry15 commented 7 months ago

Retested after merge and it still isn't working 100% once it is in a project:

https://github.com/posit-dev/product-doc-theme/assets/31460023/6240ef11-8650-42e8-b0c6-774dc5d96294

AshleyHenry15 commented 7 months ago

I've tried adding the entire path, the path that the rest of the project is using, etc. For some reason, if something is added as text - it isn't working.

Using this path displays the footer icons in properly, but only if you are viewing the home page:

          - text: "<img src='_extensions/posit-dev/posit-docs/assets/images/posit-guide-ltmd.svg' id='footer-right-logo'>"
            href: https://docs.posit.co
          - text: "<img src='_extensions/posit-dev/posit-docs/assets/images/posit-logo-black-TM.svg' id='footer-right-posit-logo'>"
            url: "https://posit.co"

Once you nav away from the home/index page, they are broken images again

AshleyHenry15 commented 7 months ago

This seems to work:

          - text: "<img src='/_extensions/posit-dev/posit-docs/assets/images/posit-guide-ltmd.svg' id='footer-right-logo'>"
            href: https://docs.posit.co
          - text: "<img src='/_extensions/posit-dev/posit-docs/assets/images/posit-logo-black-TM.svg' id='footer-right-posit-logo'>"
            url: "https://posit.co"
AshleyHenry15 commented 7 months ago

For now, we won't need to address this since we are now adding this in the example instead of by default in the extension.