poosh-plugin-header-location-from-html

2.0.0 • Public • Published

poosh-plugin-header-location-from-html

Poosh plugin that generates location HTTP headers from HTML content

npm version source code

Sample

With the following options:

{
  plugins: ["header-location-from-html"],
  each: [{
    match     : "**/*.html",
    headers   : { location: { fromContent: true } }
  }]
}

A local file looking like that:

<!DOCTYPE html>
<html>
  <head>
    <link rel="canonical" href="http://mysite.tld/posts/my-original-url"/>
    <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
    <meta http-equiv="refresh" content="0;url=http://mysite.tld/posts/my-original-url"/>
  </head>
</html>

Will be uploaded with a location HTTP header set to http://mysite.tld/posts/my-original-url.

Dependencies

Package Sidebar

Install

npm i poosh-plugin-header-location-from-html

Weekly Downloads

2

Version

2.0.0

License

MIT

Last publish

Collaborators

  • yvesm