@airfleet/generator-init 0.20.3 → 0.20.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -12,7 +12,7 @@
12
12
  "composer/installers": "^2.0"
13
13
  },
14
14
  "require-dev": {
15
- "airfleet/wordpress-dev": "^3.0.3",
15
+ "airfleet/wordpress-dev": "^3.1.0",
16
16
  "wpify/scoper": "2.5.4"
17
17
  },
18
18
  "autoload": {
@@ -189,10 +189,25 @@ export default class {
189
189
 
190
190
  _createTemplatePrompt() {
191
191
  return {
192
- type: "confirm",
192
+ type: "list",
193
193
  name: "createTemplate",
194
194
  message: "Create template file?",
195
- default: true,
195
+ choices: [
196
+ {
197
+ name: "Don't create template",
198
+ value: "none",
199
+ },
200
+ {
201
+ name: "Blade",
202
+ value: "blade",
203
+ },
204
+ {
205
+ name: "PHP",
206
+ value: "php",
207
+ },
208
+ ],
209
+ default: "blade",
210
+ store: true,
196
211
  };
197
212
  }
198
213
 
@@ -1,3 +1,3 @@
1
- <section class="<%= cssClass %> {{ $class }}">
1
+ <section @all_attrs( [ 'class' => '<%= cssClass %>' ] )>
2
2
 
3
3
  </section>
@@ -0,0 +1,3 @@
1
+ <section <?php echo $_all_attrs( [ 'class' => '<%= cssClass %>' ] ); ?>>
2
+
3
+ </section>
@@ -1,3 +1,3 @@
1
- <div class="<%= cssClass %> {{ $class }}">
1
+ <div @all_attrs( [ 'class' => '<%= cssClass %>' ] )>
2
2
 
3
3
  </div>
@@ -0,0 +1,3 @@
1
+ <div <?php echo $_all_attrs( [ 'class' => '<%= cssClass %>' ] ); ?>>
2
+
3
+ </div>
@@ -0,0 +1,33 @@
1
+ <?php /* Template Name: <%= name.title %> */ ?>
2
+
3
+ <?php $_view( 'partials-header' ); ?>
4
+
5
+ <?php while ( have_posts() ) : ?>
6
+ <?php the_post(); ?>
7
+ <article <?php post_class( '<%= cssClass %>' ); ?>>
8
+ <header class="<%= cssClass %>__head">
9
+ <?php if ( has_post_thumbnail() ) : ?>
10
+ <div class="<%= cssClass %>__thumbnail">
11
+ <?php the_post_thumbnail(); ?>
12
+ </div>
13
+ <?php endif; ?>
14
+ <h1 class="<%= cssClass %>__title">
15
+ <?php the_title(); ?>
16
+ </h2>
17
+ <div class="<%= cssClass %>__meta">
18
+ <p class="<%= cssClass %>__categories">
19
+ <?php the_category(); ?>
20
+ </p>
21
+ <p>
22
+ <?php the_time( 'F jS, Y ' ); ?>
23
+ <?php the_author(); ?>
24
+ </p>
25
+ </div>
26
+ </header>
27
+ <div class="<%= cssClass %>__body">
28
+ <?php the_content(); ?>
29
+ </div>
30
+ </article>
31
+ <?php endwhile; ?>
32
+
33
+ <?php $_view( 'partials-footer' ); ?>
@@ -1,3 +1,3 @@
1
- <div class="<%= cssClass %> {{ $class }}">
1
+ <div @all_attrs( [ 'class' => '<%= cssClass %>' ] )>
2
2
 
3
3
  </div>
@@ -0,0 +1,3 @@
1
+ <div <?php echo $_all_attrs( [ 'class' => '<%= cssClass %>' ] ); ?>>
2
+
3
+ </div>
@@ -0,0 +1,33 @@
1
+ <?php $_view( 'partials-header' ); ?>
2
+
3
+ <?php while ( have_posts() ) : ?>
4
+ <?php the_post(); ?>
5
+ <article <?php post_class( '<%= cssClass %>' ); ?>>
6
+ <header class="<%= cssClass %>__head">
7
+ <?php if ( has_post_thumbnail() ) : ?>
8
+ <div class="<%= cssClass %>__thumbnail">
9
+ <?php the_post_thumbnail(); ?>
10
+ </div>
11
+ <?php endif; ?>
12
+ <h2 class="<%= cssClass %>__title">
13
+ <a href="<?php the_permalink(); ?>">
14
+ <?php the_title(); ?>
15
+ </a>
16
+ </h2>
17
+ <div class="<%= cssClass %>__meta">
18
+ <p class="<%= cssClass %>__categories">
19
+ <?php the_category(); ?>
20
+ </p>
21
+ <p>
22
+ <?php the_time( 'F jS, Y ' ); ?>
23
+ <?php the_author(); ?>
24
+ </p>
25
+ </div>
26
+ </header>
27
+ <div class="<%= cssClass %>__body">
28
+ <?php the_excerpt(); ?>
29
+ </div>
30
+ </article>
31
+ <?php endwhile; ?>
32
+
33
+ <?php $_view( 'partials-footer' ); ?>
@@ -7,7 +7,7 @@ export default class {
7
7
 
8
8
  templates() {
9
9
  return [
10
- this._templateTemplate(),
10
+ ...this._templateTemplates(),
11
11
  this._controllerTemplate(),
12
12
  this._setupTemplate(),
13
13
  this._acfTemplate(),
@@ -17,12 +17,19 @@ export default class {
17
17
  ];
18
18
  }
19
19
 
20
- _templateTemplate() {
21
- return {
22
- template: `${this.generator.viewType.slug}/${this.generator.viewType.slug}-template.blade.php.ejs`,
23
- destination: `${this.generator.viewFolder}/${this.generator.name.slug}.blade.php`,
24
- isEnabled: this.generator.answers.createTemplate,
25
- };
20
+ _templateTemplates() {
21
+ return [
22
+ {
23
+ template: `${this.generator.viewType.slug}/${this.generator.viewType.slug}-template.blade.php.ejs`,
24
+ destination: `${this.generator.viewFolder}/${this.generator.name.slug}.blade.php`,
25
+ isEnabled: this.generator.answers.createTemplate === 'blade',
26
+ },
27
+ {
28
+ template: `${this.generator.viewType.slug}/${this.generator.viewType.slug}-template.php.ejs`,
29
+ destination: `${this.generator.viewFolder}/${this.generator.name.slug}.php`,
30
+ isEnabled: this.generator.answers.createTemplate === 'php',
31
+ }
32
+ ];
26
33
  }
27
34
 
28
35
  _acfTemplate() {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@airfleet/generator-init",
3
3
  "description": "A Yeoman generator to scaffold common Airfleet features",
4
- "version": "0.20.3",
4
+ "version": "0.20.5",
5
5
  "scripts": {},
6
6
  "publishConfig": {
7
7
  "access": "public"