hugo - Can we embed one (or more) post lists in a content page? -


disclaimer: re-post of question went unanswered on hugo forum. if that's not cool, let me know , i'll remove / edit it.

i'm trying use hugo (a static site generator) replace corporate marketing site. i'm going wrong, i'll try express desires before hacked solution.

my goal

for company's website, have several categories of iterative content, "case studies" , "advisors". these categories organized in tree already.

i'd create *.md pages allow non-technical content creators customize header , content @ top of page, , below that, i'd add series of sections, each of lists 1 of child directories' posts.

an example output might like:

<head>     <title>about us</title> </head> <body>     <!-- marketing content generated /content/about/index.md -->     <h1>about us</h1>     <!-- leadership team list generated automatically /content/about/leaders/* -->     <section>         <h2>leadership team</h2>         <ul>             <li>                 <!-- content /content/about/leaders/first_last.md* -->             </li>         </ul>     </section>     <!-- foo list generated automatically /content/about/foo/* -->     <section>         <h2>foo</h2>         <ul>             <li>                 <!-- content /content/about/foo/bar.md* -->             </li>         </ul>     </section> </body> 

how i'm doing now

i'm creating custom layouts each of quasi-list-based index pages , , layouts use partials render every page matches custom .params.type. /content/about/index.md page heavily customized in /layouts/about.html file.

i feel there should better way @ least 1 of following:

  • use shortcode can access .site.pages object, content creators write {{< list 'leader' >}} in content page anywhere on side list of content .params.type = 'leader'
  • use custom layout, iterate through page's "children" instead of filtering pages type.
  • use list.html page template, without sacrificing ability have customized markdown content content creator.

are these approaches feasible existing tech, , i'm missing core concepts in documentation? ideally, i'd able more 1 of these, home page of site cherry-pick content lists via shortcode, several sections have automatic grouped lists of children directories. way content creators freely add subsections, without sacrificing ability fine-tune home page.

  • you can make shortcode says .page.site.pages-- note there limitations can access pages iterate. metadata only, not page content itself. have called the chicken or egg problem.
  • there no concept of page tree structure in hugo, , don't see how make 1 up, either.

Comments

Popular posts from this blog

dns - How To Use Custom Nameserver On Free Cloudflare? -

python - Pygame screen.blit not working -

c# - Web API response xml language -