diff --git a/docs/middleware/recent.js b/docs/middleware/recent.js deleted file mode 100644 index a27d97067..000000000 --- a/docs/middleware/recent.js +++ /dev/null @@ -1,3 +0,0 @@ -export default function ({ store, route }) { - store.commit('addRecent', route) -} diff --git a/docs/nuxt.config.js b/docs/nuxt.config.js index 99adabf38..d2e223096 100644 --- a/docs/nuxt.config.js +++ b/docs/nuxt.config.js @@ -46,8 +46,4 @@ export default { build: {}, telemetry: true, - - router: { - middleware: 'recent', - } } diff --git a/docs/store/mutations.js b/docs/store/mutations.js index 9d03397e0..bb5f04545 100644 --- a/docs/store/mutations.js +++ b/docs/store/mutations.js @@ -1,13 +1,14 @@ export default { // TODO: add ability to pin items // TODO: add support for page titles - addRecent(state, route) { + addRecent(state, link) { // Filter out current route. - const recent = [...state.recent].filter((o) => o.to !== route.path) + const recent = [...state.recent].filter((o) => o.to !== link.to) // Add item. recent.unshift({ - to: route.path + text: link.text, + to: link.to, }) // Return only the last 5 items.