summaryrefslogtreecommitdiff
path: root/src/pages/sitemap
diff options
context:
space:
mode:
authorit-fixcomart <it@fixcomart.co.id>2024-12-09 15:01:43 +0700
committerit-fixcomart <it@fixcomart.co.id>2024-12-09 15:01:43 +0700
commitcecccfaf318e0e7c52132cf1d04c90c0df745d14 (patch)
tree6828e39e974478995244558ff81d11eac357c026 /src/pages/sitemap
parentf2451beed670dc697aa2026b2df6ad1ad1e90da2 (diff)
parentbb118223e541504262da4509e9188610539702fe (diff)
Merge branch 'new-release' into Feature/pengajuan-tempo
Diffstat (limited to 'src/pages/sitemap')
-rw-r--r--src/pages/sitemap/homepage.xml.js33
1 files changed, 33 insertions, 0 deletions
diff --git a/src/pages/sitemap/homepage.xml.js b/src/pages/sitemap/homepage.xml.js
new file mode 100644
index 00000000..08c52112
--- /dev/null
+++ b/src/pages/sitemap/homepage.xml.js
@@ -0,0 +1,33 @@
+import { create } from 'xmlbuilder';
+
+export async function getServerSideProps({ res }) {
+ const links = [
+ { label: 'Hubungi Kami', url: 'https://indoteknik.com/hubungi-kami' },
+ { label: 'Tentang Kami', url: 'https://indoteknik.com/tentang-kami' },
+ { label: 'Karir', url: 'https://indoteknik.com/karir' },
+ { label: 'Daftar Tempo', url: 'https://indoteknik.com/my/pembayaran-tempo' },
+ ];
+ const sitemap = create('urlset', { encoding: 'utf-8' }).att(
+ 'xmlns',
+ 'http://www.sitemaps.org/schemas/sitemap/0.9'
+ )
+
+ const date = new Date()
+ links.forEach((link) => {
+ const url = sitemap.ele('url')
+ url.ele('loc', link.url)
+ url.ele('lastmod', date.toISOString().slice(0, 10))
+ url.ele('changefreq', 'daily')
+ url.ele('priority', '1.0')
+ })
+
+ res.setHeader('Content-Type', 'text/xml')
+ res.write(sitemap.end())
+ res.end()
+
+ return { props: {} }
+}
+
+export default function SitemapProducts() {
+ return null
+}