-
Notifications
You must be signed in to change notification settings - Fork 10
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
Add templating syntax and support for the .uor file extension #3
Conversation
85fa98b
to
db3eb07
Compare
db3eb07
to
9711fdc
Compare
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.
A couple nits. Overall looks good.
builder/builder.go
Outdated
return nil | ||
} | ||
|
||
// mergeLinkData will merge any references to in-content links with | ||
// the currently calculated values. | ||
func mergeLinkData(in, curr map[string]interface{}) map[string]interface{} { | ||
for key := range in { | ||
//fmtVal := parser.ConvertFilenameForGoTemplateValue(in[key].(string)) |
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.
Stale comment?
builder/parser/parser.go
Outdated
@@ -36,6 +36,11 @@ func (e *ErrInvalidFormat) Error() string { | |||
// ByContentType returns a parser based on the detected content type. | |||
func ByContentType(filename string, data []byte) (Parser, error) { | |||
mType := mimetype.Detect(data) | |||
// The .uor extension queues the |
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.
I think this comment might be unfinished.
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.
Looks good. Ignoring the linting failure for Windows for now as it is unrelated to this pull request. I will submit a subsequent PR to fix it.
Update
PR submitted for Windows fix #15
Adds support for UOR templating syntax and the .uor file extension. If a file has the
.uor
extension, ignore the mediatype and look for templating syntax.Templating syntax is prefixed with
__uor.
and suffixed with__
. i.e.__uor.path/to/file.jpeg__