2016-11-12 63 views
0

是他們的一種方式來包括一個外部文件在編譯時內聯和內使用玉/帕格模板的文本標記?使用@include裏面內聯元素在玉/帕格模板

例如,像:

p paragraph text content with #[span.icon @include path_to_file/icon.svg] inline svg thrown into the html document 

但這種解決方案:

p paragraph text content with #[span.icon #[svg #[use(href='path_to_file/icon.svg')]]] 

我知道以後的作品,但是我正在尋找不使用使用的解決方案標記或外部參考

解決方案需要導致在編譯時在單詞之間的標記中導入文檔。

我已經通過帕格文件多次瀏覽過。只有與此相關的東西是標籤插值和塊擴展,但它們似乎並沒有特別考慮到這種情況。

謝謝!

回答

0

您應該能夠使用豎線,而不必使用字符串插值:

p 
    | paragraph text content with 
    span.icon 
    include path_to_file/icon.svg 
    | inline svg thrown into the html document 

見標籤插在這裏:https://pugjs.org/language/interpolation.html