gulp-sitemap-generator
- auto generate sitemap for development.
- It finds Web page files in the project and collects the path, file name and meta tag.
프로젝트 내에 웹페이지 파일을 찾아 경로와 파일명 그리고 메타태그(title,author,description)를 수집해서 정리해줍니다. (html파일명을 한글로 작성하지 마세요)
Installation
npm install gulp-sitemap-generator
Code Example
gulpfile.js
gulp;
map.html
<%= folderNames[0] %> directory title directory filename author description <% _.each(maps, function(m) { %> <%= m.title %> <%= m.href %> <%= m.name %> <%= m.author %> <%= m.description %> <% }); %>
webpage in your project
. └── app └── html ├── a.html ├── b.html └── sub1 ├── c.html ├── d.html ├── e.html ├── sub1-1 │ ├── f.html │ └── g.html ├── sub1-1 ├── h.html └── i.html
map.html after build
title | directory | filename | author | description |
---|---|---|---|---|
a-title | /app/html/a.html | a.html | author (meta tag) | description (mata tag) |
b-title | /app/html/b.html | b.html | author (meta tag) | description (mata tag) |
c-title | /app/html/sub1/c.html | c.html | author (meta tag) | description (mata tag) |
d-title | /app/html/sub1/d.html | d.html | author (meta tag) | description (mata tag) |
e-title | /app/html/sub1/e.html | e.html | author (meta tag) | description (mata tag) |
f-title | /app/html/sub1/sub1-1/f.html | f.tml | author (meta tag) | description (mata tag) |
g-title | /app/html/sub1/sub1-1/g.html | g.tml | author (meta tag) | description (mata tag) |
h-title | /app/html/sub1/sub1-2/h.html | h.html | author (meta tag) | description (mata tag) |
i-title | /app/html/sub1/sub1-2/i.html | i.html | author (meta tag) | description (mata tag) |
Options
Options - division
It can be multi-expressible on the basis of this
set options
division : 'html'
map.html
gulp-sitemap-generator <% _.each(maps, function(map,idx) { %> <%= folderNames[idx] %> title directory filename author description <% _.each(map, function(m) { %> <%= m.title %> <%= m.href %> <%= m.name %> <%= m.author %> <%= m.description %> <% }); %> <% }); %>
webpage in your project
. └── app └── html └── sub1 ├── a.html └── b.html └── sub2 ├── c.html └── d.html └── sub3 ├── e.html └── sub3-1 └── f.html └── sub4 ├── g.html └── h.html
map.html after build
sub1
title | directory | filename | author | description |
---|---|---|---|---|
a-title | /app/html/sub1/a.html | a.html | author (meta tag) | description (mata tag) |
b-title | /app/html/sub1/b.html | b.html | author (meta tag) | description (mata tag) |
sub2
title | directory | filename | author | description |
---|---|---|---|---|
c-title | /app/html/sub2/c.html | c.html | author (meta tag) | description (mata tag) |
d-title | /app/html/sub2/d.html | d.html | author (meta tag) | description (mata tag) |
sub3
title | directory | filename | author | description |
---|---|---|---|---|
e-title | /app/html/sub3/e.html | e.html | author (meta tag) | description (mata tag) |
f-title | /app/html/sub3/sub3-1/f.html | f.html | author (meta tag) | description (mata tag) |
sub4
title | directory | filename | author | description |
---|---|---|---|---|
g-title | /app/html/sub4/g.html | g.html | author (meta tag) | description (mata tag) |
h-title | /app/html/sub4/h.html | h.html | author (meta tag) | description (mata tag) |