Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace hard-coded links/text with siteConfig variables #488

Closed
Happy-Ferret opened this issue Mar 7, 2018 · 5 comments
Closed

Replace hard-coded links/text with siteConfig variables #488

Happy-Ferret opened this issue Mar 7, 2018 · 5 comments
Labels
difficulty: starter Issues that are starter difficulty level, e.g. minimal tweaking with a clear test plan. feature This is not a bug or issue with Docusausus, per se. It is a feature request for the future. good first issue If you are just getting started with Docusaurus, this issue should be a good place to begin. status: claimed Issue has been claimed by a contributor who plans to work on it.

Comments

@Happy-Ferret
Copy link
Contributor

Is this a bug report?

No.

It's a PR proposal/RFC.

Have you read the Contributing Guidelines on issues?

Yes

Environment

(OS, Node, npm, yarn)

OS: Windows 8.1
Node: v6.10.3
npm: 3.10.10

Steps to Reproduce

  1. Create new project utilizing docusaurus-init.
  2. Set siteConfig properties such as copyright: or baseUrl:.
  3. Serve docs.
  4. Check content of footer and help.html.
  5. (alternatively) Look inside files such as website/pages/en/help.js or website/core/footer.js (among others).

Expected Behavior

Copyright inside footer and help link should be set to properties set in siteConfig.js.

Actual Behavior

Copyright inside footer and help link are set to hard-coded defaults inside website/pages/en/help.js and website/core/footer.js.

Proposal

Replace the hard-coded links and text blocks with variables accessing siteConfig (i e this.props.config.copyright) by default.

This way new users won't be confused when the properties exposed in siteConfig.js aren't set on their personal builds.

@JoelMarcey
Copy link
Contributor

I think I would actually consider this on the border of feature request and bug 😄

Would you like to submit a PR for this?

@JoelMarcey JoelMarcey added feature This is not a bug or issue with Docusausus, per se. It is a feature request for the future. good first issue If you are just getting started with Docusaurus, this issue should be a good place to begin. difficulty: starter Issues that are starter difficulty level, e.g. minimal tweaking with a clear test plan. labels Mar 7, 2018
@Happy-Ferret
Copy link
Contributor Author

Absolutely I would.

That's why I called it PR proposal. ;)

@JoelMarcey JoelMarcey added the status: claimed Issue has been claimed by a contributor who plans to work on it. label Mar 8, 2018
@JoelMarcey
Copy link
Contributor

@Happy-Ferret All right. I consider this issue claimed then 😄

Happy-Ferret added a commit to Happy-Ferret/Docusaurus that referenced this issue Mar 9, 2018
Replace hardcoded values inside "footer",
"help" and "users" with properties
from siteConfig.

Fixes facebook#488
@Happy-Ferret
Copy link
Contributor Author

Unless there's something I haven't considered (code style? Additional occurrences of hard-coded values one could easily get rid of?), I'll create the PR later today.

@Happy-Ferret
Copy link
Contributor Author

FYI. My current implementation replaces the editUrl inside users.html, too.
Figured we could just base this on siteConfig.repoUrl + /edit/master/website/siteConfig.js.

Although in the future it might make sense to modify the siteConfig API and retarget editUrl: so it can be applied to more than just docs (I'm thinking an array would be nice).

Happy-Ferret added a commit to Happy-Ferret/Docusaurus that referenced this issue Mar 14, 2018
Replace hardcoded values inside "footer",
"help" and "users" with properties
from siteConfig.

Fixes facebook#488
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
difficulty: starter Issues that are starter difficulty level, e.g. minimal tweaking with a clear test plan. feature This is not a bug or issue with Docusausus, per se. It is a feature request for the future. good first issue If you are just getting started with Docusaurus, this issue should be a good place to begin. status: claimed Issue has been claimed by a contributor who plans to work on it.
Projects
None yet
Development

No branches or pull requests

2 participants