Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Added Matomo 404 page tracking.
This is referring to this issue.
This is a huge PR, I tried to overwrite the 404 page with no success and nothing on the web worked.
It seems like when you create the
.vuepress/theme
directory Vuepress is treating it like a whole new theme which lead me to copy the entire theme to this directory. (Believe me I read through their whole docs this does not work 😞, or anything alike for that matter)Then I had to remove the script tag from the header tag in the
.vuepress/config.js
file since this script tag is on every page (including the 404 page), I cannot simply "Add the Matomo tracking code in this custom 404 page...before the line" since it's in the header and cannot be changed from the404.vue
layout file.The solution I came up with is to use the needed JavaScript for pages in the
Layout.vue
file:And the needed JavaScript for 404s in the
404.vue
file:I proved that this works by generating the site and checking all of the js files (yes I went one by one) to see if they include the needed JavaScript:
404 page:
HTML tag:
JavaScript:
Any page:
HTML tag:
JavaScript:
List of changes:
.vuepress/theme
directory..vuepress/config.js
file.Layout,vue
file.404.vue
file.I know these are huge changes, let me know what you guys think.
Maybe I missed something. 😄