第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問題,去搜搜看,總會(huì)有你想問的

網(wǎng)址重復(fù)。

網(wǎng)址重復(fù)。

Go
Qyouu 2021-04-16 18:02:16
我想使用架構(gòu)輸出我的面包屑,但是@id重復(fù)兩次URL或有時(shí)重復(fù)更多?因此,如果我訪問該about頁面,則會(huì)看到:"@id":"http://localhost:1313/about/http://localhost:1313/about/",當(dāng)我使用分頁時(shí),它會(huì)重復(fù)更多URL:"@id":"http://localhost:1313/blog/http://localhost:1313/blog//http://localhost:1313/blog/http://localhost:1313/blog//http://localhost:1313/blog/http://localhost:1313/blog/",我正在使用的代碼: 摘自:https : //gohugohq.com/partials/breadcrumb-partial-with-structured-data-in-hugo/{{ $url := replace .Permalink ( printf "%s" .Site.BaseURL) "" }}{{ $.Scratch.Add "path" .Site.BaseURL }}{{ $.Scratch.Add "breadcrumb" (slice (dict "url" .Site.BaseURL "name" "home" "position" 1 )) }}{{ range $index, $element := split $url "/" }}{{ $.Scratch.Add "path" $element }}{{ $.Scratch.Add "path" "/" }}{{ if ne $element "" }}{{ $.Scratch.Add "breadcrumb" (slice (dict "url" ($.Scratch.Get "path") "name" . "position" (add $index 2))) }}{{ end }}{{ end }}<script type="application/ld+json">{  "@context": "http://schema.org",  "@type": "BreadcrumbList",  "itemListElement": [{{ range $.Scratch.Get "breadcrumb" }}{{ if ne .position 1 }},{{ end }}{        "@type": "ListItem",        "position": {{ .position }},        "item": {          "@id": "{{ .url }}",          "name": "{{ .name }}"        }    }{{ end }}]}</script>
查看完整描述

2 回答

?
一只甜甜圈

TA貢獻(xiàn)1836條經(jīng)驗(yàn) 獲得超5個(gè)贊

所以我不確定您的列表頁面模板是什么樣的,但是例如在我的

{{ partial "header.html" . }}

應(yīng)該什么時(shí)候

{{ partial "header" . }}

這刪除了重復(fù)的URL。我在標(biāo)題部分中都渲染了所有相同的代碼。


查看完整回答
反對(duì) 回復(fù) 2021-04-19
?
神不在的星期二

TA貢獻(xiàn)1963條經(jīng)驗(yàn) 獲得超6個(gè)贊

網(wǎng)址重復(fù)的原因有兩個(gè)

  1. 雨果熱重裝的已知錯(cuò)誤。但是最終的生產(chǎn)版本將沒有它。因此,運(yùn)行hugo并檢查公用文件夾。

  2. 如果公共文件夾上的問題仍然存在,請(qǐng)檢查您正在執(zhí)行多少次局部操作{{ $.Scratch.Add "path" .Site.BaseURL }}。添加一次后,便可以從頭開始在同一頁面的所有部分上獲得相同的數(shù)據(jù)。

我有關(guān)于雨果的面包屑部分的博客帖子,帶有json-ld

我重復(fù)使用相同的草稿在頁面上顯示面包屑。

只需添加搜索引擎的面包屑即可。還向用戶顯示它們。


查看完整回答
反對(duì) 回復(fù) 2021-04-19
  • 2 回答
  • 0 關(guān)注
  • 319 瀏覽

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)