universe / vapid

Vapid is an intentionally simple content management system built on the idea that you can create a custom dashboard without ever leaving the HTML.
https://www.vapid.com
MIT License
0 stars 1 forks source link

feat: Page Templates. #2

Closed amiller-gh closed 4 years ago

amiller-gh commented 4 years ago

Began implementing https://github.com/vapid/vapid/issues/158 here so we can play with it and get a feel for the new data model features 🙂

Data Model Updates

Template Parser Updates

Dashboard Updates

Came up with an idea as I was working here: What if we allow {{#collection this.name as |value|}} (note: this.name instead of name). This would make a page-specific collection. It won't be shared between other pages and will show up as a direct child of the page in the dashboard. Essentially, each page instance will get a private collection to reference.

Also:

amiller-gh commented 4 years ago

Experimental pages side menu, site navigation config, and "create new page" button visuals:

image

Global site navigation can be referenced in-template like:

<nav class="nav" id="sidebar">
  <ul class="nav__links">
    {{#collection @navigation as |page|}}
      <li>
        <a href="{{page.permalink}}" class="{{if page.isActive "active"}}">
          {{page.title}}
        </a>
      </li>
    {{/collection}}
  </ul>
</nav>
amiller-gh commented 4 years ago

Merging into master to open a PR in the main repo – this is in a decent draft state :)