feat: publisher, local business and home crumb settings
- Publisher and Local business tabs with the C20 refusals (sameAs lines, person as local business, address, times, country, coordinates) - the publisher node from the settings, as an Organization, a Person or the chosen local business type with address, geo and opening hours - P8 publisher preview with Google's required and recommended findings (classes/schema Validate) - the home crumb name on the General tab; every new key in the settings API and seo_update_settings
This commit is contained in:
@@ -34,6 +34,25 @@ type UpdateSettingsInput struct {
|
||||
VerifyOther *[]models.VerifyMeta `json:"verify_other,omitempty" jsonschema:"other verification meta tags (name, content)"`
|
||||
VerifyFiles *[]models.VerifyFile `json:"verify_files,omitempty" jsonschema:"verification files served from the site root (filename, body)"`
|
||||
CSVDelimiter *string `json:"csv_delimiter,omitempty" jsonschema:"the import and export delimiter: , or ;"`
|
||||
BreadcrumbHome *string `json:"breadcrumb_home,omitempty" jsonschema:"the home page name in breadcrumb trails and BreadcrumbList (default locale); empty: Home / Strona główna"`
|
||||
PublisherType *string `json:"publisher_type,omitempty" jsonschema:"who publishes the site in the JSON-LD of every page: organization or person"`
|
||||
PublisherName *string `json:"publisher_name,omitempty" jsonschema:"the publisher name (default locale); empty: the site name"`
|
||||
PublisherLogo *string `json:"publisher_logo,omitempty" jsonschema:"the organisation logo (at least 112x112 px) or the person's photo: a URL or a site path"`
|
||||
PublisherURL *string `json:"publisher_url,omitempty" jsonschema:"the publisher website, an https URL; empty: the site address"`
|
||||
PublisherEmail *string `json:"publisher_email,omitempty" jsonschema:"the publisher contact email"`
|
||||
PublisherPhone *string `json:"publisher_phone,omitempty" jsonschema:"the publisher phone with the country code, e.g. +48 600 000 000"`
|
||||
PublisherSameAs *string `json:"publisher_same_as,omitempty" jsonschema:"profiles elsewhere (sameAs), one https URL per line"`
|
||||
LocalEnabled *bool `json:"local_enabled,omitempty" jsonschema:"publish the organisation as a local business (not for a person)"`
|
||||
LocalType *string `json:"local_type,omitempty" jsonschema:"the local business type: LocalBusiness, ProfessionalService, Store, FoodEstablishment, HealthAndBeautyBusiness, MedicalBusiness, LegalService, HomeAndConstructionBusiness, AutomotiveBusiness or FinancialService"`
|
||||
LocalPriceRange *string `json:"local_price_range,omitempty" jsonschema:"the price range, e.g. 50–200 zł or $$"`
|
||||
LocalStreet *string `json:"local_street,omitempty" jsonschema:"street and number (required for a local business)"`
|
||||
LocalPostalCode *string `json:"local_postal_code,omitempty" jsonschema:"postal code (required for a local business)"`
|
||||
LocalCity *string `json:"local_city,omitempty" jsonschema:"city (required for a local business)"`
|
||||
LocalRegion *string `json:"local_region,omitempty" jsonschema:"region"`
|
||||
LocalCountry *string `json:"local_country,omitempty" jsonschema:"two-letter country code, e.g. PL"`
|
||||
LocalLatitude *string `json:"local_latitude,omitempty" jsonschema:"latitude in decimal degrees (-90 to 90)"`
|
||||
LocalLongitude *string `json:"local_longitude,omitempty" jsonschema:"longitude in decimal degrees (-180 to 180)"`
|
||||
LocalHours *[]models.OpeningHours `json:"local_hours,omitempty" jsonschema:"opening hours rows: day (mon … sun), opens and closes in 24-hour HH:MM; two rows split a day, a day without rows is closed"`
|
||||
Types map[string]classes.TypeSettingWrite `json:"types,omitempty" jsonschema:"per content type key: inject (show the SEO tab), title_template, description_template, robots"`
|
||||
}
|
||||
|
||||
|
||||
@@ -107,8 +107,8 @@ type stagingView struct {
|
||||
}
|
||||
|
||||
// PartialData serves the staging callout, shown outside production where
|
||||
// every page is noindex whatever the settings say (D-22), and the P3
|
||||
// placeholder table.
|
||||
// every page is noindex whatever the settings say (D-22), the P3
|
||||
// placeholder table and the P8 publisher preview.
|
||||
func (c settingsAdminController) PartialData(ctx context.Context, name string, _ any) (any, error) {
|
||||
switch name {
|
||||
case "staging":
|
||||
@@ -119,6 +119,12 @@ func (c settingsAdminController) PartialData(ctx context.Context, name string, _
|
||||
return nil, err
|
||||
}
|
||||
return svc.Placeholders(ctx), nil
|
||||
case "publisher_preview":
|
||||
svc, err := classes.NewService(appOf(c.app))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return svc.PublisherPreview(ctx)
|
||||
}
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
14
controllers/settings/_publisher_preview.htm
Normal file
14
controllers/settings/_publisher_preview.htm
Normal file
@@ -0,0 +1,14 @@
|
||||
{{- if .Data.JSON -}}
|
||||
<div class="summer-markdown">
|
||||
<pre>{{ .Data.JSON }}</pre>
|
||||
</div>
|
||||
{{- end -}}
|
||||
{{- range .Data.Findings -}}
|
||||
<div class="summer-callout summer-callout--warning" role="status">
|
||||
<p class="summer-callout__text">{{ . }}</p>
|
||||
</div>
|
||||
{{- else -}}
|
||||
<div class="summer-callout" role="status">
|
||||
<p class="summer-callout__text">{{ .Data.AllGood }}</p>
|
||||
</div>
|
||||
{{- end -}}
|
||||
Reference in New Issue
Block a user