Skip to content

Commit 1e4f6e9

Browse files
committed
Replace template file extension from nun to njk
1 parent 9a34d52 commit 1e4f6e9

20 files changed

+20
-20
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,4 +62,4 @@ To make WebStorm to recognize Nunjucks templates, follow the following steps:
6262

6363
![Add File Type](install-twig-register.png "Add File Type")
6464

65-
In this repo, `.nun` extension is used for Nunjucks Template, so add it to the `Registered Pattern`.
65+
In this repo, `.njk` extension is used for Nunjucks Template, so add it to the `Registered Pattern`.

app/advanced-settings.nun app/advanced-settings.njk

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{% extends './templates/layout/doc.nun' %}
1+
{% extends './templates/layout/doc.njk' %}
22

33
{# S: 页面元数据 #}
44
{% block documentTitle %}进阶设定 - NexT 使用文档{% endblock %}

app/faqs.nun app/faqs.njk

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{% extends './templates/layout/doc.nun' %}
1+
{% extends './templates/layout/doc.njk' %}
22

33
{# S: 页面元数据 #}
44
{% block documentTitle %}常见问题 - NexT 使用文档{% endblock %}

app/getting-started.nun app/getting-started.njk

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{% extends './templates/layout/doc.nun' %}
1+
{% extends './templates/layout/doc.njk' %}
22

33
{# S: 页面元数据 #}
44
{% block documentTitle %}开始使用 - NexT 使用文档{% endblock %}

app/index.nun app/index.njk

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{% extends './templates/layout/base.nun' %}
1+
{% extends './templates/layout/base.njk' %}
22

33
{% block documentTitle %}NexT 使用文档{% endblock %}
44
{% block pageName %}home{% endblock %}
@@ -183,7 +183,7 @@
183183
</div>
184184
</section>
185185

186-
{% include "./templates/partials/githu-buttons.nun" %}
186+
{% include "./templates/partials/githu-buttons.njk" %}
187187

188188
{% endblock %}
189189

app/platforms.nun app/platforms.njk

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{% extends './templates/layout/doc.nun' %}
1+
{% extends './templates/layout/doc.njk' %}
22

33
{# S: 页面元数据 #}
44
{% block documentTitle %}其他平台 - NexT 使用文档{% endblock %}

app/tag-plugins.nun app/tag-plugins.njk

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{% extends './templates/layout/doc.nun' %}
1+
{% extends './templates/layout/doc.njk' %}
22

33
{# S: 页面元数据 #}
44
{% block documentTitle %}内置标签 - NexT 使用文档{% endblock %}

app/templates/layout/base.nun app/templates/layout/base.njk

+3-3
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@
1010
</head>
1111

1212
<body class="{% block pageName %}{% endblock %}">
13-
{% include '../partials/browser-upgrade.nun' %}
13+
{% include '../partials/browser-upgrade.njk' %}
1414

1515
<header>
1616
{% block header %}
17-
{% include '../partials/menu.nun' %}
17+
{% include '../partials/menu.njk' %}
1818
{% endblock %}
1919
</header>
2020

@@ -23,7 +23,7 @@
2323
</main>
2424

2525
{% block footer %}
26-
{% include '../partials/footer.nun' %}
26+
{% include '../partials/footer.njk' %}
2727
{% endblock %}
2828

2929
{% block scripts %}

app/templates/layout/doc.nun app/templates/layout/doc.njk

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{% extends './base.nun' %}
1+
{% extends './base.njk' %}
22

33
{% block header %}
44
{{ super() }}
File renamed without changes.
File renamed without changes.

app/theme-settings-example.nun app/theme-settings-example.njk

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{% extends './templates/layout/doc.nun' %}
1+
{% extends './templates/layout/doc.njk' %}
22

33
{# S: 页面元数据 #}
44
{% block documentTitle %}主题配置参考与说明 - NexT 使用文档{% endblock %}

app/theme-settings.nun app/theme-settings.njk

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{% extends './templates/layout/doc.nun' %}
1+
{% extends './templates/layout/doc.njk' %}
22

33
{# S: 页面元数据 #}
44
{% block documentTitle %}主题配置 - NexT 使用文档{% endblock %}

app/third-party-services.nun app/third-party-services.njk

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{% extends './templates/layout/doc.nun' %}
1+
{% extends './templates/layout/doc.njk' %}
22

33
{# S: 页面元数据 #}
44
{% block documentTitle %}第三方服务集成 - NexT 使用文档{% endblock %}

gulp/tasks/develop.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@ module.exports = () => {
1313
}
1414
});
1515

16-
gulp.watch(['app/**/*.nun'], bs.reload);
16+
gulp.watch(['app/**/*.njk'], bs.reload);
1717
};

gulp/tasks/dist.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const APP_DIR = 'app/';
88
const SOURCE = {
99
img: APP_DIR + 'assets/img/**/*',
1010
html: {
11-
zh: APP_DIR + '*.nun'
11+
zh: APP_DIR + '*.njk'
1212
},
1313
uploads: APP_DIR + 'uploads/**/*',
1414
CNAME: APP_DIR + 'CNAME'
@@ -33,7 +33,7 @@ module.exports = () => {
3333
gulp.src(SOURCE.html.zh)
3434
.pipe(tap(function (file) {
3535
file.contents = new Buffer(renderer.render(file.path));
36-
file.path = file.path.replace('nun', 'html');
36+
file.path = file.path.replace('njk', 'html');
3737
}))
3838
.pipe(gulp.dest(DIST.dist));
3939
};

lib/renderer.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* @overview Render `.nun` files with Nunjucks.
2+
* @overview Render `.njk` files with Nunjucks.
33
*/
44

55
const nunjucks = require('nunjucks');

lib/utils.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ module.exports = {
1313
return;
1414
}
1515

16-
pathname = pathname.replace(/html$/, 'nun');
16+
pathname = pathname.replace(/html$/, 'njk');
1717

1818
return path.join(source, pathname);
1919
}

0 commit comments

Comments
 (0)