mirror of
https://github.com/tabler/tabler.git
synced 2025-12-22 01:44:25 +04:00
sitemap
This commit is contained in:
@@ -248,6 +248,10 @@ gulp.task('build-jekyll', (cb) => {
|
||||
.on('close', cb);
|
||||
});
|
||||
|
||||
gulp.task('build-cleanup', (cb) => {
|
||||
cb();
|
||||
});
|
||||
|
||||
/**
|
||||
* Watch JS and SCSS files
|
||||
*/
|
||||
@@ -352,5 +356,5 @@ gulp.task('clean', gulp.series('clean-dirs', 'clean-jekyll'));
|
||||
gulp.task('start', gulp.series('clean', 'sass', 'js', 'build-jekyll', gulp.parallel('watch-jekyll', 'watch', 'browser-sync')));
|
||||
|
||||
gulp.task('build-core', gulp.series('build-on', 'clean', 'sass', 'js', 'copy-images', 'copy-libs', 'add-banner'));
|
||||
gulp.task('build-demo', gulp.series('build-on', 'build-jekyll', 'copy-static', 'copy-dist'));
|
||||
gulp.task('build-demo', gulp.series('build-on', 'build-jekyll', 'copy-static', 'copy-dist', 'build-cleanup'));
|
||||
gulp.task('build', gulp.series('build-core', 'build-demo'));
|
||||
|
||||
4
src/pages/robots.txt
Normal file
4
src/pages/robots.txt
Normal file
@@ -0,0 +1,4 @@
|
||||
---
|
||||
layout: none
|
||||
---
|
||||
Sitemap: {{ "sitemap.xml" | absolute_url }}
|
||||
36
src/pages/sitemap.xml
Normal file
36
src/pages/sitemap.xml
Normal file
@@ -0,0 +1,36 @@
|
||||
---
|
||||
layout: none
|
||||
---
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<urlset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd" xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
|
||||
{% assign collections = site.collections | where_exp:'collection','collection.output != false' %}
|
||||
{% for collection in collections %}
|
||||
{% assign docs = collection.docs | where_exp:'doc','doc.sitemap != false' %}
|
||||
{% for doc in docs %}
|
||||
<url>
|
||||
<loc>{{ doc.url | replace:'/index.html','/' | absolute_url | xml_escape }}</loc>
|
||||
{% if doc.last_modified_at or doc.date %}
|
||||
<lastmod>{{ doc.last_modified_at | default: doc.date | date_to_xmlschema }}</lastmod>
|
||||
{% endif %}
|
||||
</url>
|
||||
{% endfor %}
|
||||
{% endfor %}
|
||||
|
||||
{% assign pages = site.html_pages | where_exp:'doc','doc.sitemap != false' | where_exp:'doc','doc.url != "/404.html"' %}
|
||||
{% for page in pages %}
|
||||
<url>
|
||||
<loc>{{ page.url | replace:'/index.html','/' | absolute_url | xml_escape }}</loc>
|
||||
{% if page.last_modified_at %}
|
||||
<lastmod>{{ page.last_modified_at | date_to_xmlschema }}</lastmod>
|
||||
{% endif %}
|
||||
</url>
|
||||
{% endfor %}
|
||||
|
||||
{% assign static_files = page.static_files | where_exp:'page','page.sitemap != false' | where_exp:'page','page.name != "404.html"' %}
|
||||
{% for file in static_files %}
|
||||
<url>
|
||||
<loc>{{ file.path | replace:'/index.html','/' | absolute_url | xml_escape }}</loc>
|
||||
<lastmod>{{ file.modified_time | date_to_xmlschema }}</lastmod>
|
||||
</url>
|
||||
{% endfor %}
|
||||
</urlset>
|
||||
Reference in New Issue
Block a user