Skip to content
This repository has been archived by the owner on Feb 28, 2022. It is now read-only.

Add ability to include external markdown #429

Closed
tripodsan opened this issue Jul 30, 2019 · 7 comments
Closed

Add ability to include external markdown #429

tripodsan opened this issue Jul 30, 2019 · 7 comments
Labels
enhancement New feature or request

Comments

@tripodsan
Copy link
Contributor

tripodsan commented Jul 30, 2019

it would be cool to be able to include markdown on the resource level, eg:

footer.md

some **footer** text.

index.md

# Welcome

Hello, world.

## Story

[embed](https://www.example.com/stories/1234.md)


[embed](/footer.md)

This could be useful for adobe/helix-home#52

@trieloff WDYT?

/cc @davidnuescheler

@tripodsan tripodsan added the enhancement New feature or request label Jul 30, 2019
@trieloff
Copy link
Contributor

Looks like a duplicate of #267 - the implementation in #270 does not use the same syntax you proposed, but is aligned with the most common embed syntaxes I've found.

For https://www.example.com/stories/1234.md to work as an (external) embed, example.com would need to be added to a whitelist and helix-embed would need to know how to deal with files from that domain.

@tripodsan
Copy link
Contributor Author

tripodsan commented Jul 31, 2019

ok, so this should already work with:

index.md

# Welcome

Hello, world.

## Story

`markdown:https://www.example.com/stories/1234.md`


`markdown:/footer.md`

/cc @davidnuescheler

@rofe
Copy link
Contributor

rofe commented Aug 9, 2019

ok, so this should already work (...)

In my test, relative or absolute paths both result in an included 404.html, and a full URL gets printed as preformatted text.

@trieloff
Copy link
Contributor

trieloff commented Aug 9, 2019

I stand corrected: It should work if it wasn't buggy.

/foo.md

results in:

<esi:include src="/foo.embed.">

The esi:include is almost correct, it should be /foo.embed.html, which means there are two issues:

  • the html ending somehow got dropped (might be a bug in dispatch or in pipeline or just an artifact of calling from Runtime)
  • you and I don't have an embed.html.htl that creates an embed-friendly rendering (without headers and footers)

https://adobeioruntime.net/api/v1/web/trieloff/helix-services/[email protected]=trieloff&static.repo=helix-demo&static.ref=master&static.root=/htdocs&content.owner=trieloff&content.repo=helix-demo&content.ref=master&content.root=&content.package=b7aa8a6351215b7e12b6d3be242c622410c1eb28&content.index=index.html&path=/more.html&strain=default&params=

@ramboz
Copy link
Contributor

ramboz commented Aug 9, 2019

@trieloff Strange, I tried it locally on a demo site with CLI v4.9.11 and got it working as follows:

index.md

Foo

`markdown:/foo.md`

1st approach

foo.embed.html

<p>bar</p>

2nd approach

embed_html.htl

<p>${content.document.body.innerHTML @ context='unsafe'}</p>

foo.md

baz

Also, same results when trying with `markdown:/foo.html`

@trieloff
Copy link
Contributor

@ramboz I'd trace the actual ESI src URL generated and once that is correct, create the correct embed_html.htl

@kptdobe
Copy link
Contributor

kptdobe commented Aug 28, 2019

Closed during backlog grooming session during hackathon. Reopen if needed or open a new one.

@kptdobe kptdobe closed this as completed Aug 28, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants