forked from platenio/platen
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(MAINT) Define Front Matter metadata for Toroidal
This change adds the `toroidal` and `toroidal/admin` content types to the Front Matter configuration so that site maintainers can edit the metadata for those pages in a friendly UI. For member pages and the admin page, this is fully functional. For the webring index, this is limited currently by the implementation of estruyf/vscode-front-matter#362, which introduces `where` logic for the fields but doesn't yet support using that logic to control behavior based on the file name, which would allow us to handle section pages (which are always named `_index.md`) separately from member pages. This change also updates the archetypes for Toroidal to set the `type` to `toroidal` for the index and member pages, ensuring that Front Matter picks up the type correctly for selecting the metadata to display. Due to a limitation outlined in estruyf/vscode-front-matter#360 (see [this comment for more information][01]), we have to use `type` to identify files. This has some implications for Hugo sites which don't _directly_ impact this change. [01]: estruyf/vscode-front-matter#360 (comment)
- Loading branch information
1 parent
be02f66
commit 00c8b86
Showing
7 changed files
with
123 additions
and
3 deletions.
There are no files selected for viewing
36 changes: 36 additions & 0 deletions
36
.frontmatter/config/taxonomy/contentTypes/toroidal-admin.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
{ | ||
"name": "toroidal/admin", | ||
"$schema": "https://beta.frontmatter.codes/config/taxonomy.contenttypes.schema.json", | ||
"pageBundle": false, | ||
"fields": [ | ||
{ | ||
"title": "Content Type", | ||
"name": "type", | ||
"description": "Required to tell Front Matter that this is a schematize page. Setting this to anything other than 'toroidal/admin' prevents Front Matter from recognizing this content type properly.", | ||
"type": "string", | ||
"single": true, | ||
"required": true, | ||
"hidden": true, | ||
"default": "toroidal/admin" | ||
}, | ||
{ | ||
"title": "Output Formats", | ||
"name": "outputs", | ||
"description": "Specifies the content type that makes this an administration page. If this value isn’t set, the Toroidal module won’t process the page correctly. A webring without an administration page won’t work properly.", | ||
"type": "choice", | ||
"required": true, | ||
"multiple": true, | ||
"choices": [ | ||
{ "id": "html", "title": "Publish Web Page (html)" }, | ||
{ "id": "toroidal", "title": "Publish JSON API data (toroidal)" } | ||
] | ||
}, | ||
{ | ||
"title": "Administration Details", | ||
"name": "AdminDetails", | ||
"description": "This setting defines the partial to use for the 'About Member Administration' details element in a webring's administration page. For more information, see: https://platen.io/schemas/toroidal/content/admin/#admindetails", | ||
"type": "string", | ||
"single": true | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
{ | ||
"name": "toroidal", | ||
"$schema": "https://beta.frontmatter.codes/config/taxonomy.contenttypes.schema.json", | ||
"pageBundle": false, | ||
"fields": [ | ||
{ | ||
"title": "Member Display Name", | ||
"name": "name", | ||
"description": "Specifies the display name of the member site. This value is used in the member list, the title for the member's iframe page, and the webring's administration page.", | ||
"type": "string", | ||
"single": true, | ||
"required": true | ||
}, | ||
{ | ||
"title": "Member Description", | ||
"name": "description", | ||
"description": "Specifies a short description of the member site. This value is used as the synopsis for the member in the member list and in the the metadata for the member's iframe page.", | ||
"type": "string", | ||
"required": true | ||
}, | ||
{ | ||
"title": "Weight", | ||
"name": "weight", | ||
"description": "Specifies the member's position in the webring. This value is used to determine the order to display the member in the member list and the webring's administration page. It's also used to determine which members of the webring are adjacent, ensuring a deterministic and validly looping webring.", | ||
"type": "number", | ||
"required": true | ||
}, | ||
{ | ||
"title": "Content Type", | ||
"name": "type", | ||
"description": "Required to tell Front Matter that this is a schematize page. Setting this to anything other than 'schematize' prevents Front Matter from recognizing this content type properly.", | ||
"type": "string", | ||
"single": true, | ||
"required": true, | ||
"hidden": true, | ||
"default": "toroidal" | ||
}, | ||
{ | ||
"title": "Member HomePage", | ||
"name": "ToroidalHomePage", | ||
"description": "The URL to the webring member's home page. If this value isn't specified for a member, Hugo raises an error.", | ||
"type": "string", | ||
"single": true, | ||
"required": true | ||
}, | ||
{ | ||
"title": "Display Random Member", | ||
"name": "ToroidalRandomMemberLink", | ||
"description": "Specifies whether the navigation for a member should include a link to a random member of the webring. This setting can be defined at the site, webring, and member level, with the webring overriding the site and the member overriding both.", | ||
"type": "boolean" | ||
}, | ||
{ | ||
"title": "Additional Class", | ||
"name": "ToroidalClass", | ||
"description": "Specifies one or more classes to append to the generated HTML for the webring. To specify multiple classes, separate each class with a space. You can use this value with the defined themes to style a webring more specifically.", | ||
"type": "string", | ||
"single": true | ||
}, | ||
{ | ||
"title": "Webring Name", | ||
"name": "ToroidalWebringName", | ||
"description": "Specifies the name of the webring. This setting can be defined at the site, webring, and member level, with the webring overriding the site and the member overriding both. If this value isn't specified, the default name Webring is used.", | ||
"type": "string", | ||
"single": true | ||
}, | ||
{ | ||
"title": "Member Name", | ||
"name": "ToroidalMemberName", | ||
"description": "Specifies the name of the member. This setting overrides the value used in name. Use this when you want the page name and the member name to be different.", | ||
"type": "string", | ||
"single": true | ||
}, | ||
{ | ||
"title": "Hide Header", | ||
"name": "ToroidalHideHeader", | ||
"description": "This setting specifies whether to hide the h2 element on member pages. By default, every member page includes the webring's name as an h2 at the top of the member's navigation.", | ||
"type": "boolean" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters