@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.
- package/generators/plugin/templates/composer.json.ejs +1 -1
- package/generators/view/prompts.js +17 -2
- package/generators/view/templates/blocks/blocks-template.blade.php.ejs +1 -1
- package/generators/view/templates/blocks/blocks-template.php.ejs +3 -0
- package/generators/view/templates/components/components-template.blade.php.ejs +1 -1
- package/generators/view/templates/components/components-template.php.ejs +3 -0
- package/generators/view/templates/custom-templates/custom-templates-template.php.ejs +33 -0
- package/generators/view/templates/partials/partials-template.blade.php.ejs +1 -1
- package/generators/view/templates/partials/partials-template.php.ejs +3 -0
- package/generators/view/templates/templates/templates-template.php.ejs +33 -0
- package/generators/view/templates.js +14 -7
- package/package.json +1 -1
|
@@ -189,10 +189,25 @@ export default class {
|
|
|
189
189
|
|
|
190
190
|
_createTemplatePrompt() {
|
|
191
191
|
return {
|
|
192
|
-
type: "
|
|
192
|
+
type: "list",
|
|
193
193
|
name: "createTemplate",
|
|
194
194
|
message: "Create template file?",
|
|
195
|
-
|
|
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
|
|
|
@@ -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' ); ?>
|
|
@@ -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.
|
|
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
|
-
|
|
21
|
-
return
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
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() {
|