Roots Discourse

Using gulp to create template files for post types & pages

Hello - I often use several post types for most of my sites and I’m looking for a way to quickly create the files needed for a post type or page.

Is there a way gulp can create files for a post type?
ie:
gulp mkfile:post_type:movie (or similar)

could create
assets/scss/layouts/_post_movie.scss (and add @import to main.scss)
assets/scss/items/_item_movie.scss (and add @import to main.scss)
templates/content-post-movies.php
templates/content-item-movies.php

    `gulp mkfile:page:profile` 

assets/scss/layouts/_page_profile.scss (and add @import to main.scss)
templates/content-page-profile.php

  `gulp mkfile:scss:module/form` 

assets/scss/module/_form.scss (and add @import to main.scss)

This is just a rough idea at the moment but can’t seem to find any examples similar to what i’d like to try out. Any pointers would be welcome and i can add to this post as things develop.

D.

Similar project that is for Timber based themes:

2 Likes