html – Meteor标签的建议

Meteor用户,

在我搜索教程和示例应用程序期间,我找到了一个使用独特头部结构的应用程序:

<Meta charset="utf-8">
  <title>Title</title>
  <Meta name="description" content="Top10">
  <Meta name="viewport" content="width=device-width" />
  <Meta name="viewport" content="user-scalable=no,initial-scale=1,maximum-scale=1,minimum-scale=1">

这个特定的示例应用程序甚至没有< body>标记任何地方,只是一个名为head.html的文件,其中包含上述代码.我还了解到,Meteor似乎只是自动为你制作一个身体标签,所以从技术上讲,只需一个head.html即可.

所以,它让我想知道,有没有人定义Meteor应用程序的特定头标?理由是什么?以上代码一个很好的起点吗?

解决方法

您可以使用iron:router来轻松设置动态标题,例如:
onAfteraction: function(){
  document.title = 'my awesome site: ' + Router.current().route.getName();
}

我使用head.html,其中包括各种SEO设置:

<head>
<Meta name="viewport" content="width=device-width,initial-scale=1"/>
<Meta name="fragment" content="!"/>
<Meta name="description" content="your description"/>
<Meta property="og:title" content="your site title"/>
<Meta property="og:type" content="website"/>
<Meta property="og:image" content="https://yourimageurl"/>
<Meta property="og:url" content="https://hostname"/>
<Meta property="og:description" content="your description"/>
<Meta name="twitter:card" content="summary"/>
<Meta name="twitter:url" content="https://hostname"/>
<Meta name="twitter:title" content="your site title"/>
<Meta name="twitter:description" content="your site description"/>
<Meta name="twitter:image" content="https://yourimageurl">
<noscript>You must have Javascript enabled in order to use this site</noscript>
<link rel="shortcut icon" href="/your-ico" type="image/x-icon" />
</head>

相关文章

vue阻止冒泡事件 阻止点击事件的执行 &lt;div @click=&a...
尝试过使用网友说的API接口获取 找到的都是失效了 暂时就使用...
后台我拿的数据是这样的格式: [ {id:1 , parentId: 0, name:...
JAVA下载文件防重复点击,防止多次下载请求,Cookie方式快速简...
Mip是什么意思以及作用有哪些