0.2.0 • Published 5 years ago

gulp-sitemap-generator v0.2.0

Weekly downloads
1
License
ISC
Repository
github
Last release
5 years ago

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

Code Example

gulpfile.js

gulp.task('html', () => {
    return gulp.src([`/app/**/*.html`, `!/app/map.html`])
        .pipe(sitemap({
          'dest': 'dest', //*Required Options
          'app': 'app' //*Required Options
          'stream' : false //Only map.html files can be steamed
        }))
        .pipe(gulp.dest(`/dest`))
});

map.html

<h2><%= folderNames[0] %> directory</h1>
<table>
    <thead>
        <tr>
            <th><span>title</span></th>
            <th><span>directory</span></th>
            <th><span>filename</span></th>
            <th><span>author</span></th>
            <th><span>description</span></th>
        </tr>
    </thead>
    <tbody>
        <% _.each(maps, function(m) { %>
        <tr>
            <td><span><%= m.title %></span></td>
            <td><span><%= m.href %></span></td>
            <td><a href="<%= m.href %>" target="_blank"><%= m.name %></a></td>
            <td><span><%= m.author %></span></td>
            <td><span><%= m.description %></span></td>
        </tr>
        <% }); %>
    </tbody>
</table>

webpage in your project

map.html after build

titledirectoryfilenameauthordescription
a-title/app/html/a.htmla.htmlauthor (meta tag)description (mata tag)
b-title/app/html/b.htmlb.htmlauthor (meta tag)description (mata tag)
c-title/app/html/sub1/c.htmlc.htmlauthor (meta tag)description (mata tag)
d-title/app/html/sub1/d.htmld.htmlauthor (meta tag)description (mata tag)
e-title/app/html/sub1/e.htmle.htmlauthor (meta tag)description (mata tag)
f-title/app/html/sub1/sub1-1/f.htmlf.tmlauthor (meta tag)description (mata tag)
g-title/app/html/sub1/sub1-1/g.htmlg.tmlauthor (meta tag)description (mata tag)
h-title/app/html/sub1/sub1-2/h.htmlh.htmlauthor (meta tag)description (mata tag)
i-title/app/html/sub1/sub1-2/i.htmli.htmlauthor (meta tag)description (mata tag)

Options

    pipe(sitemap({
        dest : 'destFolder',
        app : 'appFolder',
        name : 'map.html',
        noDir : 'etc',
        untitle : '-', //When the title can not be found in the meta information
        unknown : '-', //When the author can not be found in the meta information
        noDescription : '-' //When the description can not be found in the meta information
        division : 'html' //Subfolders for app options.
                          //Template modifications are required. I'll explain it further below.
    }))

Options - division

It can be multi-expressible on the basis of this

set options

    division : 'html'

map.html

    <div>
    <h1>gulp-sitemap-generator</h1>
    <% _.each(maps, function(map,idx) { %>
    <h2><%= folderNames[idx] %></h1>
    <table class="table">
        <thead>
            <tr>
                <th><span>title</span></th>
                <th><span>directory</span></th>
                <th><span>filename</span></th>
                <th><span>author</span></th>
                <th><span>description</span></th>
            </tr>
        </thead>
        <tbody>
            <% _.each(map, function(m) { %>
            <tr>
                <td><span><%= m.title %></span></td>
                <td><span><%= m.href %></span></td>
                <td><a href="<%= m.href %>" target="_blank"><%= m.name %></a></td>
                <td><span><%= m.author %></span></td>
                <td><span><%= m.description %></span></td>
            </tr>
            <% }); %>
        </tbody>
    </table>
    <% }); %>
</div>    

webpage in your project

map.html after build

sub1

titledirectoryfilenameauthordescription
a-title/app/html/sub1/a.htmla.htmlauthor (meta tag)description (mata tag)
b-title/app/html/sub1/b.htmlb.htmlauthor (meta tag)description (mata tag)

sub2

titledirectoryfilenameauthordescription
c-title/app/html/sub2/c.htmlc.htmlauthor (meta tag)description (mata tag)
d-title/app/html/sub2/d.htmld.htmlauthor (meta tag)description (mata tag)

sub3

titledirectoryfilenameauthordescription
e-title/app/html/sub3/e.htmle.htmlauthor (meta tag)description (mata tag)
f-title/app/html/sub3/sub3-1/f.htmlf.htmlauthor (meta tag)description (mata tag)

sub4

titledirectoryfilenameauthordescription
g-title/app/html/sub4/g.htmlg.htmlauthor (meta tag)description (mata tag)
h-title/app/html/sub4/h.htmlh.htmlauthor (meta tag)description (mata tag)

License

cruel32@nate.com

0.2.0

5 years ago

0.1.9

6 years ago

0.1.8

6 years ago

0.1.7

6 years ago

0.1.6

7 years ago

0.1.3

7 years ago

0.1.2

7 years ago

0.1.1

7 years ago

0.1.0

7 years ago

0.0.9

7 years ago

0.0.8

7 years ago

0.0.7

7 years ago

0.0.6

7 years ago

0.0.5

7 years ago

0.0.4

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago