The best way to use the server language for development, but deployment in static HTML

We have a client for whom we create many sites based on templates. Ideally, we would use something like kohana ( http://www.kohanaphp.com/ ) to process templates and make site changes wide.

Unfortunately, our client cannot (and will not) post any code on the server side (and before you ask, this will not change, and the placement of the files themselves is not an option), so any files deployed for them, Must be HTML, Javascript, CSS, Images and Flash.

Is there a good way to develop in an environment such as kohana to make the site manageable, but to be able to deploy or export only the HTML version of the site (there is no dynamic aspect for the site, such as search, which requires server languages ​​and no database usage )?

I assume that it will look like a spidering on a site, but I would like something more reliable, because some page resources are loaded dynamically using javascript.

thanks

+3
source share
6 answers

Template Toolkit (Perl) script, . , ( ..).

ttree, .

tt.rc, :

# ignore these files (regular expressions)
ignore = \.svn
ignore = ^#
ignore = ~$
ignore = .DS_Store
ignore = \.tt$

# if these template files change, reprocess everything
depend *=tpl/wrapper,tpl/defaults,style/default.html

# just copy these files, don't process as templates
copy = \.(gif|png|pdf|jpg)$

# verbose output
verbose

# recurse into subdirectories
recurse

# setup some defaults from tpl/defaults
pre_process = tpl/defaults

# process this file instead of the real file (see below how this is used)
process     = tpl/wrapper

# process files from src/, output to html/
# extra templates in lib/ (tpl/wrapper for example).
src  = src
dest = html
lib  = lib

tpl/defaults

[%-  page = {
            title = template.title,
            style = template.style or 'default.html'
    };

    base = INCLUDE tpl/base_uri;

    # don't include any whitespace from here...
    RETURN;
-%]

tpl/wrapper

[%- content = PROCESS $template;    
   IF !template.name.search('.html') OR page.style == 'none';
      content;
   ELSE;
      default_style_template = "style/" _ page.style;
      PROCESS $default_style_template;
   END;
%]

; content, style ( page.style tpl/defaults, - defaults.html).

lib/style/default.html

[% content %]

- ; .

Template Toolkit tt2.org.

- wget ( ) "" , PHP ; .

+1

WaveMaker Studio . .

WaveMaker Studio .

+1

, , . , " " (). . , - , IIS Apache - , - ? ( , , , "" - - , XSP).

, , google-gears. , , , .

, , . ( ). , "" , , .

, - , - .

0

... PHP ASP, , CGI, .

, dev, html. .

, .

0

- , , script , . , - , . PERL.

script , . , , . , , , , , HTML .

0

, , CushyCms. -CMS, CSS . FTP, , , .

0

Source: https://habr.com/ru/post/1713025/


All Articles