Add docs class to body tag

Feature request:

Could a docs class be added to the <body> tag on the /docs page?

This would allow using css to customize the header for the docs page only.

Solved it in an ugly way:

<script type="text/discourse-plugin" version="0.8">
api.onPageChange((url) => {
  if(window.location.pathname == "/docs") {
    document.querySelector("body").classList.add("docs");
  }
  else {
    document.querySelector("body").classList.remove("docs");
  }
})
</script>

Put it here:

1 Like