From 26ce20d019ede4bcd5172c852633c96d6864a801 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iv=C3=A1n=20Ovejero?= Date: Tue, 22 Jun 2021 15:51:35 +0200 Subject: [PATCH 1/3] 1 --- docs/.vuepress/components/Feedback.vue | 53 ++++++++++++++++++++++++++ docs/.vuepress/enhanceApp.js | 28 +++++++------- docs/.vuepress/theme-test/Layout.vue | 6 --- docs/.vuepress/theme/Layout.vue | 14 +++++++ docs/.vuepress/theme/index.js | 3 ++ 5 files changed, 85 insertions(+), 19 deletions(-) create mode 100644 docs/.vuepress/components/Feedback.vue delete mode 100644 docs/.vuepress/theme-test/Layout.vue create mode 100644 docs/.vuepress/theme/Layout.vue create mode 100644 docs/.vuepress/theme/index.js diff --git a/docs/.vuepress/components/Feedback.vue b/docs/.vuepress/components/Feedback.vue new file mode 100644 index 000000000..f36126b9f --- /dev/null +++ b/docs/.vuepress/components/Feedback.vue @@ -0,0 +1,53 @@ + + + + + diff --git a/docs/.vuepress/enhanceApp.js b/docs/.vuepress/enhanceApp.js index cc41c99b3..063962b9f 100644 --- a/docs/.vuepress/enhanceApp.js +++ b/docs/.vuepress/enhanceApp.js @@ -140,19 +140,21 @@ export default ({ router, siteData }) => { '#/troubleshooting?id=mmmagic-npm-package-when-using-msbuild-tools-with-visual-studio' : 'reference/troubleshooting.html#mmmagic-npm-package-when-using-msbuild-tools-with-visual-studio', }; - if (redirectPaths[window.location.hash] !== undefined) { - // Redirect to different page if defined - window.location.href = `${window.location.origin}/${redirectPaths[window.location.hash]}`; - } else if (location.hash) { - // Scroll to element - setTimeout(() => { - const id = location.hash.slice(1); - const targetElement = document.getElementById(id); - if (targetElement) { - const y = targetElement.getBoundingClientRect().top + window.pageYOffset; - window.scrollTo({ top: y, behavior: 'smooth' }); - } - }, 250) + if (typeof window !== 'undefined') { + if (redirectPaths[window.location.hash] !== undefined) { + // Redirect to different page if defined + window.location.href = `${window.location.origin}/${redirectPaths[window.location.hash]}`; + } else if (location.hash) { + // Scroll to element + setTimeout(() => { + const id = location.hash.slice(1); + const targetElement = document.getElementById(id); + if (targetElement) { + const y = targetElement.getBoundingClientRect().top + window.pageYOffset; + window.scrollTo({ top: y, behavior: 'smooth' }); + } + }, 250) + } } } diff --git a/docs/.vuepress/theme-test/Layout.vue b/docs/.vuepress/theme-test/Layout.vue deleted file mode 100644 index defd2b3df..000000000 --- a/docs/.vuepress/theme-test/Layout.vue +++ /dev/null @@ -1,6 +0,0 @@ - diff --git a/docs/.vuepress/theme/Layout.vue b/docs/.vuepress/theme/Layout.vue new file mode 100644 index 000000000..29a06af86 --- /dev/null +++ b/docs/.vuepress/theme/Layout.vue @@ -0,0 +1,14 @@ + + + diff --git a/docs/.vuepress/theme/index.js b/docs/.vuepress/theme/index.js new file mode 100644 index 000000000..48fc5efee --- /dev/null +++ b/docs/.vuepress/theme/index.js @@ -0,0 +1,3 @@ +module.exports = { + extend: '@vuepress/theme-default', +} From 9230e55cb7914e749e2af108824cf4c99d3296ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iv=C3=A1n=20Ovejero?= Date: Tue, 22 Jun 2021 16:15:36 +0200 Subject: [PATCH 2/3] Revert "Merge pull request #1 from ivov/add-feedback-and-fix-build" This reverts commit ece48b0a27d50e1c28f3fd0eca71140ff91982d9, reversing changes made to 1695ad26a3ccdb42e72ceea3576b9b7f3fe3ae45. --- docs/.vuepress/components/Feedback.vue | 53 -------------------------- docs/.vuepress/enhanceApp.js | 28 +++++++------- docs/.vuepress/theme-test/Layout.vue | 6 +++ docs/.vuepress/theme/Layout.vue | 14 ------- docs/.vuepress/theme/index.js | 3 -- 5 files changed, 19 insertions(+), 85 deletions(-) delete mode 100644 docs/.vuepress/components/Feedback.vue create mode 100644 docs/.vuepress/theme-test/Layout.vue delete mode 100644 docs/.vuepress/theme/Layout.vue delete mode 100644 docs/.vuepress/theme/index.js diff --git a/docs/.vuepress/components/Feedback.vue b/docs/.vuepress/components/Feedback.vue deleted file mode 100644 index f36126b9f..000000000 --- a/docs/.vuepress/components/Feedback.vue +++ /dev/null @@ -1,53 +0,0 @@ - - - - - diff --git a/docs/.vuepress/enhanceApp.js b/docs/.vuepress/enhanceApp.js index 063962b9f..cc41c99b3 100644 --- a/docs/.vuepress/enhanceApp.js +++ b/docs/.vuepress/enhanceApp.js @@ -140,21 +140,19 @@ export default ({ router, siteData }) => { '#/troubleshooting?id=mmmagic-npm-package-when-using-msbuild-tools-with-visual-studio' : 'reference/troubleshooting.html#mmmagic-npm-package-when-using-msbuild-tools-with-visual-studio', }; - if (typeof window !== 'undefined') { - if (redirectPaths[window.location.hash] !== undefined) { - // Redirect to different page if defined - window.location.href = `${window.location.origin}/${redirectPaths[window.location.hash]}`; - } else if (location.hash) { - // Scroll to element - setTimeout(() => { - const id = location.hash.slice(1); - const targetElement = document.getElementById(id); - if (targetElement) { - const y = targetElement.getBoundingClientRect().top + window.pageYOffset; - window.scrollTo({ top: y, behavior: 'smooth' }); - } - }, 250) - } + if (redirectPaths[window.location.hash] !== undefined) { + // Redirect to different page if defined + window.location.href = `${window.location.origin}/${redirectPaths[window.location.hash]}`; + } else if (location.hash) { + // Scroll to element + setTimeout(() => { + const id = location.hash.slice(1); + const targetElement = document.getElementById(id); + if (targetElement) { + const y = targetElement.getBoundingClientRect().top + window.pageYOffset; + window.scrollTo({ top: y, behavior: 'smooth' }); + } + }, 250) } } diff --git a/docs/.vuepress/theme-test/Layout.vue b/docs/.vuepress/theme-test/Layout.vue new file mode 100644 index 000000000..defd2b3df --- /dev/null +++ b/docs/.vuepress/theme-test/Layout.vue @@ -0,0 +1,6 @@ + diff --git a/docs/.vuepress/theme/Layout.vue b/docs/.vuepress/theme/Layout.vue deleted file mode 100644 index 29a06af86..000000000 --- a/docs/.vuepress/theme/Layout.vue +++ /dev/null @@ -1,14 +0,0 @@ - - - diff --git a/docs/.vuepress/theme/index.js b/docs/.vuepress/theme/index.js deleted file mode 100644 index 48fc5efee..000000000 --- a/docs/.vuepress/theme/index.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = { - extend: '@vuepress/theme-default', -} From e06d3aa20501ca26518c8009ce13d00a2db69ada Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iv=C3=A1n=20Ovejero?= Date: Tue, 22 Jun 2021 16:31:45 +0200 Subject: [PATCH 3/3] Attempt with empty Feedback and no window fix --- docs/.vuepress/components/Feedback.vue | 22 ++++++++++++++++++++++ docs/.vuepress/theme-test/Layout.vue | 6 ------ docs/.vuepress/theme/Layout.vue | 14 ++++++++++++++ docs/.vuepress/theme/index.js | 3 +++ 4 files changed, 39 insertions(+), 6 deletions(-) create mode 100644 docs/.vuepress/components/Feedback.vue delete mode 100644 docs/.vuepress/theme-test/Layout.vue create mode 100644 docs/.vuepress/theme/Layout.vue create mode 100644 docs/.vuepress/theme/index.js diff --git a/docs/.vuepress/components/Feedback.vue b/docs/.vuepress/components/Feedback.vue new file mode 100644 index 000000000..563480c43 --- /dev/null +++ b/docs/.vuepress/components/Feedback.vue @@ -0,0 +1,22 @@ + + + + + diff --git a/docs/.vuepress/theme-test/Layout.vue b/docs/.vuepress/theme-test/Layout.vue deleted file mode 100644 index defd2b3df..000000000 --- a/docs/.vuepress/theme-test/Layout.vue +++ /dev/null @@ -1,6 +0,0 @@ - diff --git a/docs/.vuepress/theme/Layout.vue b/docs/.vuepress/theme/Layout.vue new file mode 100644 index 000000000..29a06af86 --- /dev/null +++ b/docs/.vuepress/theme/Layout.vue @@ -0,0 +1,14 @@ + + + diff --git a/docs/.vuepress/theme/index.js b/docs/.vuepress/theme/index.js new file mode 100644 index 000000000..48fc5efee --- /dev/null +++ b/docs/.vuepress/theme/index.js @@ -0,0 +1,3 @@ +module.exports = { + extend: '@vuepress/theme-default', +}