From 24ba15dce084dd4a7e0b60c51a1ce2a5b266b684 Mon Sep 17 00:00:00 2001 From: Troy Morehouse Date: Sat, 25 Apr 2020 17:51:42 -0300 Subject: [PATCH 01/25] chore(docs): add generated robots.txt and sitemap.xml --- docs/templates/robots.txt | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 docs/templates/robots.txt diff --git a/docs/templates/robots.txt b/docs/templates/robots.txt new file mode 100644 index 00000000000..466b2fb3ebb --- /dev/null +++ b/docs/templates/robots.txt @@ -0,0 +1,2 @@ +User-agent: * +<%= options.isProd ? 'Allow' : 'Disallow' %>: / From 1aa30f78a75d3432e9dc4f421644cea092a14de2 Mon Sep 17 00:00:00 2001 From: Troy Morehouse Date: Sat, 25 Apr 2020 18:00:32 -0300 Subject: [PATCH 02/25] Update .gitignore --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index 3910aea3ce2..da82ec04a1b 100644 --- a/.gitignore +++ b/.gitignore @@ -12,3 +12,5 @@ node_modules/ .DS_Store sw.js workbox*.js* +docs/static/robots.txt +docs/static/sitemap.xml From 4bb881e44f86702234e245495187f97b2d2df2d5 Mon Sep 17 00:00:00 2001 From: Troy Morehouse Date: Sat, 25 Apr 2020 18:06:08 -0300 Subject: [PATCH 03/25] Update nuxt.config.js --- docs/nuxt.config.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/docs/nuxt.config.js b/docs/nuxt.config.js index e721ea79ef0..00b66b1cfda 100644 --- a/docs/nuxt.config.js +++ b/docs/nuxt.config.js @@ -177,6 +177,18 @@ module.exports = { } } }, + templates: [ + { + // Genrate apropriate robots.txt file + src: '~/templates/robots.txt', + dst: '~/static/robots.txt', + options: { + isProd: + process.env.VERCEL_GITHUB_COMMIT_REF === 'master' || + process.env.NOW_GITHUB_COMMIT_REF === 'master' + } + } + ], extend(config, { isDev, loaders }) { config.resolve.alias.vue = 'vue/dist/vue.common' From 63069a28bd79025f89d84e3326638aba66b76686 Mon Sep 17 00:00:00 2001 From: Troy Morehouse Date: Sat, 25 Apr 2020 18:12:12 -0300 Subject: [PATCH 04/25] Update nuxt.config.js --- docs/nuxt.config.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/docs/nuxt.config.js b/docs/nuxt.config.js index 00b66b1cfda..fe404fb0ecd 100644 --- a/docs/nuxt.config.js +++ b/docs/nuxt.config.js @@ -178,10 +178,12 @@ module.exports = { } }, templates: [ + // Genrate apropriate robots.txt file { - // Genrate apropriate robots.txt file - src: '~/templates/robots.txt', - dst: '~/static/robots.txt', + // Source template + src: './templates/robots.txt', + // relative to `.nuxt/` directory + dst: 'robots.txt', options: { isProd: process.env.VERCEL_GITHUB_COMMIT_REF === 'master' || From f0816feaa447f013e18caddd71b812b6fe9138a7 Mon Sep 17 00:00:00 2001 From: Troy Morehouse Date: Sat, 25 Apr 2020 18:12:32 -0300 Subject: [PATCH 05/25] Update .gitignore --- .gitignore | 2 -- 1 file changed, 2 deletions(-) diff --git a/.gitignore b/.gitignore index da82ec04a1b..3910aea3ce2 100644 --- a/.gitignore +++ b/.gitignore @@ -12,5 +12,3 @@ node_modules/ .DS_Store sw.js workbox*.js* -docs/static/robots.txt -docs/static/sitemap.xml From cb2df6735df934c536691f608bde3b3b7048bffc Mon Sep 17 00:00:00 2001 From: Troy Morehouse Date: Sat, 25 Apr 2020 18:19:30 -0300 Subject: [PATCH 06/25] Update nuxt.config.js --- docs/nuxt.config.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/nuxt.config.js b/docs/nuxt.config.js index fe404fb0ecd..627e3ae19df 100644 --- a/docs/nuxt.config.js +++ b/docs/nuxt.config.js @@ -180,9 +180,9 @@ module.exports = { templates: [ // Genrate apropriate robots.txt file { - // Source template - src: './templates/robots.txt', - // relative to `.nuxt/` directory + // Source template relative to nuxt.config.js + src: '~/templates/robots.txt', + // Output file relative to `.nuxt/` directory dst: 'robots.txt', options: { isProd: From 37f094fc4dbd638f334ebd210d344de60b651394 Mon Sep 17 00:00:00 2001 From: Troy Morehouse Date: Sat, 25 Apr 2020 18:25:52 -0300 Subject: [PATCH 07/25] Update nuxt.config.js --- docs/nuxt.config.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/nuxt.config.js b/docs/nuxt.config.js index 627e3ae19df..1120866e4b4 100644 --- a/docs/nuxt.config.js +++ b/docs/nuxt.config.js @@ -178,18 +178,20 @@ module.exports = { } }, templates: [ + /* // Genrate apropriate robots.txt file { // Source template relative to nuxt.config.js src: '~/templates/robots.txt', // Output file relative to `.nuxt/` directory - dst: 'robots.txt', + dst: '../static/robots.txt', options: { isProd: process.env.VERCEL_GITHUB_COMMIT_REF === 'master' || process.env.NOW_GITHUB_COMMIT_REF === 'master' } } + */ ], extend(config, { isDev, loaders }) { config.resolve.alias.vue = 'vue/dist/vue.common' From 59a618e157157ff7e22ba12d9ad820b0ef8f78cd Mon Sep 17 00:00:00 2001 From: Troy Morehouse Date: Sat, 25 Apr 2020 18:26:57 -0300 Subject: [PATCH 08/25] Update .gitignore --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index 3910aea3ce2..da82ec04a1b 100644 --- a/.gitignore +++ b/.gitignore @@ -12,3 +12,5 @@ node_modules/ .DS_Store sw.js workbox*.js* +docs/static/robots.txt +docs/static/sitemap.xml From 4d389696c2341712e8ba443317fc8566590c45ab Mon Sep 17 00:00:00 2001 From: Troy Morehouse Date: Sat, 25 Apr 2020 18:44:15 -0300 Subject: [PATCH 09/25] Rename docs/templates/robots.txt to docs/static-templates/robots.txt --- docs/{templates => static-templates}/robots.txt | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename docs/{templates => static-templates}/robots.txt (100%) diff --git a/docs/templates/robots.txt b/docs/static-templates/robots.txt similarity index 100% rename from docs/templates/robots.txt rename to docs/static-templates/robots.txt From 874edd7f226b46aa91c27f14cffeba1953c473ad Mon Sep 17 00:00:00 2001 From: Troy Morehouse Date: Sat, 25 Apr 2020 18:45:17 -0300 Subject: [PATCH 10/25] Update nuxt.config.js --- docs/nuxt.config.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/docs/nuxt.config.js b/docs/nuxt.config.js index 1120866e4b4..e5066179f2c 100644 --- a/docs/nuxt.config.js +++ b/docs/nuxt.config.js @@ -178,11 +178,10 @@ module.exports = { } }, templates: [ - /* // Genrate apropriate robots.txt file { // Source template relative to nuxt.config.js - src: '~/templates/robots.txt', + src: '~/static-templates/robots.txt', // Output file relative to `.nuxt/` directory dst: '../static/robots.txt', options: { @@ -191,7 +190,6 @@ module.exports = { process.env.NOW_GITHUB_COMMIT_REF === 'master' } } - */ ], extend(config, { isDev, loaders }) { config.resolve.alias.vue = 'vue/dist/vue.common' From 662daf4981032b40e6a29e48372009cae0e514ff Mon Sep 17 00:00:00 2001 From: Troy Morehouse Date: Sat, 25 Apr 2020 18:50:05 -0300 Subject: [PATCH 11/25] Update nuxt.config.js --- docs/nuxt.config.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/nuxt.config.js b/docs/nuxt.config.js index e5066179f2c..1b0fc4097ed 100644 --- a/docs/nuxt.config.js +++ b/docs/nuxt.config.js @@ -178,10 +178,10 @@ module.exports = { } }, templates: [ - // Genrate apropriate robots.txt file + // Generate apropriate robots.txt file { // Source template relative to nuxt.config.js - src: '~/static-templates/robots.txt', + src: './static-templates/robots.txt', // Output file relative to `.nuxt/` directory dst: '../static/robots.txt', options: { From 1966f33aea969602fb6dfca391c4dda347df4a0c Mon Sep 17 00:00:00 2001 From: Troy Morehouse Date: Sat, 25 Apr 2020 18:56:58 -0300 Subject: [PATCH 12/25] Update nuxt.config.js --- docs/nuxt.config.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/nuxt.config.js b/docs/nuxt.config.js index 1b0fc4097ed..7370424958b 100644 --- a/docs/nuxt.config.js +++ b/docs/nuxt.config.js @@ -180,8 +180,8 @@ module.exports = { templates: [ // Generate apropriate robots.txt file { - // Source template relative to nuxt.config.js - src: './static-templates/robots.txt', + // Source template + src: './docs/static-templates/robots.txt', // Output file relative to `.nuxt/` directory dst: '../static/robots.txt', options: { From 49e3d7ff3def52fa8af226c77883f0d370e0b0e8 Mon Sep 17 00:00:00 2001 From: Troy Morehouse Date: Sat, 25 Apr 2020 19:10:58 -0300 Subject: [PATCH 13/25] Update nuxt.config.js --- docs/nuxt.config.js | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/docs/nuxt.config.js b/docs/nuxt.config.js index 7370424958b..e721ea79ef0 100644 --- a/docs/nuxt.config.js +++ b/docs/nuxt.config.js @@ -177,20 +177,6 @@ module.exports = { } } }, - templates: [ - // Generate apropriate robots.txt file - { - // Source template - src: './docs/static-templates/robots.txt', - // Output file relative to `.nuxt/` directory - dst: '../static/robots.txt', - options: { - isProd: - process.env.VERCEL_GITHUB_COMMIT_REF === 'master' || - process.env.NOW_GITHUB_COMMIT_REF === 'master' - } - } - ], extend(config, { isDev, loaders }) { config.resolve.alias.vue = 'vue/dist/vue.common' From 7fae931626c45bb8896365e9e3105a5a22a0cf00 Mon Sep 17 00:00:00 2001 From: Troy Morehouse Date: Sat, 25 Apr 2020 19:11:25 -0300 Subject: [PATCH 14/25] Update .gitignore --- .gitignore | 2 -- 1 file changed, 2 deletions(-) diff --git a/.gitignore b/.gitignore index da82ec04a1b..3910aea3ce2 100644 --- a/.gitignore +++ b/.gitignore @@ -12,5 +12,3 @@ node_modules/ .DS_Store sw.js workbox*.js* -docs/static/robots.txt -docs/static/sitemap.xml From 3ddc048902fc47d70a92b75ed4e433bcec311b3b Mon Sep 17 00:00:00 2001 From: Troy Morehouse Date: Sat, 25 Apr 2020 22:14:43 -0300 Subject: [PATCH 15/25] update package.json --- package.json | 2 ++ yarn.lock | 74 ++++++++++++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 74 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 49394facce6..09e4a8a8574 100644 --- a/package.json +++ b/package.json @@ -105,6 +105,8 @@ "@babel/standalone": "^7.9.5", "@nuxtjs/google-analytics": "^2.2.3", "@nuxtjs/pwa": "^3.0.0-beta.20", + "@nuxtjs/robots": "^2.4.2", + "@nuxtjs/sitemap": "^2.2.1", "@vue/test-utils": "1.0.0-beta.29", "autoprefixer": "^9.7.6", "babel-core": "^7.0.0-bridge.0", diff --git a/yarn.lock b/yarn.lock index 77bc6fcc7f5..d04dbbdf4c4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1518,6 +1518,26 @@ jimp-compact "^0.8.0" workbox-cdn "^4.3.1" +"@nuxtjs/robots@^2.4.2": + version "2.4.2" + resolved "https://registry.yarnpkg.com/@nuxtjs/robots/-/robots-2.4.2.tgz#9a96c91abb70e39b414eec502ef1cf7d5ef0235e" + integrity sha512-BW3qhvxlPBKlMkZHtARFPeliFraiZHS28G3j4qgRbSfOBtHC0yDX3Dnq1LkQMzAbPfbw6A1L3sdjgBVZZnfFAw== + +"@nuxtjs/sitemap@^2.2.1": + version "2.2.1" + resolved "https://registry.yarnpkg.com/@nuxtjs/sitemap/-/sitemap-2.2.1.tgz#a00b528e361673b3f2651a0f1ee4081e89f9c6fd" + integrity sha512-GrXTueBaSQgAuBbUrGcKu37VbZBOZ4omHqk8FfthK71R26vp9LWUcqlRbuQaIrAYynjSfSPxaLpX8opUwO1nKw== + dependencies: + async-cache "^1.1.0" + consola "^2.11.3" + etag "^1.8.1" + fresh "^0.5.2" + fs-extra "^8.1.0" + is-https "^1.0.0" + lodash.unionby "^4.8.0" + minimatch "^3.0.4" + sitemap "^4.1.1" + "@nuxtjs/youch@^4.2.3": version "4.2.3" resolved "https://registry.yarnpkg.com/@nuxtjs/youch/-/youch-4.2.3.tgz#36f8b22df5a0efaa81373109851e1d857aca6bed" @@ -1633,6 +1653,11 @@ resolved "https://registry.yarnpkg.com/@types/node/-/node-13.11.0.tgz#390ea202539c61c8fa6ba4428b57e05bc36dc47b" integrity sha512-uM4mnmsIIPK/yeO+42F2RQhGUIs39K2RFmugcJANppXe6J1nvH87PvzPZYpza7Xhhs8Yn9yIAVdLZ84z61+0xQ== +"@types/node@^12.0.2": + version "12.12.37" + resolved "https://registry.yarnpkg.com/@types/node/-/node-12.12.37.tgz#cb4782d847f801fa58316da5b4801ca3a59ae790" + integrity sha512-4mXKoDptrXAwZErQHrLzpe0FN/0Wmf5JRniSVIdwUrtDf9wnmEV1teCNLBo/TwuXhkK/bVegoEn/wmb+x0AuPg== + "@types/normalize-package-data@^2.4.0": version "2.4.0" resolved "https://registry.yarnpkg.com/@types/normalize-package-data/-/normalize-package-data-2.4.0.tgz#e486d0d97396d79beedd0a6e33f4534ff6b4973e" @@ -1660,6 +1685,13 @@ dependencies: "@types/node" "*" +"@types/sax@^1.2.0": + version "1.2.1" + resolved "https://registry.yarnpkg.com/@types/sax/-/sax-1.2.1.tgz#e0248be936ece791a82db1a57f3fb5f7c87e8172" + integrity sha512-dqYdvN7Sbw8QT/0Ci5rhjE4/iCMJEM0Y9rHpCu+gGXD9Lwbz28t6HI2yegsB6BoV1sShRMU6lAmAcgRjmFy7LA== + dependencies: + "@types/node" "*" + "@types/stack-utils@^1.0.1": version "1.0.1" resolved "https://registry.yarnpkg.com/@types/stack-utils/-/stack-utils-1.0.1.tgz#0a851d3bd96498fa25c33ab7278ed3bd65f06c3e" @@ -2185,6 +2217,11 @@ are-we-there-yet@~1.1.2: delegates "^1.0.0" readable-stream "^2.0.6" +arg@^4.1.1: + version "4.1.3" + resolved "https://registry.yarnpkg.com/arg/-/arg-4.1.3.tgz#269fc7ad5b8e42cb63c896d5666017261c144089" + integrity sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA== + argparse@^1.0.7: version "1.0.10" resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911" @@ -2320,6 +2357,13 @@ astral-regex@^1.0.0: resolved "https://registry.yarnpkg.com/astral-regex/-/astral-regex-1.0.0.tgz#6c8c3fb827dd43ee3918f27b82782ab7658a6fd9" integrity sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg== +async-cache@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/async-cache/-/async-cache-1.1.0.tgz#4a9a5a89d065ec5d8e5254bd9ee96ba76c532b5a" + integrity sha1-SppaidBl7F2OUlS9nulrp2xTK1o= + dependencies: + lru-cache "^4.0.0" + async-each@^1.0.1: version "1.0.3" resolved "https://registry.yarnpkg.com/async-each/-/async-each-1.0.3.tgz#b727dbf87d7651602f06f4d4ac387f47d91b0cbf" @@ -6938,6 +6982,11 @@ is-hexadecimal@^1.0.0: resolved "https://registry.yarnpkg.com/is-hexadecimal/-/is-hexadecimal-1.0.4.tgz#cc35c97588da4bd49a8eedd6bc4082d44dcb23a7" integrity sha512-gyPJuv83bHMpocVYoqof5VDiZveEoGoFL8m3BXNb2VW8Xs+rz9kqO8LOQ5DH6EsuvilT1ApazU0pyl+ytbPtlw== +is-https@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-https/-/is-https-1.0.0.tgz#9c1dde000dc7e7288edb983bef379e498e7cb1bf" + integrity sha512-1adLLwZT9XEXjzhQhZxd75uxf0l+xI9uTSFaZeSESjL3E1eXSPpO+u5RcgqtzeZ1KCaNvtEwZSTO2P4U5erVqQ== + is-installed-globally@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/is-installed-globally/-/is-installed-globally-0.1.0.tgz#0dfd98f5a9111716dd535dda6492f67bf3d25a80" @@ -8166,6 +8215,11 @@ lodash.templatesettings@^4.0.0: dependencies: lodash._reinterpolate "^3.0.0" +lodash.unionby@^4.8.0: + version "4.8.0" + resolved "https://registry.yarnpkg.com/lodash.unionby/-/lodash.unionby-4.8.0.tgz#883f098ff78f564a727b7508e09cdd539734bb83" + integrity sha1-iD8Jj/ePVkpye3UI4JzdU5c0u4M= + lodash.uniq@^4.5.0: version "4.5.0" resolved "https://registry.yarnpkg.com/lodash.uniq/-/lodash.uniq-4.5.0.tgz#d0225373aeb652adc1bc82e4945339a842754773" @@ -8245,7 +8299,7 @@ lowercase-keys@^1.0.0: resolved "https://registry.yarnpkg.com/lowercase-keys/-/lowercase-keys-1.0.1.tgz#6f9e30b47084d971a7c820ff15a6c5167b74c26f" integrity sha512-G2Lj61tXDnVFFOi8VZds+SoQjtQC3dgokKdDG2mTm1tx4m50NUHBOZSBwQQHyy0V12A0JTG4icfZQH+xPyh8VA== -lru-cache@^4.0.1, lru-cache@^4.1.1, lru-cache@^4.1.2, lru-cache@^4.1.5: +lru-cache@^4.0.0, lru-cache@^4.0.1, lru-cache@^4.1.1, lru-cache@^4.1.2, lru-cache@^4.1.5: version "4.1.5" resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-4.1.5.tgz#8bbe50ea85bed59bc9e33dcab8235ee9bcf443cd" integrity sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g== @@ -11295,7 +11349,7 @@ sass-loader@^8.0.2: schema-utils "^2.6.1" semver "^6.3.0" -sax@~1.2.4: +sax@^1.2.4, sax@~1.2.4: version "1.2.4" resolved "https://registry.yarnpkg.com/sax/-/sax-1.2.4.tgz#2816234e2378bddc4e5354fab5caa895df7100d9" integrity sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw== @@ -11528,6 +11582,17 @@ sisteransi@^1.0.4: resolved "https://registry.yarnpkg.com/sisteransi/-/sisteransi-1.0.5.tgz#134d681297756437cc05ca01370d3a7a571075ed" integrity sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg== +sitemap@^4.1.1: + version "4.1.1" + resolved "https://registry.yarnpkg.com/sitemap/-/sitemap-4.1.1.tgz#c9b459c7d797e629c61f56b86586d4f67dbf250b" + integrity sha512-+8yd66IxyIFEMFkFpVoPuoPwBvdiL7Ap/HS5YD7igqO4phkyTPFIprCAE9NMHehAY5ZGN3MkAze4lDrOAX3sVQ== + dependencies: + "@types/node" "^12.0.2" + "@types/sax" "^1.2.0" + arg "^4.1.1" + sax "^1.2.4" + xmlbuilder "^13.0.0" + slash@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/slash/-/slash-2.0.0.tgz#de552851a1759df3a8f206535442f5ec4ddeab44" @@ -13461,6 +13526,11 @@ xml-name-validator@^3.0.0: resolved "https://registry.yarnpkg.com/xml-name-validator/-/xml-name-validator-3.0.0.tgz#6ae73e06de4d8c6e47f9fb181f78d648ad457c6a" integrity sha512-A5CUptxDsvxKJEU3yO6DuWBSJz/qizqzJKOMIfUJHETbBw/sFaDxgd6fxm1ewUaM0jZ444Fc5vC5ROYurg/4Pw== +xmlbuilder@^13.0.0: + version "13.0.2" + resolved "https://registry.yarnpkg.com/xmlbuilder/-/xmlbuilder-13.0.2.tgz#02ae33614b6a047d1c32b5389c1fdacb2bce47a7" + integrity sha512-Eux0i2QdDYKbdbA6AM6xE4m6ZTZr4G4xF9kahI2ukSEMCzwce2eX9WlTI5J3s+NU7hpasFsr8hWIONae7LluAQ== + xmlchars@^2.1.1: version "2.2.0" resolved "https://registry.yarnpkg.com/xmlchars/-/xmlchars-2.2.0.tgz#060fe1bcb7f9c76fe2a17db86a9bc3ab894210cb" From ca87a758b8404179aeb86a17ebacabfed6e9c4aa Mon Sep 17 00:00:00 2001 From: Troy Morehouse Date: Sat, 25 Apr 2020 22:28:27 -0300 Subject: [PATCH 16/25] Update nuxt.config.js --- docs/nuxt.config.js | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/docs/nuxt.config.js b/docs/nuxt.config.js index e721ea79ef0..20fe5396e04 100644 --- a/docs/nuxt.config.js +++ b/docs/nuxt.config.js @@ -133,6 +133,10 @@ renderer.table = function() { return `
${table}
` } +const isProdDocs = + process.env.VERCEL_GITHUB_COMMIT_REF === 'master' || + process.env.NOW_GITHUB_COMMIT_REF === 'master' + // --- Main export --- module.exports = { @@ -269,7 +273,7 @@ module.exports = { plugins: ['~/plugins/bootstrap-vue.js', '~/plugins/play.js', '~/plugins/docs.js'], buildModules: ['@nuxtjs/google-analytics'], - modules: ['@nuxtjs/pwa'], + modules: ['@nuxtjs/pwa', '@nuxtjs/robots', '@nuxtjs/sitemap'], 'google-analytics': { id: GA_TRACKING_ID, @@ -278,6 +282,18 @@ module.exports = { } }, + robots: () => { + return [isProdDocs ? { UserAgent: '*', Allow: '/' } : { UserAgent: '*', Disallow: '/' }] + }, + + sitemap: { + hostname: isProdDocs ? BASE_URL : 'https://localhost', + // Exclude all static routes when not prod + exclude: isProdDocs ? ['/docs/misc', '/docs/misc/**', '/docs/layout'] : ['/', '/**'], + // Include dynamic slug routes in prod + ...(isProdDocs ? {} : { routes: [] }) + }, + head: { meta: [{ 'http-equiv': 'X-UA-Compatible', content: 'IE=edge' }], script: [ From e6f84269f2dd399612e21485cee58a4d4671a145 Mon Sep 17 00:00:00 2001 From: Troy Morehouse Date: Sat, 25 Apr 2020 22:35:54 -0300 Subject: [PATCH 17/25] Update nuxt.config.js --- docs/nuxt.config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/nuxt.config.js b/docs/nuxt.config.js index 20fe5396e04..bb556150d57 100644 --- a/docs/nuxt.config.js +++ b/docs/nuxt.config.js @@ -133,7 +133,7 @@ renderer.table = function() { return `
${table}
` } -const isProdDocs = +const isProdDocs = process.env.VERCEL_GITHUB_COMMIT_REF === 'master' || process.env.NOW_GITHUB_COMMIT_REF === 'master' From a368be70c255c3ebb50d292b10c7fc74420c9916 Mon Sep 17 00:00:00 2001 From: Troy Morehouse Date: Sat, 25 Apr 2020 22:36:34 -0300 Subject: [PATCH 18/25] Delete robots.txt --- docs/static-templates/robots.txt | 2 -- 1 file changed, 2 deletions(-) delete mode 100644 docs/static-templates/robots.txt diff --git a/docs/static-templates/robots.txt b/docs/static-templates/robots.txt deleted file mode 100644 index 466b2fb3ebb..00000000000 --- a/docs/static-templates/robots.txt +++ /dev/null @@ -1,2 +0,0 @@ -User-agent: * -<%= options.isProd ? 'Allow' : 'Disallow' %>: / From 816d6f35bc3c2d0496bba6bd26dc7f0dffaa7d4c Mon Sep 17 00:00:00 2001 From: Troy Morehouse Date: Sun, 26 Apr 2020 04:23:57 -0300 Subject: [PATCH 19/25] Update nuxt.config.js --- docs/nuxt.config.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/docs/nuxt.config.js b/docs/nuxt.config.js index bb556150d57..12e759291f9 100644 --- a/docs/nuxt.config.js +++ b/docs/nuxt.config.js @@ -282,15 +282,22 @@ module.exports = { } }, + // We enable crawling in production docs only robots: () => { + // In production docs we allow crawling, else we deny crawling return [isProdDocs ? { UserAgent: '*', Allow: '/' } : { UserAgent: '*', Disallow: '/' }] }, + // We only include a populated `sitemap.xml` in production docs sitemap: { - hostname: isProdDocs ? BASE_URL : 'https://localhost', - // Exclude all static routes when not prod + // Sitemaps requires a hostname, so we use localhost in + // non-prod mode just to make the sitemap module happy + hostname: isProdDocs ? BASE_URL : 'http://localhost', + // Exclude all static routes when not prod. Exclude + // only redirect routes in prod. exclude: isProdDocs ? ['/docs/misc', '/docs/misc/**', '/docs/layout'] : ['/', '/**'], - // Include dynamic slug routes in prod + // Include dynamic slug routes (from generate.routes) in prod, while + // in non prod docs we do not include dynamic routes (empty array) ...(isProdDocs ? {} : { routes: [] }) }, From 4de34a69f2f73c7668e8d927e31cb62d87c4aa23 Mon Sep 17 00:00:00 2001 From: Troy Morehouse Date: Sun, 26 Apr 2020 05:23:34 -0300 Subject: [PATCH 20/25] Update nuxt.config.js --- docs/nuxt.config.js | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/docs/nuxt.config.js b/docs/nuxt.config.js index dc1de15f43e..b45ef102e67 100644 --- a/docs/nuxt.config.js +++ b/docs/nuxt.config.js @@ -133,9 +133,12 @@ renderer.table = function() { return `
${table}
` } +// Determine if documettion generation is published prod docs +// Must be from bootstrap-vue/bootstrap-vue repo master branch const isProdDocs = - process.env.VERCEL_GITHUB_COMMIT_REF === 'master' || - process.env.NOW_GITHUB_COMMIT_REF === 'master' + process.env.VERCEL_GITHUB_ORG === 'bootstrap-vue' && + process.env.VERCEL_GITHUB_REPO === 'bootstrap-vue' && + process.env.VERCEL_GITHUB_COMMIT_REF === 'master' // --- Main export --- @@ -158,17 +161,17 @@ module.exports = { // ENV vars provided by Vercel/Zeit Now build // https://zeit.co/docs/v2/build-step#system-environment-variables // - `true` if on Zeit Now (dev or PR) - VERCEL_NOW: process.env.VERCEL_GITHUB_DEPLOYMENT || process.env.NOW_GITHUB_DEPLOYMENT, + VERCEL_NOW: process.env.VERCEL_GITHUB_DEPLOYMENT, // - The branch name used for the deploy (i.e. `dev`, `master`, `patch-1`, etc) - VERCEL_BRANCH: process.env.VERCEL_GITHUB_COMMIT_REF || process.env.NOW_GITHUB_COMMIT_REF, + VERCEL_BRANCH: process.env.VERCEL_GITHUB_COMMIT_REF, // - The Commit SHA hash - VERCEL_COMMIT_SHA: process.env.VERCEL_GITHUB_COMMIT_SHA || process.env.NOW_GITHUB_COMMIT_SHA, + VERCEL_COMMIT_SHA: process.env.VERCEL_GITHUB_COMMIT_SHA, // - The deployment URL - VERCEL_URL: process.env.VERCEL_URL || process.env.NOW_URL, + VERCEL_URL: process.env.VERCEL_URL, // - The Github Organization (ie. bootstrap-vue) - VERCEL_GITHUB_ORG: process.env.VERCEL_GITHUB_ORG || process.env.NOW_GITHUB_ORG, + VERCEL_GITHUB_ORG: process.env.VERCEL_GITHUB_ORG, // - The repo is the organization (i.e. bootstrap-vue) - VERCEL_GITHUB_REPO: process.env.VERCEL_GITHUB_REPO || process.env.NOW_GITHUB_REPO + VERCEL_GITHUB_REPO: process.env.VERCEL_GITHUB_REPO }, build: { From 712ad39d96beb9c2d089c4763c1a5974c55c30bb Mon Sep 17 00:00:00 2001 From: Troy Morehouse Date: Sun, 26 Apr 2020 07:34:43 -0300 Subject: [PATCH 21/25] Update nuxt.config.js --- docs/nuxt.config.js | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/nuxt.config.js b/docs/nuxt.config.js index b45ef102e67..d0ba9a2147e 100644 --- a/docs/nuxt.config.js +++ b/docs/nuxt.config.js @@ -138,6 +138,7 @@ renderer.table = function() { const isProdDocs = process.env.VERCEL_GITHUB_ORG === 'bootstrap-vue' && process.env.VERCEL_GITHUB_REPO === 'bootstrap-vue' && + true && process.env.VERCEL_GITHUB_COMMIT_REF === 'master' // --- Main export --- From 350939706a93abd40b8e9e8711e5841e85bc31cf Mon Sep 17 00:00:00 2001 From: Troy Morehouse Date: Sun, 26 Apr 2020 07:36:06 -0300 Subject: [PATCH 22/25] Update nuxt.config.js --- docs/nuxt.config.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/nuxt.config.js b/docs/nuxt.config.js index d0ba9a2147e..ef7d17b2f48 100644 --- a/docs/nuxt.config.js +++ b/docs/nuxt.config.js @@ -138,8 +138,8 @@ renderer.table = function() { const isProdDocs = process.env.VERCEL_GITHUB_ORG === 'bootstrap-vue' && process.env.VERCEL_GITHUB_REPO === 'bootstrap-vue' && - true && - process.env.VERCEL_GITHUB_COMMIT_REF === 'master' + true + // process.env.VERCEL_GITHUB_COMMIT_REF === 'master' // --- Main export --- From 8361e3a829ef958f087960fe9f9800c7a474a96c Mon Sep 17 00:00:00 2001 From: Troy Morehouse Date: Sun, 26 Apr 2020 07:43:46 -0300 Subject: [PATCH 23/25] Update nuxt.config.js --- docs/nuxt.config.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/docs/nuxt.config.js b/docs/nuxt.config.js index ef7d17b2f48..0f27fd0e979 100644 --- a/docs/nuxt.config.js +++ b/docs/nuxt.config.js @@ -138,8 +138,7 @@ renderer.table = function() { const isProdDocs = process.env.VERCEL_GITHUB_ORG === 'bootstrap-vue' && process.env.VERCEL_GITHUB_REPO === 'bootstrap-vue' && - true - // process.env.VERCEL_GITHUB_COMMIT_REF === 'master' + true // process.env.VERCEL_GITHUB_COMMIT_REF === 'master' // --- Main export --- From e28e78fcc7873ab3151a1301f7cc7e0d9706bbcf Mon Sep 17 00:00:00 2001 From: Troy Morehouse Date: Sun, 26 Apr 2020 08:06:51 -0300 Subject: [PATCH 24/25] Update nuxt.config.js --- docs/nuxt.config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/nuxt.config.js b/docs/nuxt.config.js index 0f27fd0e979..b45ef102e67 100644 --- a/docs/nuxt.config.js +++ b/docs/nuxt.config.js @@ -138,7 +138,7 @@ renderer.table = function() { const isProdDocs = process.env.VERCEL_GITHUB_ORG === 'bootstrap-vue' && process.env.VERCEL_GITHUB_REPO === 'bootstrap-vue' && - true // process.env.VERCEL_GITHUB_COMMIT_REF === 'master' + process.env.VERCEL_GITHUB_COMMIT_REF === 'master' // --- Main export --- From 46831dbe094478768a348d45c6c9b5809ca9e982 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jacob=20M=C3=BCller?= Date: Sun, 26 Apr 2020 16:59:16 +0200 Subject: [PATCH 25/25] Update nuxt.config.js --- docs/nuxt.config.js | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/docs/nuxt.config.js b/docs/nuxt.config.js index b45ef102e67..694c733559b 100644 --- a/docs/nuxt.config.js +++ b/docs/nuxt.config.js @@ -21,6 +21,13 @@ const RX_CODE_FILENAME = /^\/\/ ([\w,\s-]+\.[A-Za-z]{1,4})\n/m const ANCHOR_LINK_HEADING_LEVELS = [2, 3, 4, 5] +// Determine if documentation generation is published production docs +// Must be from 'bootstrap-vue/bootstrap-vue' repo 'master' branch +const IS_PROD_DOCS = + process.env.VERCEL_GITHUB_ORG === 'bootstrap-vue' && + process.env.VERCEL_GITHUB_REPO === 'bootstrap-vue' && + process.env.VERCEL_GITHUB_COMMIT_REF === 'master' + // --- Utility methods --- // Get routes by a given dir @@ -133,13 +140,6 @@ renderer.table = function() { return `
${table}
` } -// Determine if documettion generation is published prod docs -// Must be from bootstrap-vue/bootstrap-vue repo master branch -const isProdDocs = - process.env.VERCEL_GITHUB_ORG === 'bootstrap-vue' && - process.env.VERCEL_GITHUB_REPO === 'bootstrap-vue' && - process.env.VERCEL_GITHUB_COMMIT_REF === 'master' - // --- Main export --- module.exports = { @@ -288,20 +288,20 @@ module.exports = { // We enable crawling in production docs only robots: () => { // In production docs we allow crawling, else we deny crawling - return [isProdDocs ? { UserAgent: '*', Allow: '/' } : { UserAgent: '*', Disallow: '/' }] + return [IS_PROD_DOCS ? { UserAgent: '*', Allow: '/' } : { UserAgent: '*', Disallow: '/' }] }, // We only include a populated `sitemap.xml` in production docs sitemap: { // Sitemaps requires a hostname, so we use localhost in // non-prod mode just to make the sitemap module happy - hostname: isProdDocs ? BASE_URL : 'http://localhost', - // Exclude all static routes when not prod. Exclude - // only redirect routes in prod. - exclude: isProdDocs ? ['/docs/misc', '/docs/misc/**', '/docs/layout'] : ['/', '/**'], - // Include dynamic slug routes (from generate.routes) in prod, while - // in non prod docs we do not include dynamic routes (empty array) - ...(isProdDocs ? {} : { routes: [] }) + hostname: IS_PROD_DOCS ? BASE_URL : 'http://localhost', + // Exclude all static routes when not prod + // Exclude only redirect routes in prod + exclude: IS_PROD_DOCS ? ['/docs/misc', '/docs/misc/**', '/docs/layout'] : ['/', '/**'], + // Include dynamic slug routes (from `generate.routes`) in prod, while + // in non-prod docs we do not include dynamic routes (empty array) + ...(IS_PROD_DOCS ? {} : { routes: [] }) }, head: {