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

Material social cards not working with customized social.cards_dir directory #319

Open
jonaharagon opened this issue Aug 20, 2024 · 5 comments
Assignees
Labels
bug Something isn't working

Comments

@jonaharagon
Copy link

assets/images/social is hardcoded at this line, so if you change the directory where social cards are stored then the cards are not detected and linked to properly:

f"assets/images/social/{Path(mkdocs_page.file.src_uri).with_suffix('.png')}"

For example this configuration would be broken:

plugins:
  social:
    cards_dir: assets/img/social
@perpil
Copy link

perpil commented Sep 11, 2024

It also doesn't seem to be using the computed location correctly when used with the material blog plugin: squidfunk/mkdocs-material#7518

If it helps, here's how mkdocs-material references the cards_dir

@Guts Guts self-assigned this Sep 12, 2024
@Guts Guts added the bug Something isn't working label Sep 12, 2024
@Guts
Copy link
Owner

Guts commented Dec 2, 2024

Hello @jonaharagon and @perpil,

Sorry for the delay, I work on this side-project from time to time, mainly when I have free time to develop, review, get paid for or have a particular need.

Which version of the plugin are you using? Because since 1.16, the integration with Material Blog has been improved: https://guts.github.io/mkdocs-rss-plugin/changelog/#1160---2024-10-24

Since you're using the Material theme, please consider using the same report workflow as described in their documentation: https://squidfunk.github.io/mkdocs-material/contributing/reporting-a-bug/

@Guts Guts assigned jonaharagon and perpil and unassigned Guts Dec 2, 2024
@perpil
Copy link

perpil commented Dec 9, 2024

Thanks for the update! Using 1.17, the repro that was attached to squidfunk/mkdocs-material#7518 seems to be working. However, when I try with my mkdocs.yml, it's looking for the social cards in the wrong place still. I'll debug further in the coming week and try and provide a new repro.

@perpil
Copy link

perpil commented Dec 15, 2024

Ok, here's a repro. It appears to be that the build directory for social cards isn't correct when use_directory_urls: false

9.5.48+insiders.4.53.14-rss-social-use_directory_urls-false.zip

I was able to make some minor edits to the code to make it work in this scenario, will see if I can make it work for all scenarios.

@Guts
Copy link
Owner

Guts commented Dec 16, 2024

Thanks @perpil for your attentive tests and following up here, really appreciated. I try to have a look before next year!

@Guts Guts assigned Guts and unassigned jonaharagon and perpil Dec 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants