Skip to content
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

Content blocks work in one project but not another #51

Open
bozor opened this issue Aug 22, 2016 · 1 comment
Open

Content blocks work in one project but not another #51

bozor opened this issue Aug 22, 2016 · 1 comment

Comments

@bozor
Copy link

bozor commented Aug 22, 2016

Hi,

I've been having trouble getting content blocks to work a project I have inherited. I am using the latest version of grunt-assemble.

Here is my basic setup:

Layout - default-sidebar.hbs

<!doctype html>
<html class="no-js" lang="">
<head>
    {{> head }}
</head>
<body class="{{ basename }}">

{{> brand-bar }}

{{> nav-menu }}

{{> subnav-bar }}

{{> view-sidebar }}

{{> body }}

{{> footer }}

</body>
</html>

One of the partials - subnav-bar.hbs
{{#block "subnavBar"}}{{/block}}

A page that uses that layout - group-details.hbs


---
viewTitle: "Physical Sciences & Engineering"
subtitle: ""
slug: "/groups/group-details"
tab1-active: "active"
showTitle: "true"
layout: "default-sidebar.hbs"

---
<p>group details content</p>

{{#content "sidebarAvatar" mode="replace"}}
  <div class="sidebar-title-thumbnail"><img src="/images/physics_icon.png" alt="" /></div>
{{/content}}

{{#content "subnavBar" mode="replace"}}
  subnav goes here
{{/content}}

{{#content "sidebarSubnav" mode="replace"}}
  sidebar content goes here
{{/content}}

The content block isn't parsed when the i run the grunt task to assemble the pages. This is the task I am running:

assemble: {
      options: {
        flatten: true,
        data: 'src/assemble/assets/data/*.{json,yml}',
        partials: ['src/assemble/partials/*.hbs'],
        plugins: ['grunt-assemble-permalinks'],
        permalinks: {
          structure: ':slug/index.html' // :slug becomes :basename if not specified => :basename/index.html'
        }
      },
      pages: {
        options: {
          layout: 'default.hbs',
          layoutdir: 'src/assemble/layouts/'
        },
        files: {
          'dist/': ['src/assemble/pages/{,*/}*.hbs']
        }
      }
    }

I have stuck the whole, stripped down version on https://github.com/bozor/test2.

I have also created another project from scratch with a near identical setup (the templates are slightly different) and content blocks work there just fine - https://github.com/bozor/test3.

Could someone point out where I am going wrong?

@assemblebot
Copy link

@bozor Thanks for the issue! If you're reporting a bug, please be sure to include:

  • The version of assemble you are using.
  • Your assemblefile.js (This can be in a gist)
  • The commandline output. (Screenshot or gist is fine)
  • What you expected to happen instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants