Skip to content

Conversation

@kanru
Copy link
Contributor

@kanru kanru commented Feb 25, 2025

@github-actions github-actions bot added the bug Something isn't working label Feb 25, 2025
@codecov
Copy link

codecov bot commented Feb 25, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 81.46%. Comparing base (c2525f5) to head (0370428).
Report is 17 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #354      +/-   ##
==========================================
+ Coverage   81.12%   81.46%   +0.34%     
==========================================
  Files          11       11              
  Lines         747      750       +3     
  Branches      125      124       -1     
==========================================
+ Hits          606      611       +5     
+ Misses         97       96       -1     
+ Partials       44       43       -1     
Flag Coverage Δ
unittests 81.46% <100.00%> (+0.34%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...lugin/integrations/theme_material_social_plugin.py 76.61% <100.00%> (+2.23%) ⬆️

... and 3 files with indirect coverage changes

@Guts
Copy link
Owner

Guts commented Feb 25, 2025

Hi @kanru ,

Thanks for your PR!

Sorry, CI was broken so I've fixed it in #357. Can you rebase your branch on origin/main please?

Can you also apply contributing guidelines, to make pre-commit.ci happy? I'll review it once everything is green here :).

@kanru kanru force-pushed the fix-material-social-cards branch from 571701e to 0370428 Compare February 25, 2025 22:26
@sonarqubecloud
Copy link

@kanru
Copy link
Contributor Author

kanru commented Feb 27, 2025

@Guts done!

@Guts Guts self-requested a review May 22, 2025 09:06
@Guts
Copy link
Owner

Guts commented May 22, 2025

Hey @kanru,

I'm back to this project for a piece of free time and reviewing your PR, I found out that there is still no unit tests. So I've pushed it kanru-contrib#1

Copy link
Owner

@Guts Guts left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM bu still waiting for unit tests. See kanru-contrib#1

@github-actions github-actions bot added the quality Tests, project resiliency, etc. label May 22, 2025
@sonarqubecloud
Copy link

@kanru
Copy link
Contributor Author

kanru commented May 22, 2025

Hey @kanru,

I'm back to this project for a piece of free time and reviewing your PR, I found out that there is still no unit tests. So I've pushed it kanru-contrib#1

Thanks for spending time on maintaining this project! I don't really write any python so just figuring out how to fix the issue and use the right style had already exhausted me. Thanks for writing the unit tests.

@Guts
Copy link
Owner

Guts commented May 23, 2025

Thanks @kanru. The failing test is unrelated so I'll fix it later in a future PR.
Time to merge has come!

@Guts Guts merged commit 9225d88 into Guts:main May 23, 2025
5 of 10 checks passed
Comment on lines -375 to -388
# if page is a blog post
if (
self.integration_material_blog.IS_BLOG_PLUGIN_ENABLED
and self.integration_material_blog.is_page_a_blog_post(mkdocs_page)
):
page_social_card = (
f"{mkdocs_site_url}assets/images/social/"
f"{Path(mkdocs_page.file.dest_uri).parent}.png"
)
else:
page_social_card = (
f"{mkdocs_site_url}assets/images/social/"
f"{Path(mkdocs_page.file.src_uri).with_suffix('.png')}"
)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Finally this introduced a bug with blog posts social cards.

Comment on lines +393 to +394
# As of mkdocs-material 9.6.5, social cards are always stored in the
# matching src path in the build folder, regardless of the page type.
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This assertion is wrong. To reproduce:

mkdocs build -f ./tests/fixtures/mkdocs_item_image_social_cards_blog.yml --verbose

Guts added a commit that referenced this pull request Jan 5, 2026
Guts added a commit that referenced this pull request Jan 5, 2026
Guts added a commit that referenced this pull request Jan 5, 2026
Guts added a commit that referenced this pull request Jan 5, 2026
Guts added a commit that referenced this pull request Jan 5, 2026
…g posts when diretcory URL are disabled at Mkdocs level

Bug partially fixed in #354 then reintroduced in #418
Guts added a commit that referenced this pull request Jan 5, 2026
…g posts when diretcory URL are disabled at Mkdocs level (#420)

Bug partially fixed in #354 then reintroduced in #418
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working quality Tests, project resiliency, etc.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Material social cards not working with customized social.cards_dir directory

2 participants