Closed afnizarnur closed 9 years ago
You need to create a defined template file and choice this when you create the page, this page follow the layout from your template with css/js/any other code you added to layout file.
Alt you can create a plugin and use this to add js/css/code you need.
@namaless Oh I see, but how to create a defined template? Can you give an example? Btw thank you for reply!
I would agree with @namaless, if you want a custom page (typically done with a theme), that is actually independent of a theme, the best approach is a simple plugin that provides a custom twig template file (for custom page rendering), plus the custom css and/or js file.
If all you really need is a custom css/js on a standard page, then you can use the assets plugin to add those on the page.
If you need help with the plugin, i could whip up something a little later today.
I think the best way (and more simple is use a simple new template page), use this a example: https://github.com/nunopress/grav-theme-machine/blob/develop/templates/products.html.twig I make this for a products, if you can enter into our chat gitter channel we can help you :)
@rhukster I'm a little confused to use it, when I paste my .html to my .md, the page does not appear.
@namaless do you have a skeletons for that? sorry for many questions :sweat_smile:
you can paste HTML inside the .md file, for example:
---
title: Animal
---
<h1>Tags: animal</h1>
<div id="text">
<p>Lorem ipsum dolor sit amet, <strong>consectetur adipisicing</strong> elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
consequat. </p>
</div>
More specifically, I want to create a page that has a file css, js, and all assets required on that page without follow the theme. Can Grav create like that?