New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[请教]把Markdown文件的Content在多个地方引用 #3236

Open
weiki08 opened this Issue Aug 20, 2018 · 1 comment

Comments

1 participant
@weiki08

weiki08 commented Aug 20, 2018

For question

我想实现下面的东西,目前没有解决,希望能得到指导

index.md的内容如下

content1:
# Test
> 这是第一部分内容
> 这是第一部分内容

content2:
# Test
> 这是第二部分内容
> 这是第二部分内容

然后在ejs里面引用上面的markdown

 <div class="text-container">
    <div class="moku-content">
        <span>目的</span>
    </div>
    <div class="text-container-normal">
    <%- page.content1 %>
    </div>
</div>

<div id="rental-service" class="text-container">
    <div class="moku-content">
        <span>対象</span>
    </div>
    <div class="text-container-normal">
        <%- page.content2 %>
    </div>
</div>

但是好像实现不了,不知道能不能给我个建议?谢谢各位了

@weiki08

This comment has been minimized.

Show comment
Hide comment
@weiki08

weiki08 Aug 20, 2018

不考虑使用partial
一个视图里面引用过个片段视图即partial,那么这个片段视图里面写<%- page.content %>拿到的是父视图的内容。

weiki08 commented Aug 20, 2018

不考虑使用partial
一个视图里面引用过个片段视图即partial,那么这个片段视图里面写<%- page.content %>拿到的是父视图的内容。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment