taylorhughes / skit

skit: A pure JavaScript frontend for building better web clients.
MIT License
540 stars 22 forks source link

Add elements to <head> #18

Closed juanbrujo closed 9 years ago

juanbrujo commented 9 years ago

I ca't find a method do alter adding elements (like UTF-8 meta content)., I see in https://github.com/clusterinc/skit/blob/81b71420f332e6af59ea0e2a2da4e717e1c5fa35/lib/SkitServer.js#L432 but it's not rendering in any of your examples.

juanbrujo commented 9 years ago

I did it using __meta__:

__meta__: function(){
    return '<meta charset="utf-8">\n<meta http-equiv="X-UA-Compatible" content="IE=edge">';
  },
taylorhughes commented 9 years ago

That should work. Where are you adding the code?

juanbrujo commented 9 years ago

@taylorhughes I'd like it below <title> but it is being inserted below <link>. I'm seeing how to insert more meta as description and opengraph.

taylorhughes commented 9 years ago

Ah, I see. There's no way currently to add anything above < title>.

Why do you need the IE=edge and charset declarations? The charset is specified in the Content-Type header coming back from the server, and IE=edge should be enabled by <!DOCTYPE html>, right?

juanbrujo commented 9 years ago

It was just an example, I need more SEO data into <head>.

taylorhughes commented 9 years ago

OK, are you having trouble doing that or did you get it working?

taylorhughes commented 9 years ago

(closing due to inactivity)

juanbrujo commented 9 years ago

sorry, it worked using __meta__. thnx.

juanbrujo commented 9 years ago

@taylorhughes I didn't know where to reach you, but this issue was part of my SkitJS + WordPress integration, successful. I want to share it with you https://github.com/juanbrujo/wp-skitjs