Documentation ¶
Index ¶
- type Collapsible
- type CollapsibleItem
- type CompactSearch
- type ContentSection
- type CookiesPolicy
- type EmergencyBanner
- type Error
- type ErrorResponse
- type FeatureFlags
- type InputDate
- type Metadata
- type Page
- type PageToDisplay
- type Pagination
- func (pagination Pagination) PhraseCurrentPage(progress, language string) string
- func (pagination Pagination) PhraseGoToFirstPage(language string) string
- func (pagination Pagination) PhraseGoToLastPage(language string) string
- func (pagination Pagination) PhraseGoToNextPage(language string) string
- func (pagination Pagination) PhraseGoToPreviousPage(language string) string
- func (pagination Pagination) PhrasePageNOfTotal(n int, language string) string
- func (pagination Pagination) PhrasePaginationProgress(progress, language string) string
- func (pagination Pagination) PickNextURL() string
- func (pagination Pagination) PickPreviousURL() string
- func (pagination Pagination) ShowLinkToFirst() bool
- func (pagination Pagination) ShowLinkToLast() bool
- type TableOfContents
- type TaxonomyNode
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Collapsible ¶ added in v1.10.6
type Collapsible struct { Title string `json:"title"` LocaliseKey string `json:"localise_key"` LocalisePluralInt int `json:"localise_plural_int"` CollapsibleItems []CollapsibleItem `json:"collapsible_item"` }
Collapsible maps the collapsible UI component.
The title text can be either a 'Title' or a 'LocaliseKey', the question mark will always render at the end. The 'LocaliseKey' has to correspond to the localisation key found in the toml files within assets/locales, otherwise the page will error. LocalisePluralInt refers to the plural int used in the toml file.
type CollapsibleItem ¶ added in v1.10.6
type CollapsibleItem struct { Subheading string `json:"subheading"` Content []string `json:"content"` }
CollapsibleItem is an individual representation of the data required in a collapsible item
type CompactSearch ¶ added in v1.21.0
type ContentSection ¶ added in v1.19.0
type CookiesPolicy ¶
CookiesPolicy contains data for the users cookie policy
type EmergencyBanner ¶ added in v1.10.0
type EmergencyBanner struct { Type string `json:"type"` Title string `json:"title"` Description string `json:"description"` URI string `json:"uri"` LinkText string `json:"link_text"` }
EmergencyBanner data
type ErrorResponse ¶
type ErrorResponse struct {
Error string `json:"error"`
}
type FeatureFlags ¶
type FeatureFlags struct { HideCookieBanner bool `json:"hide_cookie_banner"` ONSDesignSystemVersion string `json:"ons_design_system_version"` SixteensVersion string `json:"legacy_sixteens_version"` EnableCensusTile bool `json:"enable_census_tile"` EnableCensusBanner bool `json:"enable_census_banner"` }
FeatureFlags contains toggles for certain features on the website
type InputDate ¶ added in v1.23.0
type InputDate struct { Language string `json:"language"` Id string `json:"id"` InputNameDay string `json:"input_name_day"` InputNameMonth string `json:"input_name_month"` InputNameYear string `json:"input_name_year"` InputValueDay string `json:"input_value_day"` InputValueMonth string `json:"input_value_month"` InputValueYear string `json:"input_value_year"` Title string `json:"title"` Description string `json:"description"` }
type Metadata ¶
type Metadata struct { Title string `json:"title"` Description string `json:"description"` ServiceName string `json:"serviceName"` Keywords []string `json:"keywords"` }
Metadata ...
type Page ¶
type Page struct { Count int `json:"count"` Type string `json:"type"` DatasetId string `json:"dataset_id"` DatasetTitle string `json:"dataset_title"` URI string `json:"uri"` Taxonomy []TaxonomyNode `json:"taxonomy"` Breadcrumb []TaxonomyNode `json:"breadcrumb"` IsInFilterBreadcrumb bool `json:"is_in_filter_breadcrumb"` ServiceMessage string `json:"service_message"` Metadata Metadata `json:"metadata"` SearchDisabled bool `json:"search_disabled"` SiteDomain string `json:"-"` PatternLibraryAssetsPath string `json:"-"` Language string `json:"language"` IncludeAssetsIntegrityAttributes bool `json:"-"` ReleaseDate string `json:"release_date"` BetaBannerEnabled bool `json:"beta_banner_enabled"` CookiesPreferencesSet bool `json:"cookies_preferences_set"` CookiesPolicy CookiesPolicy `json:"cookies_policy"` HasJSONLD bool `json:"has_jsonld"` FeatureFlags FeatureFlags `json:"feature_flags"` Error Error `json:"error"` EmergencyBanner EmergencyBanner `json:"emergency_banner"` Collapsible Collapsible `json:"collapsible"` Pagination Pagination `json:"pagination"` TableOfContents TableOfContents `json:"table_of_contents"` }
Page contains data re-used for each page type a Data struct for data specific to the page type
type PageToDisplay ¶
PageToDisplay represents a page to display in pagination with their corresponding URL
type Pagination ¶
type Pagination struct { CurrentPage int `json:"current_page"` PagesToDisplay []PageToDisplay `json:"pages_to_display"` FirstAndLastPages []PageToDisplay `json:"first_and_last_pages"` TotalPages int `json:"total_pages"` Limit int `json:"limit"` LimitOptions []int `json:"limit_options,omitempty"` }
Pagination represents all information regarding pagination of search results
func (Pagination) PhraseCurrentPage ¶ added in v1.22.0
func (pagination Pagination) PhraseCurrentPage(progress, language string) string
Produces a string of the form "Current page (Page 5 of 10)"
func (Pagination) PhraseGoToFirstPage ¶ added in v1.22.0
func (pagination Pagination) PhraseGoToFirstPage(language string) string
Produces a string of the form "Go to the first page (Page 1)"
func (Pagination) PhraseGoToLastPage ¶ added in v1.22.0
func (pagination Pagination) PhraseGoToLastPage(language string) string
Produces a string of the form "Go to the last page (Page 10)"
func (Pagination) PhraseGoToNextPage ¶ added in v1.22.0
func (pagination Pagination) PhraseGoToNextPage(language string) string
Produces a string of the form "Go to the next page (Page 6)"
func (Pagination) PhraseGoToPreviousPage ¶ added in v1.22.0
func (pagination Pagination) PhraseGoToPreviousPage(language string) string
Produces a string of the form "Go to the previous page (Page 4)"
func (Pagination) PhrasePageNOfTotal ¶ added in v1.22.0
func (pagination Pagination) PhrasePageNOfTotal(n int, language string) string
Produces a string of the form "Page 1 of 10"
func (Pagination) PhrasePaginationProgress ¶ added in v1.22.0
func (pagination Pagination) PhrasePaginationProgress(progress, language string) string
Produces a string of the form "Pagination (Page 1 of 10)"
func (Pagination) PickNextURL ¶ added in v1.22.0
func (pagination Pagination) PickNextURL() string
func (Pagination) PickPreviousURL ¶ added in v1.22.0
func (pagination Pagination) PickPreviousURL() string
func (Pagination) ShowLinkToFirst ¶ added in v1.22.0
func (pagination Pagination) ShowLinkToFirst() bool
func (Pagination) ShowLinkToLast ¶ added in v1.22.0
func (pagination Pagination) ShowLinkToLast() bool
type TableOfContents ¶ added in v1.19.0
type TableOfContents struct { AriaLabelLocaliseKey string `json:"aria_label_localise_key"` AriaLabel string `json:"aria_label"` TitleLocaliseKey string `json:"title_localise_key"` Title string `json:"title"` Sections map[string]ContentSection `json:"sections"` DisplayOrder []string `json:"display_order"` }
type TaxonomyNode ¶
type TaxonomyNode struct { Title string `json:"title"` URI string `json:"uri"` Type string `json:"type,omitempty"` Children []TaxonomyNode `json:"children,omitempty"` }
TaxonomyNode ...