Javascript/vue/vuepress/sitemap
提供: 初心者エンジニアの簡易メモ
vuepressでsitemap.xml作成
$ npm install -D vuepress-plugin-sitemap
docs/.vuepress/config.js
module.exports = {
plugins: [
[
"sitemap",
{
hostname: "https://hogehoge.example.com/",
changefreq: "weekly"
}
]
]
};
参考:https://hene.dev/blog/2019/05/02/sitemap/#%E9%96%8B%E7%99%BA%E7%92%B0%E5%A2%83
docs/.vuepress/public/robots.txt
User-agent: * Sitemap: https://hogehoge.example.com/sitemap.xml
sitemap.xmlビルド
$ npm run build
docs/.vuepress/dist/sitemap.xml にファイルができてることを確認
