2016-10-26 28 views
1

一個有希望的簡單問題:我如何在lektor的減價部分插入圖像。尤其是,URL過濾器是否在markdown中工作,或者我還有哪些人蔘考assets/static /內的圖像位置?如何在lektor降價部分插入圖片?

非常感謝您的幫助! 親切的問候 -bud

+0

非常好的問題,我正要問這個問題。特別是:如何引用附加到帖子的圖像,以及如何獲得在模板中使用它們的所有優點(如縮略圖生成)。我想有一個像「文本段落,圖像行,文本段落,大圖片」等文章,每個圖像鏈接到一個更大的版本。標準Lektor工具可以實現嗎? – tgpfeiffer

回答

0

使用標準降價爲插入圖像。對於命名存儲在assets/static/使用my-image.jpg圖像以下降價代碼:

<!-- 1) Inserts an image with an empty alt parameter, but better to use the 2nd or the 3rd example --> 
![](/static/my-image.jpg) 

<!-- 2) Inserts an image also with the text "fancy picture" as the alt parameter value -->  
![fancy picture](/static/my-image.jpg) 


<!-- 3) Image also has the title attribute -->  
![fancy picture](/static/my-image.jpg "Title of the fancy picture") 

的片段上方將產生生成的HTML:

<img src="../static/my-image.jpg" alt=""> 
<img src="../static/my-image.jpg" alt="fancy picture"> 
<img src="../static/my-image.jpg" alt="fancy picture" title="Title of the fancy picture"> 

我測試了我的例子網站這個片段和它的工作原理完美。
請注意/static之前的降價代碼。

1

大多數情況下,在管理站點中,要嵌入左側「附件」列表中列出的文件。要做到這一點,只需使用附件文件名,如下:

![alt text](myimage.png)