Placeholder Image

字幕列表 影片播放

由 AI 自動生成
  • (upbeat music)

    (歡快的音樂)

  • - [Jen] Google's preferred methodology

    - [Jen]谷歌的首選方法

  • for structured data is through JSON-LD.

    對於結構化數據,是通過JSON-LD。

  • Not only is this information useful for webpages

    這些資訊不僅對網頁有幫助

  • it's becoming important for home devices

    它對家用設備變得很重要

  • like Alexa and Google Home.

    如Alexa和Google Home。

  • Even if you're not a JavaScript person

    即使你不是一個JavaScript人

  • writing the JSON-LD document

    編寫JSON-LD文件

  • is a relatively straight forward thing to do.

    是一件相對直接的事情。

  • First of all, let's get our JSON-LD into the webpage.

    首先,讓我們把我們的JSON-LD放到網頁上。

  • This form of JavaScript may be embedded

    這種形式的JavaScript可以被嵌入

  • in the head of your document,

    在你的文件的頭部。

  • or just before the slash body tag.

    或者就在斜線體標籤之前。

  • Either is fine, but it should not be linked to a file

    兩者都可以,但不應該鏈接到一個文件上

  • as you might do for other JavaScript in your document, why?

    就像你對文檔中的其他JavaScript所做的那樣,為什麼?

  • Because the JSON-LD is specific to this page only.

    因為JSON-LD只針對這個頁面。

  • In other words, if you have 100 pages on your website

    換句話說,如果你的網站上有100個頁面

  • and you want every page to have structured data

    而你希望每個頁面都有結構化的數據

  • then you'd have to embed a JSON-LD script

    那麼你就必須嵌入一個JSON-LD腳本

  • on every one of those 100 pages individually.

    在這100頁中的每一頁上都有單獨的內容。

  • It's not possible to have a single central JSON-LD document

    不可能有一個單一的中央JSON-LD文件

  • and then link to it from other pages

    然後從其他頁面鏈接到它

  • as you might want to do with other JavaScript.

    就像你可能想對其他JavaScript做的那樣。

  • The content's different on every page.

    每一頁的內容都不同。

  • Let's also take a quick peek at our restaurant schema

    讓我們也快速瀏覽一下我們的餐廳模式

  • at schema.org.

    at schema.org.

  • The fastest way to get started is just to scroll

    最快的方法就是滾動滑鼠,就可以開始了

  • to the very bottom of this page.

    到本頁面的最底部。

  • And let's look at example number two.

    我們再來看看第二個例子。

  • Click on the JSON-LD tab

    點擊JSON-LD標籤

  • and this will give you some sample opening code.

    這將會給你一些打開代碼的樣本。

  • So we're going to go ahead and copy this

    所以我們要繼續下去,並複製這個

  • mark up here as a starting point,

    標記在這裡作為一個起點。

  • just go ahead and copy that.

    只要繼續下去,並複製這一點。

  • And then we're going to paste this right here

    然後我們要把這個粘貼在這裡

  • into the head of the document.

    進入文件的頭部。

  • If you prefer to paste it

    如果你喜歡粘貼它

  • just above the slash body tag, that's fine also.

    就在斜線體標籤的上方,那也是可以的。

  • I like the head,

    我喜歡這個頭。

  • since this is data that's describing the document

    因為這是在描述文件的數據

  • just like the metatags do in this particular situation.

    就像元標記在這種特殊情況下所做的那樣。

  • So obviously this is not the information for Nadia.

    是以,顯然這不是納迪亞的資訊。

  • Let's go on ahead and make some changes to this,

    讓我們繼續前進,對其進行一些修改。

  • and we can add some additional information as well.

    而且我們也可以添加一些額外的資訊。

  • Note that this starts with the @context property here.

    注意,這裡以@context屬性開始。

  • It's telling you it's going to go to schema.org

    它告訴你,它將轉到schema.org。

  • and look for the restaurant type

    並尋找餐廳類型

  • in order to derive the information that's inside

    以便推導出裡面的資訊

  • of this piece of code.

    的這段代碼。

  • It'll give us a name, we'll have to type that out,

    它會給我們一個名字,我們得把它打出來。

  • Nadia's Garden Restaurant.

    納迪亞的花園餐廳。

  • We may not want to include some of these things.

    我們可能不希望包括其中的一些東西。

  • If you wanted to include a description

    如果你想包括一個描述

  • you could certainly copy and paste that on in,

    你當然可以複製並粘貼在上面。

  • like just to demonstrate here,

    就像在這裡演示一下。

  • you can also get rid of things.

    你也可以把東西扔掉。

  • You can add things as well.

    你也可以添加東西。

  • The order here as always is not really all that important.

    這裡的順序和以往一樣,其實並不那麼重要。

  • I'm going to add an email,

    我準備添加一個電子郵件。

  • just make sure that you follow the same sort of syntax

    只要確保你遵循同樣的文法就可以了。

  • that you see on a other lines here.

    你在這裡的其他線路上看到的。

  • So email in quotes followed by a colon

    是以,電子郵件在引號中,後面是冒號

  • and then inside of that nadiasgardenrestaurant@gmail.com.

    然後在該[email protected]

  • And then make sure you put a comment

    然後確保你放一個評論

  • after each one of these, except for the very last one.

    在每一項之後,除了最後一項。

  • For our opening hours, we are going to have

    對於我們的開放時間,我們將有

  • TU to SU, Tuesday to Sunday, and then we can have a time

    TU到SU,週二到週日,然後我們可以有一個時間

  • and this will be something like 1730,

    而這將是1730年左右的事情。

  • to, whatever it was I said before 2200.

    到,不管我在22點之前說了什麼。

  • We can have a phone number, 1234567890.

    我們可以有一個電話號碼,1234567890。

  • And of course we have a menu,

    當然,我們還有一份菜單。

  • this menu is got a different URL,

    這個菜單有一個不同的URL。

  • it's Nadia's-garden.com/menu.html.

    它是Nadia's-garden.com/menu.html。

  • And then there's some things that we know we are missing

    然後還有一些我們知道我們所缺少的東西

  • because we saw when we ran our information

    因為我們看到當我們運行我們的資訊時

  • through the structured data markup tool

    通過結構化數據標記工具

  • and the testing tool in the micro data chapter

    和微觀數據章節中的測試工具

  • we know that Google looks for things like serves cuisine

    我們知道,谷歌尋找的是諸如服務美食的東西

  • and that type of information as well.

    以及這種類型的資訊。

  • So you can add that if you wish

    是以,如果你願意,你可以添加這個

  • just remember to put a comma.

    只要記得加個逗號就可以了。

  • And so we could say serves cuisine, American.

    是以我們可以說是為美食服務,為美國服務。

  • No comma after the very last one on the list of these.

    在這些清單上的最後一項後面沒有逗號。

  • And of course this isn't a list of all the properties

    當然這也不是所有財產的清單

  • but this is enough to get you started

    但這足以讓你開始

  • with how you would go about coding your own JSON-LD file.

    與你將如何去編碼你自己的JSON-LD文件。

  • You can see the form that the syntax is taking

    你可以看到文法的形式是這樣的

  • and you can see how to choose properties

    而且你可以看到如何選擇屬性

  • and values from the schema.org website.

    和來自schema.org網站的值。

  • (upbeat music)

    (歡快的音樂)

(upbeat music)

(歡快的音樂)

字幕與單字
由 AI 自動生成

單字即點即查 點擊單字可以查詢單字解釋