Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sitemap generator #27

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

Sitemap generator #27

wants to merge 6 commits into from

Conversation

bmordan
Copy link
Collaborator

@bmordan bmordan commented May 27, 2016

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

function filter (contents, done) {
var pages = contents.filter(function (item) {
var pathToFile = path.join(inputDir, item)
return fs.statSync(pathToFile).isDirectory()
Copy link
Member

Choose a reason for hiding this comment

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

@alanshaw
Copy link
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.

None yet

2 participants