0
我正在創建一個包含多個頁面的網站..我添加了必須向每個頁面添加META標籤,但是我想知道是否有我們提取東西的方法從現有的標籤,並將其添加到其他標籤。自動從其他meta標籤填充meta標籤
因此,例如這些標籤已經存在於靜態的HTML頁面:
<meta name="description" content="Description 01"/>
<title>Title 01</title>
現在任何方式來提取每一頁這些值並插入其他標籤到其他頁面。
所以首頁就已經包含:
<meta name="description" content="Description Home"/>
<title>Title Home</title>
而這些將被自動添加:
<meta itemprop="name" content="Title Home">
<meta itemprop="description" content="Description Home">
<meta name="twitter:title" content="Title Home">
<meta name="twitter:description" content="Description Home">
<meta property="og:title" content="Title Home" />
<meta property="og:description" content="Description Home" />
和接觸頁將已經包含:
<meta name="description" content="Description Contact"/>
<title>Title Contact</title>
這些會自動添加:
<meta itemprop="name" content="Title Contact">
<meta itemprop="description" content="Description Contact">
<meta name="twitter:title" content="Title Contact">
<meta name="twitter:description" content="Description Contact">
<meta property="og:title" content="Title Contact" />
<meta property="og:description" content="Description Contact" />
你如何服務你的網頁? Apache的? Tomcat的?基本上,你必須通過某種中間件發送你所有的靜態頁面。 –
*「從每個頁面提取這些值」*是什麼意思?一點也不清楚你想要做什麼,在哪裏或什麼數據源真的是 – charlietfl
@Aaron_H Apache。 – ddshd