Skip to content

Commit

Permalink
feat: add alert per page
Browse files Browse the repository at this point in the history
  • Loading branch information
dgarcia360 committed Dec 31, 2024
1 parent d7db05f commit 6383762
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion docs/source/examples/alerts.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Alert
=====

A custom admonition with short text and a link to learn more.
A custom admonition to highlight important updates or announcements. It includes an icon, a short description, and an optional link that can direct users to additional information or external resources.

Using:

Expand Down
4 changes: 4 additions & 0 deletions sphinx_scylladb_theme/alert.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<div class="alert">
<div><i class="icon-logs"></i>We’re updating our license & versioning policy</div>
<div><a href="#" {target_attr}>Learn more about the change <i class="icon-arrow-right"></i></a></div>
</div>
2 changes: 1 addition & 1 deletion sphinx_scylladb_theme/extensions/alerts.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class Alert(Directive):

def run(self):
class_name = "alert"
icon_class = self.options.get("icon", "icon-logs")
icon_class = self.options.get("icon", "logs")
link = self.options.get("link", "")
link_text = self.options.get("link_text", "")
target = self.options.get("target", "_self")
Expand Down
3 changes: 3 additions & 0 deletions sphinx_scylladb_theme/layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,9 @@
class="layout {{'layout--full-width' if full_width}} {{'layout--sidebar' if not hide_sidebar}} {{'layout--has-secondary-sidebar' if not hide_secondary_sidebar}} {{'landing landing--floating' if landing}}">
<div class="content large-order-2">
{% if not hide_version_warning %}
{% if 'opensource' in html_baseurl or 'enterprise' in html_baseurl %}
{% include 'alert.html'%}
{% endif %}
{% include 'version-warning.html'%}
{% endif %}
{% if not hide_pre_content %}
Expand Down

0 comments on commit 6383762

Please sign in to comment.