質問編集履歴

6

gulpfil部分削除 (解答欄追記のため)

2018/09/27 08:53

投稿

nyan_poi
nyan_poi

スコア11

test CHANGED
File without changes
test CHANGED
@@ -52,54 +52,6 @@
52
52
 
53
53
 
54
54
 
55
-
56
-
57
- **gulpfile.js**
58
-
59
- ```
60
-
61
- var paths = {
62
-
63
- root: './src',ejsDir: {
64
-
65
- src: './src/html/**/*.html',
66
-
67
- ejs: './src/**/*.ejs',
68
-
69
- dest: './dist/',
70
-
71
- filtering: '!./src/**/_*.ejs'
72
-
73
- }
74
-
75
- };
76
-
77
- gulp.task('ejs_dev', function() {
78
-
79
- gulp.src([paths.ejsDir.src, paths.ejsDir.filtering])
80
-
81
- // .pipe(changed(ejsDir.dest))
82
-
83
- .pipe(plumber())
84
-
85
- .pipe(ejs({},{"ext": ".html"}))
86
-
87
- .pipe(prettify({indent_char: ' ', indent_size: 2}))
88
-
89
- .pipe(gulp.dest(paths.ejsDir.dest))
90
-
91
- .pipe(browserSync.reload({
92
-
93
- stream: true
94
-
95
- }));
96
-
97
- });
98
-
99
-
100
-
101
- ```
102
-
103
55
  ---
104
56
 
105
57
 
@@ -127,51 +79,3 @@
127
79
  <%- include(ejsRoot + 'common/header', {current : '〇〇'}); %>
128
80
 
