Skip to content
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

Ability to contine text below a timeline. #11

Open
paul-hammant opened this issue Jan 26, 2021 · 4 comments
Open

Ability to contine text below a timeline. #11

paul-hammant opened this issue Jan 26, 2021 · 4 comments

Comments

@paul-hammant
Copy link

The page that contains a timeline can have multiple paragraphs of standard markdown above the actual timeline. It would be great to be able to have text/pics below.

I'm not sure what the possibilities are in Jekyll/Liquid there, or how to select the style in front-matter per page.

@paul-hammant
Copy link
Author

Could be that {{content}} can't be coerced.

Maybe theres a Jquery trick to pull the rendered widget out of the DOM and to move it up so some other location. Say in the middle of the markdown we'd place a

@evanwill
Copy link
Member

Yeah, not a very good way to do it right now,
basically you need <div id="timeline-embed" style="height: 600px" class="w-100"></div> where you want the timeline to show up.
Right now the layout is putting that div in, so I just put {{ content }} above the timeline (and you can't really split content).
maybe there could be an option to skip adding the div via the layout, which then the user would be required to manually add the div to the markdown page.

if you are doing this in your own project, just go into the layouts and delete the part like:

{% if page.timeline or page.timeline-json %}<div class="my-4"><div id="timeline-embed" style="height: 600px" class="w-100"></div></div>{% endif %}

Then in your markdown pages, you just need to remember to add

<div class="my-4"><div id="timeline-embed" style="height: 600px" class="w-100"></div></div>

on its own line (with blank line above and below), where you want the timeline to show up.

@paul-hammant
Copy link
Author

I'll give it a go. We already "decorate" elements with JQuery: https://github.com/its-airborne/timelines-site/blob/main/_layouts/default.html#L108

So there's plenty of options bu the JQuery tricks happen after an initial render which is second class.

@evanwill
Copy link
Member

evanwill commented Feb 3, 2021

yeah, rather than messing around with the layout with js, the option I mention above is pretty straightforward and will have better end result.
if you have a specific repository let me know and I could open a PR with the tweaks if that is helpful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants