sitemap 提供網站資訊進而增加SEO,提高網站被搜尋引擎找到的機率。
npm i -D nuxt-simple-sitemap
nuxt.config.js
,增加以下區塊。
export default defineNuxtConfig({
modules: [
'nuxt-simple-sitemap'
]
});
2-1 定義標準網址
export default defineNuxtConfig({
...,
site: {
url: 'http://xxx.com'
}
});
2-2 如果要查看xml原始樣子,可加入以下。
export default defineNuxtConfig({
...,
sitemap: {
xsl: false
}
});
http://xxx.com/sitemap.xml
可看到設定結果。使用routeRules
export default defineNuxtConfig({
...,
routeRules: {
'/school/1': { index: true }
},
})
使用exclude可排除不要的連結
export default defineNuxtConfig({
...,
sitemap: {
exclude: [
'/example/xx',
]
}
})
示範使用原生javascript取得第三方登入的個人資訊
Sep 24, 2024「Google 地圖 API」可讓您利用 JavaScript 將「Google 地圖」嵌入自己的網頁。此 API 透過多種服務提供一些公用程式,以操控地圖 (如同 http://maps.google.com 網頁上所示),並新增地圖內容,能讓您在網站上建立強大的地圖應用程式。——Google 地圖 API 的使用方法
Aug 3, 2024了解如何在Vue 3專案中使用 vue-i18n 進行國際化設定。此指南包含詳細的步驟,包括如何安裝正確的套件版本、設置多語言檔案、合併語系資料,以及在單檔元件(SFC)中動態切換語言,輕鬆讓你的應用程式支持多語言功能。
Jul 6, 2024使用top、bottom、right、left 移動元素,從左上角開始。
Jul 6, 2024or
By clicking below, you agree to our terms of service.
New to HackMD? Sign up