feat: handle []string or string for pathAlias
All checks were successful
Build and Push Server / build-and-push (push) Successful in 2m52s
All checks were successful
Build and Push Server / build-and-push (push) Successful in 2m52s
This commit is contained in:
Binary file not shown.
@@ -22,8 +22,7 @@
|
|||||||
- path: datePublished
|
- path: datePublished
|
||||||
- path: articleSection
|
- path: articleSection
|
||||||
- path: reviewRating.ratingValue
|
- path: reviewRating.ratingValue
|
||||||
pathAlias:
|
pathAlias: rating
|
||||||
- rating
|
|
||||||
- path: reviewRating.bestRating
|
- path: reviewRating.bestRating
|
||||||
value: 5
|
value: 5
|
||||||
codec: const
|
codec: const
|
||||||
|
|||||||
@@ -17,12 +17,10 @@
|
|||||||
hidden: true
|
hidden: true
|
||||||
value: Person
|
value: Person
|
||||||
- path: author.name
|
- path: author.name
|
||||||
pathAlias:
|
pathAlias: author
|
||||||
- author
|
|
||||||
- path: author.email
|
- path: author.email
|
||||||
- path: datePublished
|
- path: datePublished
|
||||||
pathAlias:
|
pathAlias: date
|
||||||
- date
|
|
||||||
- path: prepTime
|
- path: prepTime
|
||||||
- path: cookTime
|
- path: cookTime
|
||||||
- path: recipeYield
|
- path: recipeYield
|
||||||
|
|||||||
@@ -19,11 +19,9 @@
|
|||||||
value: Person
|
value: Person
|
||||||
hidden: true
|
hidden: true
|
||||||
- path: datePublished
|
- path: datePublished
|
||||||
pathAlias:
|
pathAlias: date
|
||||||
- date
|
|
||||||
- path: reviewRating.ratingValue
|
- path: reviewRating.ratingValue
|
||||||
pathAlias:
|
pathAlias: rating
|
||||||
- rating
|
|
||||||
- path: reviewRating.bestRating
|
- path: reviewRating.bestRating
|
||||||
codec: const
|
codec: const
|
||||||
value: 5
|
value: 5
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
1
server/playground/_app/immutable/entry/start.DXq0HO7Q.js
Normal file
1
server/playground/_app/immutable/entry/start.DXq0HO7Q.js
Normal file
@@ -0,0 +1 @@
|
|||||||
|
import{l as o,a as r}from"../chunks/Dqs1i6nG.js";export{o as load_css,r as start};
|
||||||
@@ -1 +0,0 @@
|
|||||||
import{l as o,a as r}from"../chunks/LdOXEBMq.js";export{o as load_css,r as start};
|
|
||||||
@@ -1 +1 @@
|
|||||||
import"../chunks/DsnmJJEf.js";import{i as u}from"../chunks/kadZwC1X.js";import{p as h,o as g,k as l,t as v,l as d,q as x,v as e,x as a,y as _}from"../chunks/bc36GTfJ.js";import{s as o}from"../chunks/B1lAeocp.js";import{s as k,p}from"../chunks/LdOXEBMq.js";const $={get error(){return p.error},get status(){return p.status}};k.updated.check;const m=$;var b=g("<h1> </h1> <p> </p>",1);function z(i,n){h(n,!1),u();var r=b(),t=l(r),c=e(t,!0);a(t);var s=_(t,2),f=e(s,!0);a(s),v(()=>{o(c,m.status),o(f,m.error?.message)}),d(i,r),x()}export{z as component};
|
import"../chunks/DsnmJJEf.js";import{i as u}from"../chunks/kadZwC1X.js";import{p as h,o as g,k as l,t as v,l as d,q as x,v as e,x as a,y as _}from"../chunks/bc36GTfJ.js";import{s as o}from"../chunks/B1lAeocp.js";import{s as k,p}from"../chunks/Dqs1i6nG.js";const $={get error(){return p.error},get status(){return p.status}};k.updated.check;const m=$;var b=g("<h1> </h1> <p> </p>",1);function z(i,n){h(n,!1),u();var r=b(),t=l(r),c=e(t,!0);a(t);var s=_(t,2),f=e(s,!0);a(s),v(()=>{o(c,m.status),o(f,m.error?.message)}),d(i,r),x()}export{z as component};
|
||||||
@@ -1 +1 @@
|
|||||||
{"version":"1761298502118"}
|
{"version":"1761298975653"}
|
||||||
@@ -6,11 +6,11 @@
|
|||||||
|
|
||||||
<link href="./_app/immutable/assets/0.z6k2NkFs.css" rel="stylesheet">
|
<link href="./_app/immutable/assets/0.z6k2NkFs.css" rel="stylesheet">
|
||||||
<link href="./_app/immutable/assets/2.DQ5mJGGf.css" rel="stylesheet">
|
<link href="./_app/immutable/assets/2.DQ5mJGGf.css" rel="stylesheet">
|
||||||
<link rel="modulepreload" href="./_app/immutable/entry/start.viDKRdx9.js">
|
<link rel="modulepreload" href="./_app/immutable/entry/start.DXq0HO7Q.js">
|
||||||
<link rel="modulepreload" href="./_app/immutable/chunks/LdOXEBMq.js">
|
<link rel="modulepreload" href="./_app/immutable/chunks/Dqs1i6nG.js">
|
||||||
<link rel="modulepreload" href="./_app/immutable/chunks/B1lAeocp.js">
|
<link rel="modulepreload" href="./_app/immutable/chunks/B1lAeocp.js">
|
||||||
<link rel="modulepreload" href="./_app/immutable/chunks/bc36GTfJ.js">
|
<link rel="modulepreload" href="./_app/immutable/chunks/bc36GTfJ.js">
|
||||||
<link rel="modulepreload" href="./_app/immutable/entry/app.BhsVyJUC.js">
|
<link rel="modulepreload" href="./_app/immutable/entry/app.DiY95TQA.js">
|
||||||
<link rel="modulepreload" href="./_app/immutable/chunks/DsnmJJEf.js">
|
<link rel="modulepreload" href="./_app/immutable/chunks/DsnmJJEf.js">
|
||||||
<link rel="modulepreload" href="./_app/immutable/chunks/DyoUZ9Ht.js">
|
<link rel="modulepreload" href="./_app/immutable/chunks/DyoUZ9Ht.js">
|
||||||
<link rel="modulepreload" href="./_app/immutable/nodes/0.BxuPCyXV.js">
|
<link rel="modulepreload" href="./_app/immutable/nodes/0.BxuPCyXV.js">
|
||||||
@@ -39,7 +39,7 @@ My favourite baguette recipe
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
{
|
{
|
||||||
__sveltekit_sn112w = {
|
__sveltekit_fb1f8c = {
|
||||||
base: new URL(".", location).pathname.slice(0, -1),
|
base: new URL(".", location).pathname.slice(0, -1),
|
||||||
assets: "/_playground"
|
assets: "/_playground"
|
||||||
};
|
};
|
||||||
@@ -47,8 +47,8 @@ My favourite baguette recipe
|
|||||||
const element = document.currentScript.parentElement;
|
const element = document.currentScript.parentElement;
|
||||||
|
|
||||||
Promise.all([
|
Promise.all([
|
||||||
import("./_app/immutable/entry/start.viDKRdx9.js"),
|
import("./_app/immutable/entry/start.DXq0HO7Q.js"),
|
||||||
import("./_app/immutable/entry/app.BhsVyJUC.js")
|
import("./_app/immutable/entry/app.DiY95TQA.js")
|
||||||
]).then(([kit, app]) => {
|
]).then(([kit, app]) => {
|
||||||
kit.start(app, element, {
|
kit.start(app, element, {
|
||||||
node_ids: [0, 2],
|
node_ids: [0, 2],
|
||||||
|
|||||||
Binary file not shown.
@@ -14,7 +14,7 @@ type yamlBlock struct {
|
|||||||
Fields []yamlField `yaml:"fields"`
|
Fields []yamlField `yaml:"fields"`
|
||||||
ListTemplate string `yaml:"listTemplate,omitempty"`
|
ListTemplate string `yaml:"listTemplate,omitempty"`
|
||||||
Hidden bool `yaml:"hidden,omitempty"`
|
Hidden bool `yaml:"hidden,omitempty"`
|
||||||
PathAlias []string `yaml:"pathAlias,omitempty"`
|
PathAlias StringOrSlice `yaml:"pathAlias,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type yamlField struct {
|
type yamlField struct {
|
||||||
@@ -22,7 +22,7 @@ type yamlField struct {
|
|||||||
Value any `yaml:"value,omitempty"`
|
Value any `yaml:"value,omitempty"`
|
||||||
Codec string `yaml:"codec"`
|
Codec string `yaml:"codec"`
|
||||||
Hidden bool `yaml:"hidden,omitempty"`
|
Hidden bool `yaml:"hidden,omitempty"`
|
||||||
PathAlias []string `yaml:"pathAlias,omitempty"`
|
PathAlias StringOrSlice `yaml:"pathAlias,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func parseYamlTemplate(input Slice) (block Block, err error) {
|
func parseYamlTemplate(input Slice) (block Block, err error) {
|
||||||
|
|||||||
31
template/yaml_types.go
Normal file
31
template/yaml_types.go
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
package template
|
||||||
|
|
||||||
|
import "errors"
|
||||||
|
|
||||||
|
type StringOrSlice []string
|
||||||
|
|
||||||
|
func (s *StringOrSlice) UnmarshalYAML(unmarshal func(any) error) error {
|
||||||
|
var single string
|
||||||
|
if err := unmarshal(&single); err == nil {
|
||||||
|
if single == "" {
|
||||||
|
*s = nil
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
*s = []string{single}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
var multi []string
|
||||||
|
if err := unmarshal(&multi); err == nil {
|
||||||
|
*s = multi
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
var nothing *struct{}
|
||||||
|
if err := unmarshal(¬hing); err == nil {
|
||||||
|
*s = nil
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
return errors.New("expected string, []string, or null")
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user