Skip to content

subpage.title not returning value #274

Closed

Description

@tourbino

Hi! Thanks for this plugin.

I'm trying to make a simple linkable dynamic list of a folders content, to embed in a page. I'm trying this script:

<ul>
{% for subpage in page.children %}
    <li><a href="{{ subpage.file.name }}/">{{ subpage.title or subpage.file.name }}</a></li>
{% endfor %}
</ul>

But the list only displays the subpage file name, not the title. Using frontmatter

---
title: mypagetitle
---

didn't make a difference from simply starting the .md with # mypagetitle .

I also tried different variants of child.page, but that didn't work either.

I'm quite sure I'm in the wrong here, and it might be wrong of me to use the "issues" feature. If so, I apologize.. how can I get the subpage title?

Activity

  1. github-actions commented on Oct 22, 2025

    @github-actions

    Welcome to this project and thank you!

  2. fralau commented on Oct 22, 2025

    @fralau
    Owner

    @tourbino Thank you for your question!

    If you want to use the title, you might use the meta.title attribute:

    <ul>
      {% for subpage in page.children %}
        <li><a href="{{ subpage.file.name }}/">{{ subpage.meta.title or subpage.file.name }}</a></li>
      {% endfor %}
    </ul>

    meta allows you access explicitly what is in the frontmatter.

    I think we can convert this to a discussion. 🙂

  3. Repository owner locked and limited conversation to collaborators on Oct 22, 2025
  4. converted this issue into a discussion #275 on Oct 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions