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

Feature: support material social cards plugin #217

Merged
merged 17 commits into from
Dec 16, 2023

Conversation

Guts
Copy link
Owner

@Guts Guts commented Dec 12, 2023

This PR adds logic and option to support Social Cards of Material theme out-of-the-box.

Functional

  • if a page has no image set but social cards is enabled, use the generated image as item's image
  • option to enable/disable this integration in mkdocs.plugins.rss

Before/after

Considering the RSS feed from this plugin documentation: https://guts.github.io/mkdocs-rss-plugin/integrations/

Before

<item>
  <title>Integrations</title>
  <description>&lt;h2&gt;Reference RSS feeds in HTML meta-tags&lt;/h2&gt;
&lt;p&gt;To facilitate the discovery of RSS feeds, it&#39;s recommended to add relevant meta-tags in &lt;code&gt;&amp;lt;head&amp;gt;&lt;/code&gt; section in HTML pa...&lt;/p&gt;</description>
  <link>https://guts.github.io/mkdocs-rss-plugin/integrations/?utm_source=documentation&amp;utm_medium=RSS&amp;utm_campaign=feed-syndication</link>
  <pubDate>Tue, 12 Dec 2023 11:02:08 +0100</pubDate>
  <source url="https://guts.github.io/mkdocs-rss-plugin/feed_rss_created.xml">MkDocs RSS Plugin</source>
  <guid isPermaLink="true">https://guts.github.io/mkdocs-rss-plugin/integrations/</guid>
</item>

After

<item>
    <title>Integrations</title>
    <description>
    <h2>Social Cards plugin (from Material theme)</h2> <p>Since version 1.10, the plugin integrates with the [Social Cards plugin (shipped with Material theme)](https://...</p>
    </description>
    <link>
    http://127.0.0.1:8000/mkdocs-rss-plugin/integrations/?utm_source=documentation&utm_medium=RSS&utm_campaign=feed-syndication
    </link>
    <pubDate>Tue, 12 Dec 2023 12:02:08 +0100</pubDate>
    <source url="http://127.0.0.1:8000/mkdocs-rss-plugin/feed_rss_created.xml">MkDocs RSS Plugin</source>
    <guid isPermaLink="true">
    http://127.0.0.1:8000/mkdocs-rss-plugin/integrations/
    </guid>
    <enclosure url="https://guts.github.io/mkdocs-rss-plugin/assets/images/social/integrations.png" type="image/png" length="46533"/>
</item>

See the last enclosure line.

Resources

@Guts Guts added the enhancement New feature or request label Dec 12, 2023
@Guts Guts self-assigned this Dec 12, 2023
@Guts Guts force-pushed the feature/support-material-social-cards-plugin branch from 6e404c7 to b3e03e3 Compare December 13, 2023 11:23
@Guts Guts force-pushed the feature/support-material-social-cards-plugin branch from b3e03e3 to 2aacffc Compare December 13, 2023 16:34
@github-actions github-actions bot added the documentation Improvements or additions to documentation label Dec 13, 2023
Copy link

codecov bot commented Dec 13, 2023

Codecov Report

Merging #217 (fb2d8d4) into main (27f9d54) will increase coverage by 0.51%.
Report is 10 commits behind head on main.
The diff coverage is 86.36%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #217      +/-   ##
==========================================
+ Coverage   81.92%   82.43%   +0.51%     
==========================================
  Files           9       10       +1     
  Lines         437      518      +81     
  Branches       97      108      +11     
==========================================
+ Hits          358      427      +69     
- Misses         51       58       +7     
- Partials       28       33       +5     
Files Coverage Δ
mkdocs_rss_plugin/config.py 100.00% <100.00%> (ø)
mkdocs_rss_plugin/plugin.py 94.95% <100.00%> (+0.13%) ⬆️
mkdocs_rss_plugin/util.py 72.64% <83.33%> (+0.25%) ⬆️
...lugin/integrations/theme_material_social_plugin.py 85.93% <85.93%> (ø)

@Guts Guts marked this pull request as ready for review December 14, 2023 21:18
@Guts Guts merged commit 40f628f into main Dec 16, 2023
10 checks passed
@Guts Guts deleted the feature/support-material-social-cards-plugin branch December 16, 2023 22:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant