diff options
author | Jeffrey Armstrong <jeff@approximatrix.com> | 2021-05-20 10:53:59 -0400 |
---|---|---|
committer | Jeffrey Armstrong <jeff@approximatrix.com> | 2021-05-20 10:53:59 -0400 |
commit | 09e05b225bbea43d77ee1edfb896e5cdef43c145 (patch) | |
tree | c002b33ae0dfa6669d73f9316408a113de96c36c /captain/web.f90 | |
parent | 6e4ef96cb49b02ab3f2a9b8bc17dbacc6001c002 (diff) | |
download | levitating-09e05b225bbea43d77ee1edfb896e5cdef43c145.tar.gz levitating-09e05b225bbea43d77ee1edfb896e5cdef43c145.zip |
Added ability to extend templates if desired. Used in Home and About links.
Diffstat (limited to 'captain/web.f90')
-rw-r--r-- | captain/web.f90 | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/captain/web.f90 b/captain/web.f90 index bb225ac..cc3a552 100644 --- a/captain/web.f90 +++ b/captain/web.f90 @@ -569,6 +569,7 @@ contains type(request), intent(in)::req type(response)::resp + character(64)::template_to_use character(1024)::template_file type(template)::page character(64)::first @@ -576,7 +577,25 @@ contains character(len=:), pointer::contents character(128)::job_page_title - call template_filepath("index.html", template_file) + + if(trim(req%location) == "/" .or. & + trim(req%location) == "/index.html" .or. & + trim(req%location) == "/home.html") & + then + + template_to_use = "home.html" + + else if(trim(req%location) == "/about.html") then + + template_to_use = "about.html" + + else + + template_to_use = "index.html" + + end if + + call template_filepath(template_to_use, template_file) call write_log("Template base path is: "//trim(template_file), LOG_DEBUG) call page%init(trim(template_file)) |