Octopress在頁面和內容中加入代碼、圖片、帶標題圖片方法

1.在.markdown中插入代碼

```[language] 目標代碼 ```

2.在.markdown中插入圖片

前提是已經創建了D:\octopress\source\images裏面有對應的圖像。

在文章中用

{% img /images/pic_name.png %}
來引用即可。

3.在.markdown中插入帶標題的圖片

前提是已經進行了帶標題圖片相關源碼的配置。

在文件中用

{% imgcap /images/pic_name.png Caption %}
來引用即可。
4.在html中插入圖片,如about me部分。方法:

在html正文中如下引用

<p><img src="/images/pic_name.png"></p>

示例:

---
layout: post
title: "你好,世界"
date: 2013-10-15 20:53
comments: true
categories: Test
tags: context
---
##Test Context
Test images in blog:

原始:
{% img /images/MyImgs/aboutme.bmp %}

加cap之後:
{% imgcap left /images/MyImgs/aboutme.bmp Leonhard Euler %}

Test Code in blog
```c++
int main()
{
 cout<<"hello world"<<endl;
};
```

Hello, Octopress!
你好,世界。
早安,中國。 


結果:


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章