({ url, title, hierarchy, content, anchor, type, position })
| 99 | } |
| 100 | |
| 101 | function recordFor({ url, title, hierarchy, content, anchor, type, position }) { |
| 102 | const recordUrl = anchor ? `${url}#${anchor}` : url; |
| 103 | |
| 104 | return { |
| 105 | objectID: `${slug(url)}-${anchor || "page"}-${position}`, |
| 106 | hierarchy, |
| 107 | content, |
| 108 | anchor, |
| 109 | url: recordUrl, |
| 110 | url_without_anchor: url, |
| 111 | type, |
| 112 | lang: "zh-CN", |
| 113 | language: "zh-CN", |
| 114 | version: "current", |
| 115 | tags: ["javaguide"], |
| 116 | weight: { |
| 117 | pageRank: 0, |
| 118 | level: type === "content" ? 0 : Number(type.replace("lvl", "")) || 0, |
| 119 | position, |
| 120 | }, |
| 121 | title, |
| 122 | }; |
| 123 | } |
| 124 | |
| 125 | function extractRecords(url, html) { |
| 126 | const $ = load(html); |
no test coverage detected