Skip to content

Commit

Permalink
partials with resources; connection.yml permissions
Browse files Browse the repository at this point in the history
  • Loading branch information
essenciary committed Feb 16, 2022
1 parent 91eca06 commit fbd799c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "Genie"
uuid = "c43c736e-a2d1-11e8-161f-af95117fbd1e"
authors = ["Adrian Salceanu <[email protected]>"]
version = "4.12.0"
version = "4.13.0"

[deps]
ArgParse = "c7e460c6-2fb9-53a9-8c5b-16f535851c63"
Expand Down
2 changes: 2 additions & 0 deletions src/Generator.jl
Original file line number Diff line number Diff line change
Expand Up @@ -570,6 +570,8 @@ Writes the default configuration for the selected SearchLight DB adapter.
macro write_db_config(connfile = joinpath("db", "connection.yml"),
initfile = joinpath("config", "initializers", "searchlight.jl"))
quote
isfile($connfile) && chmod($connfile, 0o760)

open($connfile, "w") do f
write(f, SearchLight.Generator.FileTemplates.adapter_default_config(database = Genie.config.app_env, env = Genie.config.app_env))
end
Expand Down
9 changes: 6 additions & 3 deletions src/renderers/Html.jl
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ const DEFAULT_LAYOUT_FILE = :app
const LAYOUTS_FOLDER = "layouts"

const HTML_FILE_EXT = ".jl"
const TEMPLATE_EXT = ".jl.html"
const TEMPLATE_EXT = [".jl.html", ".jl"]
const MARKDOWN_FILE_EXT = [".md", ".jl.md"]

const SUPPORTED_HTML_OUTPUT_FILE_FORMATS = [TEMPLATE_EXT]
const SUPPORTED_HTML_OUTPUT_FILE_FORMATS = TEMPLATE_EXT

const HTMLParser = EzXML

Expand Down Expand Up @@ -861,10 +861,13 @@ function partial(path::String; context::Module = @__MODULE__, kwvars...) :: Stri

template(path, partial = true, context = context)
end

function partial(path::Genie.Renderer.FilePath; context::Module = @__MODULE__, kwvars...)
partial(string(path); context = context, kwvars...)
end
function partial(resource::Genie.Renderer.ResourcePath, view::Genie.Renderer.ResourcePath, args...; kwargs...)
partial(joinpath(Genie.config.path_resources, string(resource), Renderer.VIEWS_FOLDER, string(view)), args...; kwargs...)
end


"""
template(path::String; partial::Bool = true, context::Module = @__MODULE__, vars...) :: String
Expand Down

2 comments on commit fbd799c

@essenciary
Copy link
Member

Choose a reason for hiding this comment

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

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

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

Registration pull request created: JuliaRegistries/General/54778

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v4.13.0 -m "<description of version>" fbd799c6ae7ca34952f3ba22e1ac8a1957ff779b
git push origin v4.13.0

Please sign in to comment.