3.2.0 • Published 9 years ago

apeman-react-head v3.2.0

Weekly downloads
6
License
MIT
Repository
github
Last release
9 years ago

apeman-react-head

Build Status Code Climate Code Coverage npm Version JS Standard

apeman react package for head component.

Installation

$ npm install apeman-react-head --save

Usage

Render head tag with meta tags.

'use strict'

import React from 'react'
import {ApHead} from 'apeman-react-head'

const ExampleComponent = React.createClass({
  render() {
    return (
      <html>
      <ApHead charset="utf-8"
              title='foo'
              icon='./favicon.png'
              meta={ {'description': 'This is description.'} }
              version='1.0.0'
              css={ ['css/lib.css', 'css/app.css'] }
              js={ ['js/lib.js', 'js/app.js'] }
              globals={ {
                appProps: {/* ... */}
            } }
      >
        <meta name="example-child-elm"/>
      </ApHead>
      <body>
      </body>
      </html>
    )
  }
})

Results like:

<!DOCTYPE html>
<html>
<head class="ap-head">
    <meta class="ap-head-meta" charset="utf-8"/>
    <title class="ap-head-title">foo</title>
    <meta name="description" content="This is description."/>
    <link rel="icon" href="./favicon.png?v=1.0.0"/>
    <script type="text/js" src="js/lib.js?v=1.0.0"></script>
    <script type="text/js" src="js/app.js?v=1.0.0"></script>
    <link rel="stylesheet" type="text/css" href="css/lib.css?v=1.0.0"/>
    <link rel="stylesheet" type="text/css" href="css/app.css?v=1.0.0"/>

    <meta name="example-child-elm"/>
</head>
</html>

Components

ApHead

Props

NameTypeDefaultDescription
charSetstring'utf-8'CharSet
titlestringDocument Title
iconstringFavicon
metaarrayOfobjectMeta data
itemPropsarrayOfobjectMicro data settings
cssarrayCSS file urls
jsarrayJS file urls
versionstring'unknown'Version string
versionKeystring'v'Query string key for version
globalsobjectGlobal variables
viewPortobject{

width: 'device-width', initialScale: '1.0' } | | View port settings | | base | string | null | | Base url | | baseTarget | string | undefined | | Target of base url. '_blank', '_parent', '_self', '_top' or frame name | | manifest | string | | | Path of manifest.json | | color | string | | | Theme color |

Props

NameTypeDefaultDescription
charsetstringnullCharset value.
titlestringnullTitle value.
iconstringnullFavicon file path.
metaobjectnullMeta values.
cssarraynullCss file urls.
jsarraynullJs file urls.
versionstring'unknown'Version number.
versionKeystring'v'Key of version in query string.

License

This software is released under the MIT License.

Links

3.2.0

9 years ago

3.1.7

9 years ago

3.1.6

9 years ago

3.1.5

9 years ago

3.1.4

9 years ago

3.1.3

9 years ago

3.1.2

9 years ago

3.1.1

9 years ago

3.1.0

9 years ago

3.0.10

9 years ago

3.0.6

9 years ago

3.0.5

9 years ago

3.0.4

9 years ago

3.0.3

9 years ago

3.0.1

9 years ago

3.0.0

9 years ago

2.3.0

9 years ago

2.2.0

9 years ago

2.1.5

9 years ago

2.1.4

9 years ago

2.1.3

10 years ago

2.1.2

10 years ago

2.1.1

10 years ago

2.1.0

10 years ago

2.0.0

10 years ago

1.0.3

10 years ago

1.0.2

10 years ago

1.0.1

10 years ago

1.0.0

10 years ago