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

Properties front matter #28

Merged
merged 16 commits into from
Sep 30, 2016
Merged

Properties front matter #28

merged 16 commits into from
Sep 30, 2016

Conversation

gsechaud
Copy link
Contributor

@gsechaud gsechaud commented Sep 26, 2016

Global support for properties at page level.
For now, only support for "out" and "layout" properties.

resolve #15

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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be markdown?

Copy link
Contributor Author

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!

Copy link
Contributor

@eed3si9n eed3si9n left a 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 = '$') {
Copy link
Contributor

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?

Copy link
Contributor

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.

Copy link
Contributor

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))
Copy link
Contributor

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.

Copy link
Member

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

@eed3si9n
Copy link
Contributor

I'm going to merge as is, and we can add the HOCON (Typesafe Config) support later.

@eed3si9n eed3si9n merged commit 0fdbdac into lightbend:master Sep 30, 2016
@gsechaud gsechaud deleted the propFrontMatter branch October 3, 2016 07:43
This was referenced Oct 10, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

properties front matter
4 participants