Skip to content

Latest commit

 

History

History

poosh-plugin-header-location-from-html

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

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