Enhance Header and Layout components with new features and scripts

- Filtered out the Contact link from the main navigation in Header.astro and added a Contact icon that links to the contact page.
- Integrated Rocket.Chat Livechat script into Layout.astro for improved user support interaction.
This commit is contained in:
becarta
2025-06-07 04:11:34 +02:00
parent 7eca257cf4
commit 67c7af6be7
2 changed files with 22 additions and 2 deletions

View File

@@ -68,9 +68,13 @@ if (!currentLang) {
// Get translated header data - ensure we're using the current language
const headerData = getHeaderData(currentLang);
// Filter out the Contact link for the main nav
const navLinks = headerData.links.filter(link => link.text?.toLowerCase() !== 'contact');
const contactLink = headerData.links.find(link => link.text?.toLowerCase() === 'contact');
const {
id = 'header',
links = headerData.links,
links = navLinks,
isSticky = false,
isDark = false,
isFullWidth = false,
@@ -185,7 +189,13 @@ const {
<div class="items-center flex justify-between w-full md:w-auto">
<div class="flex items-center space-x-4">
{showToggleTheme && <ToggleTheme iconClass="w-6 h-6 md:w-5 md:h-5 md:inline-block" />}
<!-- Language Selector as Select Element -->
{/* Contact Icon */}
{contactLink && (
<a href={contactLink.href} aria-label="Contact" title="Contact" class="hover:text-link dark:hover:text-white flex items-center">
<Icon name="tabler:mail" class="w-6 h-6" />
</a>
)}
{/* Language Selector as Select Element */}
<LanguageDropdown currentLang={currentPath.split('/')[1] || 'en'} />
</div>
</div>

View File

@@ -73,5 +73,15 @@ const { language, textDirection } = I18N;
<LanguagePersistence />
<CookieBanner />
<BackToTop />
<!-- Start of Rocket.Chat Livechat Script -->
<script type="text/javascript">
(function(w, d, s, u) {
w.RocketChat = function(c) { w.RocketChat._.push(c) }; w.RocketChat._ = []; w.RocketChat.url = u;
const h = d.getElementsByTagName(s)[0], j = d.createElement(s);
j.async = true; j.src = 'https://chat.365devnet.eu/livechat/rocketchat-livechat.min.js?_=201903270000';
h.parentNode.insertBefore(j, h);
})(window, document, 'script', 'https://chat.365devnet.eu/livechat');
</script>
<!-- End of Rocket.Chat Livechat Script -->
</body>
</html>