-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Feat: Add a blog configuration with yaml #17214
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Florian3k
reviewed
May 2, 2023
- Add input config, who allow to define the path import - Add output config, who allow to define the path destination - Add hidden, who allow to not generate the blog
947963b
to
cef79e9
Compare
Florian3k
reviewed
May 9, 2023
Florian3k
approved these changes
May 9, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, I left one small suggestion.
Corrected, thank you for the feedback @Florian3k. I proposed a documentation related to this on docs.scala-lang: scala/docs.scala-lang#2796 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Should I add warnings? For example when the path is not found. If so, how do I test? Because the path is searched for _blog but it is not found so the assert that asks for no warnings does not work as in this one.
Here is my proposal to add a blog configuration using a .yaml in the same place as the sidebar.yaml. This feature request is a bit old but I thought it would be interesting to create it to give a bit more flexibility to Scaladoc users.
This first PR allows me to validate with you if this feature is good to implement and also to have some feedbacks I answer well to what is asked and that my code is relevant. So if it is the case, I will do the tests and the associated documentation.
TO-DO list:
Will be implemented in docs.scala-lang, PR #2796:
Blog Configuration Documentation
Blog configuration is an important aspect of any blog platform. In order to customize the configuration of a blog, it is often necessary to modify the default settings. In this document, we will explain how to change the default config of a blog documentation with a file blog.yaml.
In order to modify the default settings of the blog documentation, users need to create a file named "blog.yaml" in the root directory of the blog. The file should contain the parameters that the user wants to change. For example, if a user wants to change the input directory to "my_posts", the output directory to "my_docs", and temporarily hide the blog, they can create a file with the following content:
blog.yaml:
Parameters:
The blog.yaml file is a configuration file that allows users to modify the default settings of their blog documentation. The following parameters can be configured in the blog.yaml file:
input: This parameter specifies the directory where the markdown pages and other files will be taken for the blogs page. By default, this is set to the "_posts" folder in the "docs" directory of the blog. However, users can change this to any other directory in "docs".
output: This parameter specifies the folder where the HTML pages will be generated. By default, this is set to the "blog" folder in the "target/docs" directory. However, users can change this to any other directory on "target/docs".
hidden: This parameter allows users to hide or unhide the blog temporarily. By default, this is set to "false", which means that the blog is visible to all users. However, if a user wants to temporarily hide the blog, they can set this parameter to "true". This can be useful if the user wants to make some changes to the blog and doesn't want anyone to see the changes until they are ready.
Once the file is created, the user needs to save it in the root directory of the blog. The next time the blog is built, the new settings will be applied.
Example (Success)
Code & Input
Result
First example (Hidden)
Code
Result
Example (Error)
Fixes: #14487