-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
v2 Markdown Testing and Feedback #2861
Comments
So, first question is ... namely ... ??
|
Repasting from the previous issue (2860)... First, have you seen the templates handler? It has a lot of functions you might find helpful: https://github.com/caddyserver/caddy/wiki/v2:-Templates -- including a Related issues would be: #2632 and #2736 #2736 seems especially relevant. I would like to find a way to merge the two handlers, but the question is how to know whether to execute a page as markdown containing templates, or templates containing markdown? |
@misfir3 FYI, I got rid of the markdown handler and am using the templates handler for our new documentation site, which I'll be publishing in the next few days or weeks. Basically, all URLs within
Or something like that. So, I will close this for now, but feel free to continue the discussion! If this isn't what you had in mind, we can continue discussing it or even reopen the issue. |
FYI my approach is to domain.com {
handle_path /some_prefix* {
root * /www/assets
@mdfile path_regexp /.+\.md$
handle @mdfile {
header Content-Type text/html
templates {
between "<<" ">>"
}
respond <<HTML
<!DOCTYPE html>
<html><head><title><<base .Req.URL.Path>></title></head><body>
<a href="."><<dir .Req.URL.Path>>/</a><<base .Req.URL.Path>><hr/>
<<readFile .Req.URL.Path | markdown>>
</body></html>
HTML 200
}
file_server browse
}
}
|
That's very clever! Thanks for sharing. |
That's because |
I have a use case, which is essentially I want to be able to write in markdown, run it across a template and serve largely static docs. Search across the markdown content is also a nice-to-have for sure. As testing/feedback/help is desired on this (https://github.com/caddyserver/caddy/wiki/v2:-Documentation#httphandlersmarkdown) ... here we go.
I have looked/am looking at Gatsby (too complex for my basic goal) and Hugo (looks good so far, also written in Go), but figured I should give Caddy a shot ... as I like its https-by-default stance and general focus on being secure and performant by default.
So, that's my basic goal/needs and why I'm looking at it ... First, I've got to make sure I get my config sane ... will comment on that next if I am unable to get there quickly and otherwise post my feedback (and links to other pertinent issues) here as I go.
The text was updated successfully, but these errors were encountered: