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
Allow home page to be easily authored in markdown #720
Comments
I'm not sure if it's been discussed before, but I wonder if the partial command can start distinguishing the file content based on the file extension? That means
will then run the the file through a markdown parser, then return the cooked output back. Again, I really don't know if there's any technical limitations to this approach (other than there's just nobody working at it at the moment) |
Ah, I've just been reading http://gohugo.io/templates/partials/ and I feel that the intention behind partials is to d one thing well: allow the ability to include repeated layout sections in template files (e.g. headers and footers). They're not designed for including content. Maybe the better approach would be a new command called |
Referencing the related community discussion here: http://discuss.gohugo.io/t/include-md-files/438 |
Looks like work has already been done here: #247 |
👍 |
I tried using markdownify filter (which was added here: #652) but this doesn't work as the filter takes a string and not
|
Hi. My site will only have one page, and I'd like to write it in Markdown. Can you help? I still want to use Hugo because of the csv dynamic content feature. https://stackoverflow.com/questions/30030631/how-to-build-single-page-site-from-markdown |
I'm going to try to fix this. |
@scottcwilson talk to @spf13 -- he had a solution in place for this, that we had to roll back cause it had some side effects. |
So my initial solution was to add in a page handler to the homepage rendering function so it could handle a node (as it does now) or a page whose content was located in index.md. This proved problematic with pagination and overall quite a bit messier than I hoped. A better approach would be to add support for nodes to have a content field and support nodes having content. We could actually do a lot of really neat things once that feature is in place with some of the automatically created urls (like taxonomy index pages) but before getting too far ahead I'd focus on just the home page (but think about how it would affect other places).. Some things that need to happen:
The tests I already wrote for the code I submitted should still work, we just needed a better implementation. You can find my imperfect implementation at https://github.com/spf13/hugo/commits/spf13-content-homepage |
Also see #1051 -- if a Node has content it should also have frontmatter with proper title and params etc. |
A general solution for nodes to contain content would be a really nice improvement! It might make sense to provide a |
Will be handled in #2297. |
i know this thread is old,but i just happened to have the same issue..is it solved yet? |
yes. |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Presently, it looks like the only way to put content in the home page on a hugo site with a theme is to override the theme, by creating a file
/layouts/index.html
, where the contents of the home page must be inserted manually using HTML. The{{ partial "foo.html" . }}
syntax can only be used to include partials which also must be HTML, not markdown.The only way I can think of working around this is to have
layouts/index.html
such that it ierates over all pages, and simply filters them based on the presence of a parameter, like so:However, this seems like a rather roundabout, and inefficient, way of going about things. Is there a better way?
The text was updated successfully, but these errors were encountered: