Open stevebauman opened 2 years ago
Steve this is amazing, thank you for taking the time to write this up. I'll add it to the docs, I really really appreciate it!
Thanks for the tip to look at this issue for a solution @joshuablum. I have a pair of red underlines in my code that prevents this from working.
Markdown::addExtension(function () {
return new TorchlightExtension;
});
Undefined type 'App\Providers\Markdown' And
Undefined type 'Torchlight\Commonmark\V2\TorchlightExtension'`
Hope you can point me in the right way.
Thanks @joshuablum -- I missed that import in the example, I've added it in 👍
Don't worry, it's nothing more than a Facade, @stevebauman. Thanks for the great work, really appreciated!
I am shocked... SHOOK! ... to see that these classes are not final
@stevebauman
😏
lmao I would rather DIE @simonhamp
There were issues I ran into and had to resolve when using Statamic with their Static Site Generation plugin. This isn't an issue with Torchlight exactly but with how SSG is performed in the plugin.
When generating the pages via
php please ssg:generate
, views are generated with the raw Torchlight placeholders:After creating a Statamic custom page generator and forcing the page to be rendered in full by manually calling the
RenderTorchlight
middleware, we get the full HTML code snippets:Results can be seen here: https://stevebauman.ca/create-api-responses-with-eloquent-factories/
Here's the code for forcing code generation:
I hope this helps someone who is looking to do the same thing! 😄