@@ -24,6 +24,7 @@ class HeroBox(Directive):
2424 "button_text" : directives .path ,
2525 "search_box" : directives .flag ,
2626 "content_page" : directives .flag ,
27+ "ai_chatbot_id" : directives .unchanged ,
2728 }
2829
2930 def run (self ):
@@ -88,18 +89,34 @@ def run(self):
8889 )
8990
9091 has_search_box = "search_box" in self .options
91- search_box = (
92- generate_template (
92+
93+ ai_chatbot_id = self .options .get ("ai_chatbot_id" )
94+
95+ ask_ai_section = ""
96+ if ai_chatbot_id :
97+ ask_ai_section = """
98+ <div class="{class_name}__ask-ai">
99+ <biel-button project="{ai_chatbot_id}"
100+ header-title="ScyllaDB chatbot (beta)"
101+ button-position="default"
102+ modal-position="bottom-right"
103+ button-style="dark">Ask AI</biel-button>
104+ </div>""" .format (class_name = class_name , ai_chatbot_id = ai_chatbot_id )
105+
106+ if has_search_box :
107+ search_box = generate_template (
93108 """
94- <div class="{class_name}__search-box search-box search-box--hero">
95- <ci-search></ci-search>
109+ <div class="{class_name}__search-wrapper">
110+ <div class="{class_name}__search-box search-box search-box--hero">
111+ <ci-search></ci-search>
112+ </div>{ask_ai_section}
96113 </div>
97114 """ ,
98115 class_name = class_name ,
116+ ask_ai_section = ask_ai_section ,
99117 )
100- if has_search_box
101- else ""
102- )
118+ else :
119+ search_box = ""
103120
104121 html_tag_open = generate_template (
105122 """
0 commit comments