feat: add 7 utility shortcodes (admonition, button, carousel, gallery, figure, tabs, video)#47
Merged
Merged
Conversation
…, figure, tabs, video) Resolves #6 - admonition (note/tip/warning/danger) with Feather SVG icons, markdown content - button (primary/secondary/outline) with icon slot, external URL detection - carousel: CSS scroll-snap with minimal JS prev/next buttons - figure: HTML5 <figure> with caption, lazy loading, local+remote resources - gallery: CSS grid thumbnails with optional :target CSS-only lightbox - tabs/tab: CSS-only radio-button tabs, keyboard-accessible (arrow keys) - video: HTML5 <video> with poster, caption, responsive container Design: - wvc- CSS prefix to avoid theme conflicts - Dark-mode aware via [data-theme] + CSS variables - Single assets/css/shortcodes.css for all styles - Feather-style open-source SVG icons (MIT) - Theme-aware code block backgrounds (slate in light/dark mode) - Copy-to-clipboard button on all code blocks (highlight + plain pre) Tests: 18 Hugo integration tests added (34 total, all passing) Demo page: exampleSite/content/docs/shortcodes.md
CRITICAL fixes: - carousel: hide prev/next buttons when 0-1 slides (C1) - tabs: errorf when >5 tabs to prevent silent content loss (C2) - video: fix boolean param parsing (string 'false' was truthy) (C3) - video: auto-enforce muted when autoplay (browser requirement) - video: auto-detect MIME type from file extension - button: remove role=button on <a> (ARIA contract violation) (C4) WARNING fixes: - figure: only use target=_blank for external href links (W1) - button, figure: add noreferrer to rel for external links (W2) - CSS: add focus-visible outlines to all button variants (W9) - CSS: merge duplicate figure/video caption styles (W8) - carousel: fix usage comment (no slide shortcode exists) (I4) Tests updated to match new behavior.
7190358 to
3a52dfd
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves #6
What's included
7 utility shortcodes + 1 CSS file + code-copy.js enhancement:
Design decisions
wvc-CSS prefix to avoid theme conflicts[data-theme]+ CSS variablesassets/css/shortcodes.cssfor all styles (346 lines)Code copy improvements
assets/js/code-copy.jsnow targets both.highlightand plain<pre>blocksTests
/docs/shortcodes/Files