{"action":"closed","issue":{"url":"https://api.github.com/repos/spf13/hugo/issues/1212","labels_url":"https://api.github.com/repos/spf13/hugo/issues/1212/labels{/name}","comments_url":"https://api.github.com/repos/spf13/hugo/issues/1212/comments","events_url":"https://api.github.com/repos/spf13/hugo/issues/1212/events","html_url":"https://github.com/spf13/hugo/issues/1212","id":88766346,"number":1212,"title":"Huge problems with DRY because content files don't support any logic (like including small partials).","user":{"login":"elnygren","id":6632349,"avatar_url":"https://avatars.githubusercontent.com/u/6632349?v=3","gravatar_id":"","url":"https://api.github.com/users/elnygren","html_url":"https://github.com/elnygren","followers_url":"https://api.github.com/users/elnygren/followers","following_url":"https://api.github.com/users/elnygren/following{/other_user}","gists_url":"https://api.github.com/users/elnygren/gists{/gist_id}","starred_url":"https://api.github.com/users/elnygren/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elnygren/subscriptions","organizations_url":"https://api.github.com/users/elnygren/orgs","repos_url":"https://api.github.com/users/elnygren/repos","events_url":"https://api.github.com/users/elnygren/events{/privacy}","received_events_url":"https://api.github.com/users/elnygren/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-06-16T15:54:00Z","updated_at":"2015-06-19T07:29:43Z","closed_at":"2015-06-19T07:29:42Z","body":"I find that Hugo is severely lacking and the current project architecture is just not that good for DRY. Let me explain:\r\n\r\nAll HTML pages are currently rendered based on `content` files. e.g `content/features.html` ~> `example.com/features/` will exist. However, content does not support any logic and actually not even HTML officially (docs say that files in `content` should be in Markdown). \r\n\r\nThe docs also say that \"most sites will only need a home page and the _default template\". I don't find this to be true at all. In fact, I end up doing templates for almost EVERY page on my site and a corresponding content for that. This is because I want to create my pages' contents from small partials too and not just have header, nav and footer come from the template.\r\n\r\nConcrete example:\r\n\r\n```\r\ncontent/\r\n  features.html\r\n  pricing.html\r\n  about.html\r\n\r\nlayouts/\r\n  _default/\r\n    single.html\r\n  partials/\r\n    ...lots of partials here...\r\n  index.html\r\n```\r\n\r\n* `example.com/` is now easy to build by using logic and partials because index.html is a template and all the Go magic is at my disposal.  \r\n* `example.com/about/` is also easy because it just has some text that is added to the `_default/single.html` template from about.html.\r\n* `example.com/features/` and `example.com/pricing/` are a bit more complex pages and would otherwise  fit inside the `_default/single.html` but I want to use Go logic to render things. Problem: `content` doesn't support Go logic.\r\n\r\nTo overcome the problem with `features` and `pricing` I can change my structure to this:\r\n\r\n```\r\ncontent/\r\n  features.html\r\n  pricing.html\r\n  about.html\r\n\r\nlayouts/\r\n  _default/\r\n    single.html\r\n  features/\r\n    single.html\r\n  pricing/\r\n    single.html\r\n  partials/\r\n    ...lots of partials here, used in index, about and pricing...\r\n  index.html\r\n```\r\n\r\nHowever, the above is just stupid. Why would I want so many folders and files, especially when all my logic files have the same name: single.html ?\r\n\r\n---\r\n\r\nAnother concrete example:\r\n\r\nI have a _default/single.html that can support my blog posts. Excellent! However, my blog post structure is like this:\r\n\r\n```\r\n<lorem ipsum text here...> \r\n\r\n<banner with something, easy to include as a partial>\r\n\r\n<lorem ipsum text continues here...>\r\n```\r\n\r\nThe problem is that, again, I couldn't do a `blogpost.md` that looks like:\r\n```\r\nlorem ipsum text here..\r\n\r\n{{ partial \"adbanner.html\" . }}\r\n\r\nlorem ipsum text here..\r\n```\r\n\r\nand I can't do a template that looks like:\r\n\r\n```\r\n{{ .FirstHalfContent }}\r\n{{ partial \"adbanner.html\" . }}\r\n{{ .SecondHalfContent }}\r\n```\r\n\r\nSo basically I would have to write the first half of the blog post to `blogpost.md`, the second half to `blogpostsecondhalf.html` to a `partial` and then do a template like:\r\n\r\n```\r\n{{ .Content }}\r\n{{ partial \"adbanner.html\" . }}\r\n{{ partial .Params.SecondHalfContent . }} <!-- the correct partial declared in FrontMatter -->\r\n```\r\n\r\nUmm.... yeahh... I would much rather just import to partial within the file containing the blogpost.\r\n\r\n---\r\n\r\nRight now I notice that I end up doing a lot of `content` files that ONLY contain the `frontmatter` and a lot of textcontent and even HTML in the variables so I can do more multi-purpose templates and properly use partials. \r\n\r\nIdeally, I'd probably enjoy a project where I could do easily use Go logic in all the files that get rendered into HTML pages. For example, inside the whatever-gets-injected-into {{ .Content }} in the following:\r\n\r\n```\r\n{{ partial \"header.html\" . }}\r\n{{ partial \"nav.html\" . }}\r\n\r\n{{ .Content }}\r\n\r\n{{ partial \"footer.html\" . }}\r\n```\r\n\r\n---\r\n\r\nIs it so that Hugo is only for blogs where almost every page looks the same? Should I be using Jekyll or something else instead ? Or am I missing something relevant here ?"}}