129
81
  ```
130
-
131
-
132
-
133
-
134
-
135
- **gulpfile.js(browserSync.reloadをコメントアウト)**
136
-
137
- ```
138
-
139
- var paths = {
140
-
141
- root: './src',ejsDir: {
142
-
143
- src: './src/html/**/*.html',
144
-
145
- ejs: './src/**/*.ejs',
146
-
147
- dest: './dist/',
148
-
149
- filtering: '!./src/**/_*.ejs'
150
-
151
- }
152
-
153
- };
154
-
155
- gulp.task('ejs_dev', function() {
156
-
157
- gulp.src([paths.ejsDir.src, paths.ejsDir.filtering])
158
-
159
- // .pipe(changed(ejsDir.dest))
160
-
161
- .pipe(plumber())
162
-
163
- .pipe(ejs({},{"ext": ".html"}))
164
-
165
- .pipe(prettify({indent_char: ' ', indent_size: 2}))
166
-
167
- .pipe(gulp.dest(paths.ejsDir.dest))
168
-
169
- // .pipe(browserSync.reload({
170
-
171
- // stream: true
172
-
173
- // }));
174
-
175
- });
176
-
177
- ```

5

解答欄に移動

2018/09/27 08:52

投稿

nyan_poi
nyan_poi

スコア11

test CHANGED
File without changes
test CHANGED
@@ -15,26 +15,6 @@
15
15
  と書き出されてしまいます。
16
16
 
17
17
  ejsが反映され、且つ<li class="nav active">になってるようにするにはどうすればいいでしょうか?
18
-
19
-
20
-
21
- ---
22
-
23
- 追記
24
-
25
- gulpfile.jsの以下文をコメントアウトしたら反映されました。
26
-
27
- ```
28
-
29
- .pipe(browserSync.reload({
30
-
31
- stream: true
32
-
33
- }))
34
-
35
- ```
36
-
37
- browserSyncを効かせた状態にしたいのですが、どうすればよいでしょうか?
38
18
 
39
19
 
40
20
 

4

gulpfileコード部分修正

2018/09/27 08:50

投稿

nyan_poi
nyan_poi

スコア11

test CHANGED
File without changes
test CHANGED
@@ -76,6 +76,8 @@
76
76
 
77
77
  **gulpfile.js**
78
78
 
79
+ ```
80
+
79
81
  var paths = {
80
82
 
81
83
  root: './src',ejsDir: {
@@ -116,6 +118,8 @@
116
118
 
117
119
 
118
120
 
121
+ ```
122
+
119
123
  ---
120
124
 
121
125
 
@@ -149,6 +153,8 @@
149
153
 
150
154
 
151
155
  **gulpfile.js(browserSync.reloadをコメントアウト)**
156
+
157
+ ```
152
158
 
153
159
  var paths = {
154
160
 
@@ -187,3 +193,5 @@
187
193
  // }));
188
194
 
189
195
  });
196
+
197
+ ```

3

gulpfil.js追加

2018/09/27 08:49

投稿

nyan_poi
nyan_poi

スコア11

test CHANGED
File without changes
test CHANGED
@@ -15,6 +15,30 @@
15
15
  と書き出されてしまいます。
16
16
 
17
17
  ejsが反映され、且つ<li class="nav active">になってるようにするにはどうすればいいでしょうか?
18
+
19
+
20
+
21
+ ---
22
+
23
+ 追記
24
+
25
+ gulpfile.jsの以下文をコメントアウトしたら反映されました。
26
+
27
+ ```
28
+
29
+ .pipe(browserSync.reload({
30
+
31
+ stream: true
32
+
33
+ }))
34
+
35
+ ```
36
+
37
+ browserSyncを効かせた状態にしたいのですが、どうすればよいでしょうか?
38
+
39
+
40
+
41
+
18
42
 
19
43
 
20
44
 
@@ -48,6 +72,50 @@
48
72
 
49
73
 
50
74
 
75
+
76
+
77
+ **gulpfile.js**
78
+
79
+ var paths = {
80
+
81
+ root: './src',ejsDir: {
82
+
83
+ src: './src/html/**/*.html',
84
+
85
+ ejs: './src/**/*.ejs',
86
+
87
+ dest: './dist/',
88
+
89
+ filtering: '!./src/**/_*.ejs'
90
+
91
+ }
92
+
93
+ };
94
+
95
+ gulp.task('ejs_dev', function() {
96
+
97
+ gulp.src([paths.ejsDir.src, paths.ejsDir.filtering])
98
+
99
+ // .pipe(changed(ejsDir.dest))
100
+
101
+ .pipe(plumber())
102
+
103
+ .pipe(ejs({},{"ext": ".html"}))
104
+
105
+ .pipe(prettify({indent_char: ' ', indent_size: 2}))
106
+
107
+ .pipe(gulp.dest(paths.ejsDir.dest))
108
+
109
+ .pipe(browserSync.reload({
110
+
111
+ stream: true
112
+
113
+ }));
114
+
115
+ });
116
+
117
+
118
+
51
119
  ---
52
120
 
53
121
 
@@ -75,3 +143,47 @@
75
143
  <%- include(ejsRoot + 'common/header', {current : '〇〇'}); %>
76
144
 
77
145
  ```
146
+
147
+
148
+
149
+
150
+
151
+ **gulpfile.js(browserSync.reloadをコメントアウト)**
152
+
153
+ var paths = {
154
+
155
+ root: './src',ejsDir: {
156
+
157
+ src: './src/html/**/*.html',
158
+
159
+ ejs: './src/**/*.ejs',
160
+
161
+ dest: './dist/',
162
+
163
+ filtering: '!./src/**/_*.ejs'
164
+
165
+ }
166
+
167
+ };
168
+
169
+ gulp.task('ejs_dev', function() {
170
+
171
+ gulp.src([paths.ejsDir.src, paths.ejsDir.filtering])
172
+
173
+ // .pipe(changed(ejsDir.dest))
174
+
175
+ .pipe(plumber())
176
+
177
+ .pipe(ejs({},{"ext": ".html"}))
178
+
179
+ .pipe(prettify({indent_char: ' ', indent_size: 2}))
180
+
181
+ .pipe(gulp.dest(paths.ejsDir.dest))
182
+
183
+ // .pipe(browserSync.reload({
184
+
185
+ // stream: true
186
+
187
+ // }));
188
+
189
+ });

2

ejs名修正

2018/09/27 08:48

投稿

nyan_poi
nyan_poi

スコア11

test CHANGED
File without changes
test CHANGED
@@ -4,11 +4,11 @@
4
4
 
5
5
  例えば、 news.html内のincludeの「current」が'news'だった場合、
6
6
 
7
- header.ejsの<li>の中にclass="is-active"をあてたいのですが、書き方が悪いのかそのまま
7
+ header.ejsの<li>の中にclass="active"をあてたいのですが、書き方が悪いのかそのまま
8
8
 
9
9
  > <% var ejsRoot = '../../'; %>
10
10
 
11
- > <%- include(ejsRoot + 'common/_header', {current : 'news'}); %>
11
+ > <%- include(ejsRoot + 'common/header', {current : 'news'}); %>
12
12
 
13
13
 
14
14
 
@@ -42,7 +42,7 @@
42
42
 
43
43
  <% var ejsRoot = '../../'; %>
44
44
 
45
- <%- include(ejsRoot + 'common/_header', {current : 'news'}); %>
45
+ <%- include(ejsRoot + 'common/header', {current : 'news'}); %>
46
46
 
47
47
  ```
48
48
 
@@ -72,6 +72,6 @@
72
72
 
73
73
  <% var ejsRoot = '../../'; %>
74
74
 
75
- <%- include(ejsRoot + 'common/_header', {current : '〇〇'}); %>
75
+ <%- include(ejsRoot + 'common/header', {current : '〇〇'}); %>
76
76
 
77
77
  ```

1

タグ追加

2018/09/27 08:04

投稿

nyan_poi
nyan_poi

スコア11

test CHANGED
File without changes
test CHANGED
File without changes