Skip to content

Commit

Permalink
Adjusting paths on page include
Browse files Browse the repository at this point in the history
  • Loading branch information
Etiene committed Aug 10, 2015
1 parent 3bc341b commit 2737616
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/sailor.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
--------------------------------------------------------------------------------
-- sailor.lua, v0.4.6: core functionalities of the framework
-- sailor.lua, v0.4.7: core functionalities of the framework
-- This file is a part of Sailor project
-- Copyright (c) 2014 Etiene Dalcol <[email protected]>
-- License: MIT
Expand Down Expand Up @@ -59,6 +59,7 @@ end
-- Stores the path of the application in sailor.path
function sailor.set_application_path(r)
local dir = lfs.currentdir()

if dir == '/' or not dir then
local filename = r.uri:match( "([^/]+)$")
sailor.path = r.filename:match("^@?(.-)/"..filename.."$")
Expand Down Expand Up @@ -140,8 +141,8 @@ end
-- parms: table, vars being passed ahead
function Page:include(path,parms)
parms = parms or {}
local incl_src = read_src(((sailor.path):match('(.*)'..self.base_path:gsub('-','%%-') ) or '')..path)

local incl_src = read_src(sailor.path..'/'..path)
incl_src = lp.translate(incl_src)
parms.page = self
render_page(path,incl_src,parms)
Expand Down

0 comments on commit 2737616

Please sign in to comment.