Open jaredkrinke opened 1 year ago
While you're working on this is there a simple way for me to alter the template in the source code then rebuild on my PC using the deno exe? Just wondering.
While you're working on this is there a simple way for me to alter the template in the source code then rebuild on my PC using the deno exe? Just wondering.
Yeah, if you have the Deno CLI and a copy of the md2blog code, you should be able to modify templates.ts and then run deno run --allow-read --allow-write path/to/main.ts
to run your local copy of the code.
Once happy, you can use deno install
to avoid typing in all the options each time.
Thanks. So deno install
creates an exe?
Thanks. So
deno install
creates an exe?
No, but you can do that with Deno compile: https://docs.deno.com/runtime/manual/tools/compiler
"Install" is more like creating an alias, in case you don't need a big self contained binary like "compile".
What's the easiest way to add a header image in the template for all pages/posts?
What's the easiest way to add a header image in the template for all pages/posts?
Not sure how much direction you need, but here's what I can easily type on my phone:
partialBase
functionm.pathToRoot
and then goes from the root, to ensure there reference can be resolved form anywhere in the directory treeMost of this is similar to the title link, which should be easy to find (something like href="${m.pathToRoot}index.html"
) in the existing code.
Some of extra context:
The template language is this one: https://deno.land/x/literal_html
The md2blog functions include metadata in a variable named m
.
Greetings
Just getting back to this - In templates.ts after line 258 <header>
can I add this for the header image to show? -
<header>
<img src="${m.pathToRoot!}image.jpg" alt="">
<h1><a href="${m.pathToRoot!}index.html">${m.site!.title!}</a></h1>
To rebuild into an exe what command line should I use?
Would this work - deno compile --allow-read --allow-write path/to/main.ts
Oh, I see you have a batch file for building. Should I just run that for the Windows build?
Update - I got it to build ok and my header image is showing fine!
The default template should be all you need... but I'm probably going to grudgingly support custom templates. The biggest issue is that then I'd need to support some template language, and that is a big can of worms since there's no universal standard.