Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mattms/metah
HTML meta tag functions
https://github.com/mattms/metah
Last synced: about 1 month ago
JSON representation
HTML meta tag functions
- Host: GitHub
- URL: https://github.com/mattms/metah
- Owner: MattMS
- License: isc
- Created: 2016-07-29T05:09:24.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2016-11-06T07:57:32.000Z (about 8 years ago)
- Last Synced: 2024-12-03T05:02:58.611Z (about 1 month ago)
- Size: 15.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# So metah!
Functions to create common HTML meta tags.
Requires [HyperScript](https://github.com/dominictarr/hyperscript) or similar API to create the tags.
## Usage
h = require('hyperscript')
meta = require('metah')(h)
console.log(meta.charset().outerHTML)
//## Available tags
### author
meta.author('Matt McKellar-Spence')
//### charset
meta.charset()
//### description
meta.description('What it is all about')
//### http_equiv
meta.http_equiv()
//### link_css
meta.link_css('./style.css')
//### link_script
meta.link_script('./script.js')
//### script
#### Function input
function body_script () {
document.addEventListener('DOMContentLoaded', function (event) {
console.log('Ready.')
})
}meta.script(body_script)
/*
(function () {
document.addEventListener('DOMContentLoaded', function (event) {
console.log('Ready.')
})
})()
*/#### Text input
meta.script("document.addEventListener('DOMContentLoaded', function(event) {console.log('Ready.')})")
// document.addEventListener('DOMContentLoaded', function(event) {console.log('Ready.')})### title
meta.title('My awesome site')
// My awesome site### viewport
meta.viewport()
//