Skip to content

Commit

Permalink
Support more kwargs to generate(::String)
Browse files Browse the repository at this point in the history
  • Loading branch information
fonsp committed Aug 10, 2024
1 parent 41b228a commit 96fe01e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "PlutoPages"
uuid = "d5dc3dd1-4774-47c7-8860-0a1ad9e34b8c"
authors = ["Luca Ferranti", "Fons van der Plas"]
version = "0.1.4"
version = "0.1.5"

[deps]
BetterFileWatching = "c9fd44ac-77b5-486c-9482-9798bd063cc6"
Expand Down
6 changes: 3 additions & 3 deletions src/PlutoPages.jl
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@ function create_subdirs(root_dir::String)
)
end

function develop(root_dir::String)
develop(;create_subdirs(root_dir)...)
function develop(root_dir::String; kwargs...)
develop(;create_subdirs(root_dir)..., kwargs...)
end


Expand Down Expand Up @@ -199,7 +199,7 @@ function generate(;
return output_dir
end

generate(root_dir::String) = generate(;create_subdirs(root_dir)...)
generate(root_dir::String; kwargs...) = generate(;create_subdirs(root_dir)..., kwargs...)


function create_test_basic_site()
Expand Down
6 changes: 4 additions & 2 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ using Test

dirs = PlutoPages.create_subdirs(input_dir)

result = PlutoPages.generate(; dirs...)
html_report_path = tempname(cleanup=false)

result = PlutoPages.generate(; dirs..., html_report_path)
@test result == dirs.output_dir

@info "Done!" dirs readdir(dirs.input_dir) readdir(dirs.output_dir)
Expand All @@ -22,5 +24,5 @@ using Test
@test isfile(joinpath(dirs.output_dir, "en", "blog", "something", "index.html"))
@test isfile(joinpath(dirs.output_dir, "en", "blog", "yayy", "index.html"))


@test isfile(html_report_path)
end

0 comments on commit 96fe01e

Please sign in to comment.