diff options
Diffstat (limited to 'captain/external.f90')
-rw-r--r-- | captain/external.f90 | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/captain/external.f90 b/captain/external.f90 index 86efe94..aa65e71 100644 --- a/captain/external.f90 +++ b/captain/external.f90 @@ -4,18 +4,23 @@ implicit none contains - function external_request_gemini(request) result(renderunit) + function external_request_gemini(request) result(disk_filename) use page_template + use config, only: template_filepath + use logging, only: write_log implicit none character(*), intent(in)::request + character(len=:), pointer::disk_filename integer::renderunit character(1024)::template_file type(template)::page + character(16)::log_tmp ! Open the base template call template_filepath("index.gmi", template_file) - call page%init(template_file) + + call page%init(trim(template_file)) if(trim(request) == "/" .or. trim(request) == "/index.gmi") then @@ -42,11 +47,11 @@ contains call page%assign('title', 'Not Found') end if - - open(newunit=renderunit, form="formatted", status="scratch", access='stream') - - call page%render(renderunit) + + call page%render() + disk_filename => page%output_filename + end function external_request_gemini end module external_handling
\ No newline at end of file |