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

Rename some directories #2

Open
mrmartineau opened this issue Aug 26, 2015 · 6 comments
Open

Rename some directories #2

mrmartineau opened this issue Aug 26, 2015 · 6 comments

Comments

@mrmartineau
Copy link
Member

On my current project, that uses Statix, I have just renamed a few directories that I think might be of use to Statix as well, so...

.
├── _grunt-configs
├── img
├── js
├── scss
└── statix
    ├── dist
    │   ├── assets
    │   ├── docs
    │   └── index.html
    └── src
        ├── data
        ├── helpers
        └── templates
            ├── includes
            │   └── snippets
            ├── layouts
            └── pages
                └── docs

New

.
├── _grunt-configs
├── img
├── js
├── scss
└── statix
    ├── dist
    │   ├── assets
    │   └── docs
    └── src
        ├── data
        ├── helpers
        └── templates
            ├── components
            ├── partials
            │   └── snippets
            ├── layouts
            └── views
                └── docs

These changes more closely match the directory structure of the scss folder and will hopefully ensure people use them in a similar way. Also templates/components is used quite successfully in my styleguide-driven development to for Handlebars partial files. What do you think? Happy to submit a PR if needed

@ashleynolan
Copy link
Contributor

Would be cool to see how this works in practice – I get how components and partials are different in the SCSS (component = buttons or form and partials = masthead or footer), but how does this breakdown in Statix?

Would anything in components essentially be a styleguide only .hbs file?

@ashleynolan
Copy link
Contributor

Other thing I just thought is it’s probably important to keep convention in terms of assemble terms.

Bearing that in mind, I definitely think we should change includes to partials as you indicated in your structure, but I think we should keep pages as a directory label, as this is part of the assemble API structure and so I think is clearer for anyone using (or looking at) the assemble docs.

Like I said above, if the components directory adds value, I’m happy adding that, but I think it needs to be clear what kind of .hbs files live inside that directory (that we can indicate with sample files in the base project).

@mrmartineau
Copy link
Member Author

I use components throughout my views and I also use them in the styleguide, they are massively helpful for me when creating a new site.

I have to say that I don't really agree to keeping the pages the same, I think that if someone is changing Assemble settings then they will be able to figure out how to change that if need be. I would rather the framework has consistent naming to help devs work more efficiently.

FYI, here are my current Assemble settings:

/**
 * Assemble
 * http://assemble.io/
 * Static site generator used by Statix
 * Find out more at https://github.com/tmwagency/statix
 */
assemble: {
    options: {
        data: '<%= config.statix.dir%>/src/**/*.{json,yml}',
        assets: '<%= config.statix.dir%>/dist/assets/dist',
        helpers: [
            'helper-moment',
            'handlebars-helper-eachitems',
            '<%= config.statix.dir%>/src/helpers/helper-*.js',
            'handlebars-helper-aggregate'
        ],

        partials: [
            '<%= config.statix.dir%>/src/templates/partials/**/*.hbs',
            '<%= config.statix.dir%>/src/templates/styleguide/**/*.hbs',
            '<%= config.statix.dir%>/src/templates/components/**/*.hbs'
        ],
        flatten: false,

        layout: 'default.hbs',
        layoutdir: '<%= config.statix.dir%>/src/templates/layouts',

        aggregate: {
            cwd: '<%= config.statix.dir%>/src/templates/'
        }
    },

    default: {
        files: [{
            cwd: './<%= config.statix.dir%>/src/templates/views/',
            dest: '<%= site.destination %>',
            expand: true,
            src: ['**/*.{hbs,md}']
        }]
    }
}

BTW, aggregate is a handlebars helper that I use to output a directory of .hbs files.

@ashleynolan
Copy link
Contributor

Will be looking at bringing this (and the whole repo) more inline with Kickoff following latest updates.

Will be doing this in next couple of weeks, so will add the updated folder structure to these changes – will update this issue as I get onto this.

@mrmartineau
Copy link
Member Author

Nice one! 👍

@ashleynolan ashleynolan mentioned this issue Jan 17, 2016
7 tasks
@ashleynolan
Copy link
Contributor

Ok, so I’ve moved /includes over to being called /partials. I think this makes much more sense and actually reflects assembles naming scheme closer.

I’m inclined to keep the rest of the structure the same, as I want to keep the /templates folder as minimal as possible at its root. By having the three main building blocks of assemble as the 3 named folders (layouts, pages and partials) makes the most sense to me.

Devs can then add more folders if they feel the need to personalise the structure on their projects. For instance, at JE we have our components directory inside the /partials folder.

Referencing the point that adding a components directory aligns with the SCSS folder – I guess it would, but I think it adds confusion over whether pieces of markup then go in the components directory or the partials directory. I’d rather keep this obvious unless people want to change it themselves (which is pretty simple to do). In an Assemble sense, components are just partial files that make up assemble pages.

Does that make sense? 🙈

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