Skip to content
Grav 2.0 is officially stable. Read the announcement →
Archive

How do I add a page to my site that is HTML with javascript?

Started by Muut Archive 9 years ago · 3 replies · 678 views
9 years ago

I don't want to covert the page to markdown, it is an HTML page of slides using javascript and it's own embedded css. iframe??

9 years ago

You'll need to separate the HTML, the CSS and the Javascript code. Put the HTML without head and bodyelements in the page content and add the CSS and Javascript to the page as Grav Assets. You might want to look at the (brand new) Shortcode Assets Plugin.

9 years ago

Thanks, I'm trying it now - but does it matter which page template I use for the HTML frontend file? (I'm assuming I still have to save the HTML to a .md file)

9 years ago

Yes, the HTML code should be used as the page content and stored in the .md files. To use a dedicated template for your slide pages (e.g. "slide.html.twig") you have two options. Either keep the default page filenames ("default.md") and specify the template to use in each slide page frontmatter or use "slide.md" as page filename. In the latter case there is no need to specify the template to be used as Grav first looks for a template which name matches the page filename.

Suggested topics

Topic Participants Replies Views Activity
Archive · by Deleted User, 9 years ago
0 1336 9 years ago
Archive · by Muut Archive, 9 years ago
2 925 9 years ago
Archive · by Muut Archive, 9 years ago
2 4056 9 years ago
Archive · by Muut Archive, 9 years ago
1 2941 9 years ago
Archive · by Muut Archive, 9 years ago
3 1112 9 years ago