Skip to content

Commit

Permalink
more function splitting
Browse files Browse the repository at this point in the history
  • Loading branch information
fonsp committed Feb 11, 2024
1 parent 92d755f commit 04acb2b
Showing 1 changed file with 15 additions and 10 deletions.
25 changes: 15 additions & 10 deletions src/PlutoPages.jl
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,24 @@ function run_plutopages_notebook(;
cache_dir::String,
kwargs...
)
mkpath(output_dir)
mkpath(cache_dir)
run_with_replacements(
PlutoPages_notebook_path,
Dict(
:input_dir => input_dir,
:output_dir => output_dir,
:cache_dir => cache_dir,
);
plutopages_replacements(; input_dir, output_dir, cache_dir);
kwargs...
)
end

function plutopages_replacements(;
input_dir::String,
output_dir::String,
cache_dir::String,
)
Dict(
:input_dir => input_dir,
:output_dir => output_dir,
:cache_dir => cache_dir,
)
end


function create_subdirs(root_dir::String)
Expand All @@ -47,8 +52,8 @@ function create_subdirs(root_dir::String)

(;
input_dir = joinpath(root_dir, "src"),
output_dir = joinpath(root_dir, "_site"),
cache_dir = joinpath(root_dir, "_cache"),
output_dir = mkpath(joinpath(root_dir, "_site")),
cache_dir = mkpath(joinpath(root_dir, "_cache")),
)
end

Expand Down Expand Up @@ -131,7 +136,7 @@ function generate(;
end

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


function create_test_basic_site()
original = joinpath(dirname(@__DIR__), "test", "basic_site")
Expand Down

0 comments on commit 04acb2b

Please sign in to comment.