-
Notifications
You must be signed in to change notification settings - Fork 65
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3ce7022
commit 2dbf51a
Showing
9 changed files
with
153 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,27 +1,42 @@ | |||
package stm | package stm | ||
|
|
||
import "github.com/k0kubun/pp" | |||
|
|||
func NewBuilderIndexfile(loc *Location) *BuilderIndexfile { | func NewBuilderIndexfile(loc *Location) *BuilderIndexfile { | ||
return &BuilderIndexfile{ | return &BuilderIndexfile{ | ||
loc: loc, | loc: loc, | ||
} | } | ||
} | } | ||
|
|
||
type BuilderIndexfile struct { | type BuilderIndexfile struct { | ||
loc *Location | loc *Location | ||
linkCount int | linkcnt int | ||
bldrLinkCount int | totalcnt int | ||
} | } | ||
|
|
||
func (b *BuilderIndexfile) Add(link interface{}) BuilderError { | func (b *BuilderIndexfile) Add(link interface{}) BuilderError { | ||
bldr := link.(Builder) | bldr := link.(*BuilderFile) | ||
bldr.write() |
|
||
b.totalcnt += bldr.linkcnt | |||
|
|||
if !bldr.isFinalized() { | |||
bldr.Finalize() | |||
} | |||
|
|||
// TODO: first sitemap | |||
// if b.linkcnt == 0 { } | |||
|
|||
bldr.Write() | |||
return nil | return nil | ||
} | } | ||
|
|
||
// func (b *BuilderIndexfile) AddWithErr(url interface{}) (Builder, error) { | // func (b *BuilderIndexfile) AddWithErr(url interface{}) (Builder, error) { | ||
// return b, nil | // return b, nil | ||
// } | // } | ||
|
|
||
func (b *BuilderIndexfile) finalize() {} | func (b *BuilderIndexfile) Finalize() {} | ||
func (b *BuilderIndexfile) write() {} | func (b *BuilderIndexfile) Write() { | ||
func (b *BuilderIndexfile) run() {} | pp.Println("write indexfile") | ||
} | |||
|
|||
func (b *BuilderIndexfile) run() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,21 @@ | |||
// General sitemap guidelines: https://support.google.com/webmasters/answer/183668 | |||
// Number of URLs = 50,000 | |||
// File size ( uncompressed ) = 50MB | |||
package stm | |||
|
|||
const ( | |||
MaxSitemapFiles = 50000 // max sitemap links per index file | |||
MaxSitemapLinks = 50000 // max links per sitemap | |||
MaxSitemapImages = 1000 // max images per url | |||
MaxSitemapNews = 1000 // max news sitemap per index_file | |||
MaxSitemapFilesize = 10485760 // bytes | |||
) | |||
|
|||
const ( | |||
SchemaGeo = "http://www.google.com/geo/schemas/sitemap/1.0" | |||
SchemaImage = "http://www.google.com/schemas/sitemap-image/1.1" | |||
SchemaMobile = "http://www.google.com/schemas/sitemap-mobile/1.0" | |||
SchemaNews = "http://www.google.com/schemas/sitemap-news/0.9" | |||
SchemaPagemap = "http://www.google.com/schemas/sitemap-pagemap/1.0" | |||
SchemaVideo = "http://www.google.com/schemas/sitemap-video/1.1" | |||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters