Skip to content

Latest commit

 

History

History
39 lines (29 loc) · 1.14 KB

File metadata and controls

39 lines (29 loc) · 1.14 KB

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