Neoteroi / mkdocs-plugins

Plugins for MkDocs.
MIT License
116 stars 9 forks source link

Links in Cards #53

Closed carried-away closed 6 months ago

carried-away commented 6 months ago

Hello,

Using your example in https://www.neoteroi.dev/mkdocs-plugins/cards/#options, I'm not able to get the cards to generate the link.

Here is what I have in the markdown file

- title: Zeus
  content: |
    Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor
    incididunt ut labore et dolore magna aliqua.
  image: ./img/icons/001-zeus.png
  url: https://en.wikipedia.org/wiki/Zeus

i know i do not have the image, so i expect that to 404, but when i hover over the card, it displays the path to the image. When clicked, it tries to open the image in a preview as opposed to the wikipedia link. I even tried using an image i do have and tried with the image property removed altogether.

When I check dev options, i do see the 'a href' element wrapping the nt-card class, but it doesn't manifest on the page.

RobertoPrevato commented 6 months ago

Hi, I cannot reproduce the issue you describe. I took this screenshot using the latest version of Material for MkDocs and documentation site for my plugins:

image

Doesn´t matter if a picture of a card can be found or not, the card renders properly with an anchor tag to the configured URL.

carried-away commented 6 months ago

Thanks for your time! I think I see the problem, just not sure what could be causing it.

The link shows its nested three times in a single nt-card class.

3

I commented out all of my mkdocs extenstions as I thought something was conflicting. But even with just 'neoteroi.cards' active, it still produces the same triplicate output.

RobertoPrevato commented 6 months ago

That's weird 👀 Can you please share your markdown and versions of dependencies so I can try to replicate the issue?

carried-away commented 6 months ago

Sure! I'm on mkdocs-material-9.5.3 and I'm using neoteroi-mkdocs 1.0.4.

The markdown is

::cards::

- title: ChatBot
  content: Lorem ipsum dolor sit amet.
  image: ./icons/032-chatbot.png
  url: https://en.wikipedia.org/wiki/Zeus

::/cards::

If you were referring to python dependencies, I'm not sure how to get that. I'm using a custom mkdocs-material docker image thats setup to sync with the latest official image, and pulls the plugins via PIP everytime there's a new release --

pip install --no-cache-dir neoteroi-mkdocs \ more plugins\

That build pipeline is hidden from me. I apologize for being annoying.

RobertoPrevato commented 6 months ago

No worries @carried-away, you are not annoying. And thanks, I meant the versions of dependencies you are using, the two you gave are perfect. I tried replicating your issue with the same version of libraries (when I tried previously I only had a small difference in material for mkdocs because I was using the previous version), and I cannot reproduce the issue. The only difference is that I am not using the custom mkdocs-material docker image. I cannot really think of something in the source code of my library that might cause this issue.

carried-away commented 6 months ago

Thank you for checking. I really appreciate your time especially so close to the holidays.

I was able to get the link property to work by using the 'image-bg' option, but it jacks up the icon image.

image

So I'll see if I can follow the logic and see what in my environment is messing it up. Thank you again and Merry Christmas!

RobertoPrevato commented 6 months ago

Thank You, @carried-away I wish the same to you, Merry Christmas!