research-software-directory / documentation

This repository contains the user documentation for the Research Software Directory
0 stars 3 forks source link

feat: allow loading of custom configuration #6

Closed cmeessen closed 1 year ago

cmeessen commented 1 year ago

This PR implements the option for a custom configuration file.

It will allow to customise anything related to the vuepress configuraiton of the documentation. This way, a fork of this documentation can be hosted without having to diverge from this repository.

How to test:

I am not sure whether the try approach is the best, but it works. I am open for suggestions though .

jmaassen commented 1 year ago

I'm having an issue testing this PR.

Running without the custom_config.js works as expected. The console prints the following:

No custom configuration found. Using standard configuration.
info Initializing VuePress and preparing data...

   vite v2.9.4 dev server running at:
    > Local:    http://localhost:3030/documentation/

and the documentation works as expected on that URL.

However, when I copy the config.js to custom_config.js, followed by a yarn dev, it seems that neither are picked up properly anymore? The console also shows the following:

info Initializing VuePress and preparing data...

  vite v2.9.4 dev server running at:
  > Local:    http://localhost:8080/

The "No custom configuration found. Using standard configuration." line has disappeared as expected, but the port and URL have changed. When going there, it does not properly show the documentation anymore, just parts?

Maybe I'm doing something wrong? Or using an outdated version?

cmeessen commented 1 year ago

My bad, sorry! I wrote to copy paste the config.js custom_config.js. But this is not enough, as in the custom_config.js it will try to load itself again. This is why it's not working. You need to remove these lines:

try {
  conf = require('./custom_config')
} catch (ex) {
  console.log("No custom configuration found. Using standard configuration.")
}

I will update the description in a second, and also update the README for the documentation.

cmeessen commented 1 year ago

Closing because this feature is not required from our side anymore.