]> danix's work - danix.xyz-2.git/commitdiff
feat: callout shortcode — i18n keys, docs, bump theme submodule
authorDanilo M. <redacted>
Wed, 29 Apr 2026 13:58:12 +0000 (15:58 +0200)
committerDanilo M. <redacted>
Wed, 29 Apr 2026 13:58:12 +0000 (15:58 +0200)
Co-Authored-By: Claude Sonnet 4.6 <redacted>
SHORTCODES.md
i18n/en.yaml
i18n/it.yaml
themes/danix-xyz-hacker

index 7164fe65050b6851a5bb50c4ea2e4ff54bba443d..691e45ad52a1775b6e885ffc3ac9581c182b3c64 100644 (file)
@@ -425,16 +425,137 @@ Basic download button:
 {{< actions url="https://github.com/user/project/archive.zip" desc="Download ZIP" >}}
 ```
 
-With custom styling:
+Centered button:
+```
+{{< actions url="https://example.com/file.zip" desc="Download" outclass="flex justify-center" >}}
+```
+
+Right-aligned button:
+```
+{{< actions url="https://example.com/file.zip" desc="Download" outclass="flex justify-end" >}}
+```
+
+Extra vertical spacing:
+```
+{{< actions url="https://example.com/file.zip" desc="Download" outclass="my-10" >}}
+```
+
+Centered with extra spacing:
+```
+{{< actions url="https://example.com/file.zip" desc="Download" outclass="flex justify-center my-10" >}}
+```
+
+### Common `outclass` Values (wrapper `<div>`)
+
+| Class | Effect |
+|-------|--------|
+| `flex justify-center` | Center button horizontally |
+| `flex justify-end` | Align button to the right |
+| `flex justify-start` | Align button to the left (default flow) |
+| `my-4` / `my-6` / `my-10` | Vertical margin (small / default / large) |
+| `flex justify-center my-10` | Centered with large vertical spacing |
+
+### Common `inclass` Values (anchor `<a>`)
+
+| Class | Effect |
+|-------|--------|
+| `text-sm` | Smaller button text |
+| `text-lg` | Larger button text |
+| `px-6 py-3` | Larger padding |
+| `w-full justify-center` | Full-width button |
+| `font-bold` | Bold label text |
+
+## Callout
+
+Display a semantic callout box for notes, tips, warnings, and other inline asides. All 6 types are styled via CSS — no extra configuration required.
+
+### Syntax
+
+```
+{{< callout type="note" >}}
+Your content here. Supports **markdown**.
+{{< /callout >}}
+```
+
+### Parameters
+
+| Parameter | Required | Default | Description |
+|-----------|----------|---------|-------------|
+| `type` | Yes | — | One of: `note`, `tip`, `info`, `warning`, `danger`, `success` |
+| `title` | No | Translated label for type | Overrides the default title |
+
+### Examples
+
+Note:
+```
+{{< callout type="note" >}}
+This behavior changed in v2.0. Check the migration guide before upgrading.
+{{< /callout >}}
+```
+
+Tip:
+```
+{{< callout type="tip" >}}
+Pass `--fast` to skip the slow validation step in dev.
+{{< /callout >}}
+```
+
+Info:
+```
+{{< callout type="info" >}}
+This feature is available on all plans including the free tier.
+{{< /callout >}}
+```
+
+Warning:
 ```
-{{< actions url="https://example.com/guide.pdf" desc="Download PDF Guide" outclass="my-6" inclass="primary" >}}
+{{< callout type="warning" >}}
+Watch out for this edge case when deploying to production.
+{{< /callout >}}
 ```
 
+Danger:
+```
+{{< callout type="danger" >}}
+This action is irreversible. All data will be permanently deleted.
+{{< /callout >}}
+```
+
+Success:
+```
+{{< callout type="success" >}}
+Build completed. 234 pages generated in 392ms.
+{{< /callout >}}
+```
+
+Custom title:
+```
+{{< callout type="warning" title="Heads up" >}}
+Custom title overrides the default i18n label.
+{{< /callout >}}
+```
+
+### Accessibility Notes
+
+- `role="alert"` on `danger` type — screen readers announce immediately
+- `role="note"` on all other types — non-intrusive
+- Feather icons are decorative (`aria-hidden="true"`) — title text always conveys the type
+
+### Common `type` Values
+
+| Type | Color | Feather Icon | Use for |
+|------|-------|-------------|---------|
+| `note` | Purple (`--accent`) | `edit-2` | Extra context, side remarks |
+| `tip` | Green (`--accent2`) | `zap` | Best practices, shortcuts |
+| `info` | Cyan (`--type-link`) | `info` | Neutral information |
+| `warning` | Amber (`--type-life`) | `alert-triangle` | Potential pitfalls |
+| `danger` | Red (`#ef4444`) | `x-circle` | Destructive actions, breaking changes |
+| `success` | Green (`--accent2`) | `check-circle` | Confirmed results, completed steps |
+
 ## Future Shortcodes
 
 The following shortcodes are planned for future releases:
 
-- **Callout**: Highlighted information boxes for notes, warnings, and tips
 - **Tabs**: Tabbed content sections for organizing related information
 - **Code**: Enhanced code blocks with syntax highlighting and line numbers
 - **Audio**: Audio player for podcast episodes and sound files
index dcad3d2288f0c75b0ff57811dedfdbeeac27022a..3875a14a30ea500ac20cf632e8cf230719cae655 100644 (file)
@@ -181,3 +181,11 @@ repo_example_1_desc:
 #   other: "Various SlackBuild scripts, following SlackBuilds.org conventions wherever is possible."
 # repo_example_3_desc:
 #   other: "SlackBuild scripts for Example Package 3. Utility package for system administration and configuration."
+
+# Callout shortcode titles
+callout_note: "Note"
+callout_tip: "Tip"
+callout_info: "Info"
+callout_warning: "Warning"
+callout_danger: "Danger"
+callout_success: "Success"
index e0e7733416deb48355843d42706b010461149b4a..d8cee81e56d1d249c64ec46a345481592856dc47 100644 (file)
@@ -183,3 +183,11 @@ repo_example_1_desc:
 #   other: "Vari script SlackBuild, seguo gli standard di SlackBuilds.org ovunque possibile."
 # repo_example_3_desc:
 #   other: "Script SlackBuild per Pacchetto Esempio 3. Pacchetto di utilità per amministrazione di sistema e configurazione."
+
+# Titoli shortcode callout
+callout_note: "Nota"
+callout_tip: "Suggerimento"
+callout_info: "Informazione"
+callout_warning: "Attenzione"
+callout_danger: "Pericolo"
+callout_success: "Successo"
index 997ea90b7f85329476771e8b30a38fb86c18a07f..504b0cb102d87530cd1363cc00f5ca75e093e219 160000 (submodule)
@@ -1 +1 @@
-Subproject commit 997ea90b7f85329476771e8b30a38fb86c18a07f
+Subproject commit 504b0cb102d87530cd1363cc00f5ca75e093e219