Giter Site home page Giter Site logo

sitemap-static's Introduction

sitemap-static

CircleCI Greenkeeper badge

Make a sitemap for a static website based on files on disk

install

npm install -g sitemap-static

usage

Use in the root directory of the files on the site. This will only add files with .html extensions to the sitemap.

sitemap-static --prefix=http://foo.bar/foo/ . > sitemap.xml

library API

var generateSitemap = require('sitemap-static');
var fs = require('fs');

var writer = fs.createWriteStream('/path/to/your/sitemap.xml');

generateSitemap(writer, {
    findRoot: '.',
    ignoreFile: '',
    prefix: 'http://somesi.te/',
    pretty: false
})

Ignore File

Added in v0.0.1 you can pass the name of a json file to load. File file needs to be in your current working directory and should be an array of file names (without the / at the front) that you want ignored. You can ignore entire directories by leaving off the .html. Example JSON:

[
	"ignore-me.html",
	"ignore-everything-in-me/"
]

Example Command:

sitemap-static --ignore-file=ignore.json --prefix=http://foo.bar/foo/ . > sitemap.xml

Pretty URLs

If you pass --pretty to the CLI (or pretty: true to the JS API), sitemap-static will output pretty URLs rather than the whole path to each file. For example:

Not pretty Pretty
http://www.example.com/index.html http://www.example.com/
http://www.example.com/about.html http://www.example.com/about
http://www.example.com/author/index.html http://www.example.com/author
http://www.example.com/author/main.html http://www.example.com/author/main

Example Command:

sitemap-static --prefix=http://foo.bar/foo/ --pretty . > sitemap.xml

sitemap-static's People

Contributors

bebraw avatar benadamstyles avatar chriswhong avatar givanse avatar greenkeeper[bot] avatar jfurrow avatar thomporter avatar tmcw avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

sitemap-static's Issues

Add support for 'lastmod' attribute

About

Hey there, thanks for the awesome utility!

It would be great if we could add lastmod to the sitemap entries.

Proposal (basic)

For each sitemap entry, set the lastmod value to the current date

Proposal (advanced)

  • For each sitemap entry, set the lastmod value to the current date.
  • Create a .sitemap file in the current working directory containing a hash of all html files and their consumed assets
  • For any subsequent sitemap run, run the hash against each file and update the lastmod value when a given file has a new hash

Version 10 of node.js has been released

Version 10 of Node.js (code name Dubnium) has been released! 🎊

To see what happens to your code in Node.js 10, Greenkeeper has created a branch with the following changes:

  • Added the new Node.js version to your .travis.yml

If you’re interested in upgrading this repo to Node.js 10, you can open a PR with these changes. Please note that this issue is just intended as a friendly reminder and the PR as a possible starting point for getting your code running on Node.js 10.

More information on this issue

Greenkeeper has checked the engines key in any package.json file, the .nvmrc file, and the .travis.yml file, if present.

  • engines was only updated if it defined a single version, not a range.
  • .nvmrc was updated to Node.js 10
  • .travis.yml was only changed if there was a root-level node_js that didn’t already include Node.js 10, such as node or lts/*. In this case, the new version was appended to the list. We didn’t touch job or matrix configurations because these tend to be quite specific and complex, and it’s difficult to infer what the intentions were.

For many simpler .travis.yml configurations, this PR should suffice as-is, but depending on what you’re doing it may require additional work or may not be applicable at all. We’re also aware that you may have good reasons to not update to Node.js 10, which is why this was sent as an issue and not a pull request. Feel free to delete it without comment, I’m a humble robot and won’t feel rejected 🤖


FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

An in-range update of prettier is breaking the build 🚨

The devDependency prettier was updated from 1.15.2 to 1.15.3.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

prettier is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • ci/circleci: Your tests failed on CircleCI (Details).

Release Notes for 1.15.3

🔗 Changelog

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

An in-range update of tap is breaking the build 🚨

The devDependency tap was updated from 12.6.4 to 12.6.5.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

tap is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • ci/circleci: Your tests failed on CircleCI (Details).

Commits

The new version differs by 2 commits.

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

An in-range update of standard-version is breaking the build 🚨

The devDependency standard-version was updated from 5.0.1 to 5.0.2.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

standard-version is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • ci/circleci: Your tests failed on CircleCI (Details).

Commits

The new version differs by 2 commits.

  • aad6a61 chore(release): 5.0.2
  • 3593b5a chore: upgrade dotgitignore fixes #231

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

stream.write is not a function

/Users/ben/Dev/Git/HireHubStatic/node_modules/sitemap-static/index.js:34
  stream.write(header);
         ^

TypeError: stream.write is not a function
    at module.exports (/Users/ben/Dev/Git/HireHubStatic/node_modules/sitemap-static/index.js:34:10)
    at Object.<anonymous> (/Users/ben/Dev/Git/HireHubStatic/node_modules/sitemap-static/bin/index.js:16:1)
    at Module._compile (module.js:434:26)
    at Object.Module._extensions..js (module.js:452:10)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Function.Module.runMain (module.js:475:10)
    at startup (node.js:117:18)
    at node.js:951:3

node version 4.0.0
npm version 2.14.2
sitemap-static version 0.3.0

syntax errors

$ sitemap-static
/home/hrvoje/.node/bin/sitemap-static: line 1: syntax error near unexpected token `('
/home/hrvoje/.node/bin/sitemap-static: line 1: `var findit = require('findit'),'

An in-range update of tap is breaking the build 🚨

The devDependency tap was updated from 12.5.3 to 12.6.0.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

tap is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • ci/circleci: Your tests failed on CircleCI (Details).

Commits

The new version differs by 4 commits.

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.