Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions data/structures/_arguments.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ arguments:
optional: true
comment: Unique name of the bookshop component.
group: partial
_bookshop-name:
type: string
optional: true
comment: Alias for _bookshop_name.
group: partial
_ordinal:
type: int
optional: true
Expand Down
8 changes: 7 additions & 1 deletion layouts/_partials/utilities/InitTypes.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,13 @@

{{/* Inline partial to retrieve the type definition of the provided key (without recursion) */}}
{{ define "_partials/inline/type-definition.html" }}
{{ $key := .key }}
{{/* Convert key name from snake case to kebab case, except for leading underscores. */}}
{{/* Examples: */}}
{{/* - "link_type" → "link-type" */}}
{{/* - "_link_type" → "_link-type" */}}
{{/* - "__link_type" → "__link-type" */}}
{{ $match := findRESubmatch "^(_*)(.*)$" .key }}
{{ $key := print (index $match 0 1) (replaceRE "_" "-" (index $match 0 2)) }}
{{ $val := .val }}
{{ $arguments := .arguments }}
{{ $types := .types }}
Expand Down
Loading