tlienart / Franklin.jl

(yet another) static site generator. Simple, customisable, fast, maths with KaTeX, code evaluation, optional pre-rendering, in Julia.
https://franklinjl.org
MIT License
951 stars 113 forks source link

Bug report: Franklin.jl stops entirely if page_foot.html was deleted #897

Open schlichtanders opened 2 years ago

schlichtanders commented 2 years ago

Just was surprised that a simple deletion of _layout/page_foot.html killed my running Franklin server

I think it would be very apt to fall back to empty content instead of throwing such an error. Using Franklin v0.10.59 on Julia 1.6.1.

ERROR: SystemError: opening file "/home/ssahm/Projects/JuliaPerformance/JuliaPerformance.gitlab.io/_layout/page_foot.html": No such file or directory
Stacktrace:
  [1] systemerror(p::String, errno::Int32; extrainfo::Nothing)
    @ Base ./error.jl:168
  [2] #systemerror#62
    @ ./error.jl:167 [inlined]
  [3] systemerror
    @ ./error.jl:167 [inlined]
  [4] open(fname::String; lock::Bool, read::Nothing, write::Nothing, create::Nothing, truncate::Nothing, append::Nothing)
    @ Base ./iostream.jl:293
  [5] open
    @ ./iostream.jl:282 [inlined]
  [6] open(f::Base.var"#326#327"{String}, args::String; kwargs::Base.Iterators.Pairs{Union{}, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
    @ Base ./io.jl:328
  [7] open
    @ ./io.jl:328 [inlined]
  [8] read
    @ ./io.jl:434 [inlined]
  [9] fd_fullpass(watched_files::NamedTuple{(:other, :infra, :md, :html, :literate), NTuple{5, Dict{Pair{String, String}, Float64}}}, join_to_prepath::String)
    @ Franklin ~/.julia/packages/Franklin/tWDGK/src/manager/franklin.jl:233
 [10] serve(; clear::Bool, verb::Bool, port::Int64, single::Bool, prerender::Bool, nomess::Bool, is_final_pass::Bool, no_fail_prerender::Bool, eval_all::Bool, silent::Bool, cleanup::Bool, on_write::Franklin.var"#236#239", log::Bool, host::String, show_warnings::Bool, fail_on_warning::Bool, launch::Bool, no_set_paths::Bool, join_to_prepath::String)
    @ Franklin ~/.julia/packages/Franklin/tWDGK/src/manager/franklin.jl:124
 [11] serve()
    @ Franklin ~/.julia/packages/Franklin/tWDGK/src/manager/franklin.jl:70
 [12] top-level scope
    @ none:1
tlienart commented 2 years ago

Yes that's right (see also https://github.com/tlienart/Franklin.jl/issues/825) I'm not against defaulting to "" if the file is not there.

(for future version it will follow #825 but we could do the default before that)