From 08daceab47e645a599512f68fcc7a4c19606b56a Mon Sep 17 00:00:00 2001 From: Quang Khai Nguyen Date: Mon, 12 Oct 2026 14:22:01 +0200 Subject: [PATCH] Add seach engine optimization --- Dockerfile | 1 + index.html | 50 +++++++++++++++++++++++++++++++++++++++++++++++--- robots.txt | 4 ++++ sitemap.xml | 6 ++++++ 4 files changed, 58 insertions(+), 3 deletions(-) create mode 100644 robots.txt create mode 100644 sitemap.xml diff --git a/Dockerfile b/Dockerfile index 9a8be86..db45ac9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,6 +8,7 @@ COPY nginx.conf /etc/nginx/conf.d/default.conf # Copy source code web và thư mục ảnh vào COPY index.html /usr/share/nginx/html/ +COPY robots.txt sitemap.xml /usr/share/nginx/html/ COPY images/ /usr/share/nginx/html/images/ EXPOSE 80 diff --git a/index.html b/index.html index 697557c..d969e13 100755 --- a/index.html +++ b/index.html @@ -4,6 +4,23 @@ Nha Trang — Thiên đường du lịch biển Việt Nam | 芽庄 | Nha Trang | Нячанг + + + + + + + + @@ -332,7 +349,7 @@

Hãy để chúng tôi giúp bạn lên kế hoạch cho chuyến đi hoàn hảo nhất.

-
+
@@ -367,6 +384,7 @@ +
@@ -476,6 +494,7 @@ pkg_3: "Nghỉ dưỡng & Tắm bùn khoáng", form_notes: "Yêu cầu đặc biệt", form_submit: "Gửi yêu cầu đặt tour", + form_error: "Không thể gửi yêu cầu lúc này. Vui lòng thử lại sau.", footer_copy: "© 2026 Nha Trang Travel Guide. All rights reserved.", modal_title: "Thành công!", modal_desc: "Yêu cầu của bạn đã được gửi. Chúng tôi sẽ liên hệ lại sớm nhất.", @@ -552,6 +571,7 @@ pkg_3: "Спа-отдых & Термальные источники", form_notes: "Пожелания / Заметки", form_submit: "Отправить заявку", + form_error: "Не удалось отправить заявку. Пожалуйста, попробуйте позже.", footer_copy: "© 2026 Nha Trang Travel Guide. Все права защищены.", modal_title: "Успешно!", modal_desc: "Ваша заявка отправлена. Мы свяжемся с вами в ближайшее время.", @@ -628,6 +648,7 @@ pkg_3: "Wellness Spa & Mineral Mud Baths", form_notes: "Special Requests", form_submit: "Submit Request", + form_error: "Your request could not be sent. Please try again later.", footer_copy: "© 2026 Nha Trang Travel Guide. All rights reserved.", modal_title: "Success!", modal_desc: "Your booking request has been sent. We will contact you shortly.", @@ -704,6 +725,7 @@ pkg_3: "温泉泥浴 & 养生SPA", form_notes: "特殊需求 / 备注", form_submit: "提交预订申请", + form_error: "暂时无法发送您的请求,请稍后重试。", footer_copy: "© 2026 Nha Trang Travel Guide. 保留所有权利。", modal_title: "提交成功!", modal_desc: "您的预订申请已成功发送,我们将尽快与您联系。", @@ -780,6 +802,7 @@ pkg_3: "Wellness und Mineral-Schlammbäder", form_notes: "Besondere Wünsche", form_submit: "Anfrage senden", + form_error: "Ihre Anfrage konnte nicht gesendet werden. Bitte versuchen Sie es später erneut.", footer_copy: "© 2026 Nha Trang Travel Guide. Alle Rechte vorbehalten.", modal_title: "Erfolgreich!", modal_desc: "Ihre Anfrage wurde gesendet. Wir melden uns in Kürze bei Ihnen.", @@ -856,6 +879,7 @@ pkg_3: "Spa et bains de boue minérale", form_notes: "Demandes particulières", form_submit: "Envoyer la demande", + form_error: "Votre demande n'a pas pu être envoyée. Veuillez réessayer plus tard.", footer_copy: "© 2026 Nha Trang Travel Guide. Tous droits réservés.", modal_title: "Demande envoyée !", modal_desc: "Votre demande a bien été envoyée. Nous vous contacterons bientôt.", @@ -911,9 +935,29 @@ }); } - function handleBooking(event) { + async function handleBooking(event) { event.preventDefault(); - document.getElementById('success-modal').classList.remove('hidden'); + const form = event.currentTarget; + const submitButton = form.querySelector('[type="submit"]'); + const status = document.getElementById('form-status'); + status.classList.add('hidden'); + submitButton.disabled = true; + + try { + const response = await fetch(form.action, { + method: form.method, + body: new FormData(form), + headers: { Accept: 'application/json' } + }); + if (!response.ok) throw new Error('Form submission failed'); + + form.reset(); + document.getElementById('success-modal').classList.remove('hidden'); + } catch { + status.classList.remove('hidden'); + } finally { + submitButton.disabled = false; + } } function closeModal() { diff --git a/robots.txt b/robots.txt new file mode 100644 index 0000000..ba996b4 --- /dev/null +++ b/robots.txt @@ -0,0 +1,4 @@ +User-agent: * +Allow: / + +Sitemap: https://kyduyen.duckdns.org/sitemap.xml diff --git a/sitemap.xml b/sitemap.xml new file mode 100644 index 0000000..b48c8e8 --- /dev/null +++ b/sitemap.xml @@ -0,0 +1,6 @@ + + + + https://kyduyen.duckdns.org/ + +