3

複数のhtmlファイルがあり、それらを1つのhtmlファイルに結合します。これらの複数のファイルは、複数のファイルに共通するヘッダー、フッターなどのようなものです。私はenliveのhtml-resource方法を使用しています。しかし、そのメソッドは、欠落しているhtmlタグを最終ファイルに挿入します。これは私が望まないことです。

以下は出力マップです、

({:tag :html, :attrs nil, :content (
 {:tag :head, :attrs nil, :content (
 {:tag :meta, :attrs {:content text/html; charset=utf-8, :http-equiv Content-Type}, :content ()} 
 {:tag :title, :attrs nil, :content (HewaniLife | Changing The Way You Live)} 
 {:tag :link, :attrs {:href styles/main.css, :rel stylesheet, :type text/css}, :content ()} )} 

 {:tag :body, :attrs nil, :content (
 {:tag :html, :attrs nil, :content ({:tag :body, :attrs nil, :content ({:tag :div, :attrs {:id header}, :content (
 {:tag :h1, :attrs nil, :content ({:tag :a, :attrs {:href index.xhtml, :id logo}, :content (
 {:tag :span, :attrs {:class img-replace}, :content (hewaniLife)})})} 

 {:tag :div, :attrs {:id main-nav}, :content (
 {:tag :ul, :attrs nil, :content (
 {:tag :li, :attrs nil, :content ({:tag :a, :attrs {:href login.xhtml, :id btn-login}, :content (
 {:tag :span, :attrs {:class img-replace}, :content (Login)})})} 
 {:tag :li, :attrs nil, :content ({:tag :a, :attrs {:href index.xhtml, :id btn-home}, :content (
 {:tag :span, :attrs {:class img-replace}, :content (Home)})})} 
 {:tag :li, :attrs nil, :content ({:tag :a, :attrs {:href search.xhtml, :id btn-search}, :content (
 {:tag :span, :attrs {:class img-replace}, :content (Search)})})})})} 
 {:type :comment, :data  end of div#main-nav } 
 {:tag :br, :attrs {:class clear-all}, :content nil})} {:type :comment, :data  end of div#header })})})})}

ここでは、ファイルを挿入したときにネストされたhtmlタグを確認できます。

これらのファイルを挿入する方法はありますか..?

誰か他の方法を使用できますか..?

4

2 に答える 2

3

むしろ使用defsnippetして、関心のある部分を指定する必要があります。すべてのフラグメントを1つのページに配置することもでき、defsnippetはさまざまなフラグメントを取り出します。

html-snippet主に担当者でプレイすることを目的としています

于 2011-10-07T10:49:01.607 に答える
1

enliveで。という名前のメソッドを見つけましたhtml-snippet。これを使用して、複数のhtmlフラグメントコードを組み合わせることができます。

于 2011-09-19T07:49:21.193 に答える