diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index a0a39c1930..f6573f1b3b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -218,7 +218,7 @@ jobs: repository: fe-lang/fe-docs token: ${{ secrets.DOC_DEPLOY_TOKEN }} path: fe-docs - ref: gh-pages + ref: main - name: Deploy docs run: | diff --git a/crates/fe-web/assets/fe-doc-item.js b/crates/fe-web/assets/fe-doc-item.js index 804ed8b93a..c8f7d94b2f 100644 --- a/crates/fe-web/assets/fe-doc-item.js +++ b/crates/fe-web/assets/fe-doc-item.js @@ -38,11 +38,15 @@ var _ITEM_KIND = { }; var _CHILD_KIND = { - field: { plural: "Fields", anchor: "field", order: 1 }, - variant: { plural: "Variants", anchor: "variant", order: 0 }, - method: { plural: "Methods", anchor: "tymethod", order: 4 }, - assoc_type: { plural: "Associated Types", anchor: "associatedtype", order: 2 }, - assoc_const: { plural: "Associated Constants", anchor: "associatedconstant", order: 3 }, + field: { plural: "Fields", anchor: "field", order: 1 }, + variant: { plural: "Variants", anchor: "variant", order: 0 }, + method: { plural: "Methods", anchor: "tymethod", order: 6 }, + assoc_type: { plural: "Associated Types", anchor: "associatedtype", order: 4 }, + assoc_const: { plural: "Associated Constants", anchor: "associatedconstant", order: 5 }, + // Contract-specific child kinds (emitted by crates/fe/src/extract.rs for + // Contract items — see DocChildKind::{Init,RecvHandler}). + init: { plural: "Initializer", anchor: "init", order: 2 }, + recv_handler: { plural: "Message Handlers", anchor: "handler", order: 3 }, }; function _diKindStr(kind) { return (_ITEM_KIND[kind] || {}).str || kind; } @@ -304,7 +308,8 @@ class FeDocItem extends HTMLElement { _renderBreadcrumbs(item) { var segments = item.path.split("::"); - var base = this.getAttribute("base") || ""; + var index = this._getIndex(); + var items = (index && index.items) || []; var html = '"; @@ -371,11 +384,17 @@ class FeDocItem extends HTMLElement { for (var j = 0; j < group.items.length; j++) { var child = group.items[j]; var anchorId = info.anchor + "." + child.name; + var rowHref = this._anchorHref(parentUrl, anchorId); html += '