Add link back to main site in log4brains
eagerestwolf opened this issue · 1 comments
Feature Request
Feature Suggestion
So, huge fan of the project so far, but I would love to see some more customization. I have multiple ideas, but I think this is great start. Since Log4brains is intended to be installed into a subfolder (i.e. log4brains
), why not have the ability to return back to the documentation/project site?
Context
- This would improve usability
- It allows for separation of concerns (one of the main things ADRs attempt to accomplish)
- Prevents a user from needing to navigate around manually
- Allows for better engagement on the analytics end (I don't really care about this, but some do)
- It's a no brainer
Possible Implementation
I could see two ways to accomplish this solution. One kinda easy and one kinda janky. The easy solution would be to have an option in the .log4brains.yml
file to enable a link back to root (maybe linkToRoot: boolean
). The janky solution would be to attempt to have the web application itself attempt to determine if it is indeed in a subdirectory and automatically generate the link back to the root. Either solution should be easy to implement since we have access to the location in the browser:
// You can have this one for free
const url = `${window.location.scheme}://${window.location.host}/`;
Alternatively, you could take the MKDocs or Docsify approach and allow users to define a top level navigation menu in the configuration file. For example (this is an MKDocs example since it seems like log4brains drew a lot of inspiration from that project):
nav:
- Home: 'index.md'
- Docs: '/'
I don't really know the structure of your project, so I don't think a PR would be all that helpful, plus I have my own style that doesn't always mesh well with other projects very well (hint: I am a former C# developer/TypeScript is the bee's knees).
Ok, so revision to my issue. It turns out that when using log4brains
inside a subfolder within another static site generator (like MKDocs), it breaks log4brains
, but the navigation link does link back to the main site. So, I guess the real feature suggestion here should be can we make it so log4brains
plays nicely with another static site generator? I mean, it's all well and good that log4brains
creates it's own site, but it shouldn't be my entire project site.