-
Notifications
You must be signed in to change notification settings - Fork 77
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
Properties front matter #28
Conversation
The `out` property allows to rename the target name of the current file. | ||
And the `layout` allows to specify the layout we want to be used for this particular page, the layouts are placed by default in the `target/paradox/theme` folder: | ||
|
||
```scala |
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.
This should be markdown
?
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.
Yes of course, my bad!
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.
Is there a test for rendering the following:
---
foo: bar
---
$foo$
as "bar"?
|
||
/** | ||
* Page template writer. | ||
*/ | ||
class PageTemplate(directory: File, startDelimiter: Char = '$', stopDelimiter: Char = '$', name: String = "page") { | ||
class PageTemplate(directory: File, name: String = PageTemplate.DefaultName, startDelimiter: Char = '$', stopDelimiter: Char = '$') { |
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.
Could you add test for layout feature?
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.
Here's what I used for testing https://github.com/eed3si9n/tech-hub-landing-page/tree/wip/layout_check, which didn't work for me.
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.
After fixing the typo in my test, it seems to be working now. We should still add tests though.
val p = new java.util.Properties | ||
for (s <- str) { | ||
val q = new java.util.Properties | ||
q.load(new StringReader(s)) |
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.
Given that Typesafe Config is the most awesome config reader on the JVM, it would be interesting to eventually switch to that for managing properties in Paradox and allow more flexible types and loading of properties.
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.
Yes, would be really nice to use Typesafe Config. There could be some inspiration in the way Stefan's Ornate uses Config: https://github.com/szeiger/ornate
I'm going to merge as is, and we can add the HOCON (Typesafe Config) support later. |
Global support for properties at page level.
For now, only support for "out" and "layout" properties.
resolve #15