2016-08-01 29 views
1

試圖通過HAML添加acanonical鏈接標記到我的Middleman應用程序文檔的頭部,但不知道如何去做。添加動態描述和規範通過Middleman和HAML

%link(rel="canonical" href="current_page.data.canonical") 

使用YAML如

--- 
title: Swan Physio 
description: This is the description 
canonical : http://swanphysio.co.uk 
--- 

回答

3

你可以這樣說:

%link(rel="canonical" href='http://example.com#{current_page.url}')