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

Markdownify includes #1303

Closed
maletor opened this Issue Jul 14, 2013 · 26 comments

Comments

Projects
None yet
@maletor

maletor commented Jul 14, 2013

Is it intended that when you add {% include a_markdown_file.md %} from within an HTML page, that it doesn't markdownify the include? The documentation seems to include that it should.

http://jekyllrb.com/docs/templates/#includes

@maletor

This comment has been minimized.

maletor commented Jul 16, 2013

I should add this might add a better way to track localization. If you look at the ruby-lang.org project, it has all been put in the _config.yml. Wouldn't it make more sense to store it in _includes/{en,es}?

@parkr

This comment has been minimized.

Member

parkr commented Jul 16, 2013

What we usually do is a capture block

{% capture my_include %}{% include a_markdown_file.md %}{% endcapture %}
{{ my_include | markdownify }}
@parkr

This comment has been minimized.

Member

parkr commented Jul 16, 2013

It would be! You can also store posts in subdirs nicely.

@maletor

This comment has been minimized.

maletor commented Jul 16, 2013

Thoughts, @mojombo?

@parkr

This comment has been minimized.

Member

parkr commented Jul 16, 2013

@mojombo is just an overseer - he doesn't comment often. @mattr- and I take care of the day-to-day on this repo. In Octopress, there is a render_partial which does this for you.

@maletor

This comment has been minimized.

maletor commented Jul 16, 2013

Ok, @parkr. Too bad I can't call {{ include a_markdown_file.md | markdownify }} in liquid.

@parkr

This comment has been minimized.

Member

parkr commented Jul 16, 2013

That would be nice, but unfortunately it's not within the capabilities of liquid. The {{ sequence cannot be used for custom tags to my knowledge - just variables and filters.

@parkr parkr closed this in f4d6ffe Jul 20, 2013

@maul-esel

This comment has been minimized.

Contributor

maul-esel commented Jul 21, 2013

Is there a reason that this must not be done, or could it be changed in a PR?

@parkr

This comment has been minimized.

Member

parkr commented Jul 21, 2013

Not sure we're ready for it yet. Could put it on the docket for 1.5 or 2.0.

@maul-esel

This comment has been minimized.

Contributor

maul-esel commented Jul 21, 2013

OK. I always found it strange and struggled trying to include markdown for quite some time when I was new to jekyll.

@parkr

This comment has been minimized.

Member

parkr commented Jul 22, 2013

If you want to put together a PR to use the converter and such, I would be much obliged :)

@maul-esel

This comment has been minimized.

Contributor

maul-esel commented Jul 22, 2013

I'll look into it. Seems kinda problematic though, as the includes are processed with liquid, but the conversion of the post / page content is applied later - so the included files would be converted 2 times!

I could think of some hook into that process, essentially splitting up the content in several sections with a different converter for each - which might be interesting, but very complicated.

@parkr

This comment has been minimized.

Member

parkr commented Jul 22, 2013

Yeah. The simplest option is to use the converters within the Include tag. We'd figure out the converter based on the extname and convert. MaRuKu would just freak out for everyone.

@maul-esel

This comment has been minimized.

Contributor

maul-esel commented Aug 17, 2013

A much simpler solution would be to just put a placeholder in there and then inject the converted content after the main file has been converted... I'll probably look into something like that later.

adamlogic added a commit to vachoa/villageatalumcreek.org that referenced this issue Jul 16, 2014

@ceefour

This comment has been minimized.

ceefour commented Nov 13, 2014

👍 for this... :( surely a lot of people want a more concise way than the convoluted capture thing..

@parkr

This comment has been minimized.

Member

parkr commented Nov 13, 2014

@ceefour Let's revisit it!

@daveaseeman

This comment has been minimized.

daveaseeman commented May 7, 2015

👍

@clarklab

This comment has been minimized.

clarklab commented May 13, 2015

👍

Is there a way to include a post, formatted with markdown, inside another post? I've got a recipe build going where recipes (posts) are made up of small components (also posts).

The capture thing works inside a page, when the .md file is inside /_includes, bust that's pretty dang narrow. Any way to include a post in a post?

@daveaseeman

This comment has been minimized.

daveaseeman commented May 13, 2015

Yes, I don't know how you could include a specific post but I'm sure it's possible, perhaps not in safe mode. But you can include your most recent post simply with:

{% for post in site.posts limit:1 %}

{{ post.content }}

{% endfor %}

You can use whatever liquid you want for the title and such. Change 'content' to 'excerpt' for less body text. Then you can control the length as well.

On Tuesday, May 12, 2015 at 11:28 PM, Clark Wimberly notifications@github.com, wrote:

Is there a way to include a post, formatted with markdown, inside another post? I've got a recipe build going where recipes (posts) are made up of small components (also posts).
The capture thing works inside a page, when the .md file is inside /_includes, bust that's pretty dang narrow. Any way to include a post in a post?

Reply to this email directly or view it on GitHub.

@clarklab

This comment has been minimized.

clarklab commented May 13, 2015

@DaveAs thanks for the tip, but that's not really what I'm after. Aside from the fact that it won't render from inside a post, I still need a way to call up specific posts (or sets of posts).

@daveaseeman

This comment has been minimized.

daveaseeman commented May 13, 2015

Sorry, can't help you there. There might be a way to do it by giving each post a unique identifier in the yaml front matter and referencing that post's content by that ID. I can't hack it together for you right now and there might be a cleaner solution. Just thought I'd share the idea. Good luck! Let us know if you get it!

On Wednesday, May 13, 2015 at 12:35 PM, Clark Wimberly notifications@github.com, wrote:

@DaveAs thanks for the tip, but that's not really what I'm after. Aside from the fact that it won't render from inside a post, I still need a way to call up specific posts (or sets of posts).


Reply to this email directly or view it on GitHub.

rob-eager added a commit to OpenLabTools/Instruments-MechanicalTester that referenced this issue Dec 18, 2015

@ckreon

This comment has been minimized.

ckreon commented May 21, 2016

Are we still stuck on this?

@pickfire

This comment has been minimized.

pickfire commented Aug 10, 2016

@ckreon I think Jekyll does't Just Works™ anymore now. Suggestion:

{% capture my_include %}{% include README.md %}{% endcapture %}
{{ my_include | markdownify }}

@adamvoss adamvoss referenced this issue Aug 3, 2017

Closed

Support layouts written in Markdown #6166

4 of 10 tasks complete
@michaelboyles

This comment has been minimized.

michaelboyles commented Sep 25, 2017

Just started using Jekyll for the first time and I also thought it was strange that includes don't automatically support markdown. I'd be happy for this just to be made explicit in the documentation. I shouldn't have to search through GitHub issues.

@hosnas

This comment has been minimized.

hosnas commented Mar 1, 2018

Shouldn't we be waiting for this feature at all?

tushar-mohan added a commit to tushar-mohan/perftools that referenced this issue Mar 7, 2018

used recipe in:
jekyll/jekyll#1303

to markdowinfy a markdown include

naopontan added a commit to yasslab/yasslab.jp that referenced this issue Jun 27, 2018

@pzp1997

This comment has been minimized.

pzp1997 commented Aug 7, 2018

This issue has been unresolved for over five years now. Can't we do something about it at the framework level?

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