0
내 사이트에 구성 요소 집합이 있습니다.이 파일은 .yml 파일의 변수에 지정된 내용으로 채워집니다.(중첩 된) 지킬 변수를 덮어 쓰는 방법?
site.components/button.html
---
title: Button
---
{% assign yml = 'sample' %}
<a href="#">{{ site.data.[yml].button }}</a>
데이터/sample.yml
#variables
button: Click Me
내가 이 /button.html 변수가 잘 작동하는 URL을 열 :
#Page Output
<html>
<a href="#">Click Me</a>
</html>
Q : 구성 요소가 페이지에서 사용될 때 변수를 덮어 쓸 수있는 방법이 있습니까? 예 : 모든 성분이없는
---
title: A Sample Page
---
{% assign yml = 'content'%}
{{ site.components | where:"title" : "Button" }}
데이터/content.yml
#variables
button: Join Now
/sample-page.html
#Page Output
<html>
<a href="#">Join Now</a>
</html>
주 포함한다.