Skip to content

fix: embedded shortcodes not being loaded when no shortcodes directory exists#339

Merged
rochacbruno merged 1 commit intomainfrom
fix/embedded-shortcodes-issue-338
Aug 16, 2025
Merged

fix: embedded shortcodes not being loaded when no shortcodes directory exists#339
rochacbruno merged 1 commit intomainfrom
fix/embedded-shortcodes-issue-338

Conversation

@rochacbruno
Copy link
Copy Markdown
Owner

Summary

This PR fixes issue #338 where embedded/built-in shortcodes were not being loaded when a site didn't have a shortcodes directory.

Problem

When users ran marmite myblog --shortcodes on a site without a shortcodes directory, the list of available shortcodes was empty. Additionally, embedded shortcodes like <!-- .youtube id=xyz --> were not being processed during site generation.

Solution

  • Modified ShortcodeProcessor::collect_shortcodes() to always load built-in/embedded shortcodes first, before checking if the user's shortcodes directory exists
  • Fixed type mismatch when passing shortcode processor reference to handle_content_pages()
  • Updated documentation to clarify that built-in shortcodes are always available

Testing

Tested with the reproducer from issue #338:

$ marmite myblog --init-site
$ marmite myblog --shortcodes
# Now correctly shows all embedded shortcodes

$ echo '# test\n This is a youtube video\n <!-- .youtube id=xyz -->' > myblog/content/test.md
$ marmite myblog
# YouTube shortcode is now properly processed and generates iframe

Fixes #338

@rochacbruno rochacbruno force-pushed the fix/embedded-shortcodes-issue-338 branch from d68e857 to 68ade7c Compare August 16, 2025 14:57
…y exists

- Always load embedded/built-in shortcodes regardless of whether user has a shortcodes directory
- Fixed shortcode processor reference passing to handle_content_pages
- Updated documentation to clarify that built-in shortcodes are always available
- Applied clippy fixes to test files

Fixes #338
@rochacbruno rochacbruno force-pushed the fix/embedded-shortcodes-issue-338 branch from 68ade7c to 75982c5 Compare August 16, 2025 15:45
@rochacbruno rochacbruno merged commit ca7dd2b into main Aug 16, 2025
3 checks passed
@rochacbruno rochacbruno deleted the fix/embedded-shortcodes-issue-338 branch August 16, 2025 15:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[bug] embedded shortcodes are not being processed

1 participant