Skip to content

Sitemap generator - #27

Open
bmordan wants to merge 6 commits into
masterfrom
sitemap-generator
Open

Sitemap generator#27
bmordan wants to merge 6 commits into
masterfrom
sitemap-generator

Conversation

@bmordan

@bmordan bmordan commented May 27, 2016

Copy link
Copy Markdown
Collaborator

This little script just helps google to index the site.

I see this tool becoming more sophisticated over time and becoming an XML file with images etc. But this is the first iteration.

npm run build:sitemap

Searches the /pages dir for folder names, excludes any folder called 'home' and creates a file /dist/sitemap.txt with the most simple content a sitemap can have:

https://somewebsite.com/about
https://somewebsite.com/contact
https://somewebsite.com/products
https://somewebsite.com/blog

Comment thread build/sitemap.js Outdated
function filter (contents, done) {
var pages = contents.filter(function (item) {
var pathToFile = path.join(inputDir, item)
return fs.statSync(pathToFile).isDirectory()

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@alanshaw

Copy link
Copy Markdown
Member

Just a note, but we'll need to extend this to play nicely with sub pages.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants