因此,我运行了一个Laravel 5.4项目,我们有一个系统,每个页面都需要单独的元标记来正确显示人们在推特上发布URL等信息。所以我的问题是:
我如何将下面的代码注入我的头标签?
e、 g.一篇新文章可能是这样的:
<meta name="twitter:card" content="summary">
<meta name="twitter:site" content="@mysite">
<meta name="twitter:title" content="News Article - Donald Trumps Twitter Deleted!">
<meta name="twitter:image" content="imageurl">
<meta name="twitter:description" content="Donald Trump lost access to his twitter for...">
<meta name="twitter:domain" content="https://www.example.com">
<meta name="description" content="Donald Trump lost access to his twitter for..."/>
<meta name="keywords" content="News, Donald, Trump, Media, Reporting, Urgent, Breaking, Twitter"/>
.
然而,对于论坛帖子来说,应该是这样的:
<meta name="twitter:card" content="summary">
<meta name="twitter:site" content="@mysite">
<meta name="twitter:title" content="Forum - Welcome to the forum!">
<meta name="twitter:image" content="imageurl">
<meta name="twitter:description" content="Hey there and welcome to our forum! For the chance to win $250 please...">
<meta name="twitter:domain" content="https://www.example.com">
<meta name="description" content="Hey there and welcome to our forum! For the chance to win $250 please..."/>
<meta name="keywords" content="Forum, Thread, Post, Win, Welcome, Twitter"/>
.
那么,怎么做?我花了一个小时在这本书上翻来翻去,真是太糊涂了!