--- title: "Reference Guide" output: rmarkdown::html_vignette vignette: > %\VignetteIndexEntry{Reference Guide} %\VignetteEngine{knitr::rmarkdown} %\VignetteEncoding{UTF-8} --- # Reference for `shinyseo` This package generates metadata for a Shiny app and returns HTML tags for ``. It is useful when you want the page to look right in shares on Facebook, LinkedIn, X, Slack, and other services that read Open Graph or Twitter Card metadata. ## Main flow 1. Pass a YAML file or a named list to `social_meta()` in the UI. 2. `social_meta()` reads the data, fills in defaults, validates required fields, and builds a `tags$head()` block with metadata and a JavaScript handler. 3. Optionally call `update_meta()` in the server to update one or more fields reactively without a page reload. ## Inputs `social_meta(meta)` accepts: - a string containing a path to YAML - or a named list ### Required fields These must always exist: - `title` - `description` - `url` - `image` If one is missing, the function stops with an error. ## Defaults If you do not set them yourself, these defaults are used: - `locale = "en_US"` - `robots = "index,follow,max-image-preview:large,max-snippet:-1,max-video-preview:-1"` - `twitter_card = "summary_large_image"` - `bing_site_verification = Sys.getenv("SHINYSEO_BING_SITE_VERIFICATION")` when present - `twitter_site = Sys.getenv("SHINYSEO_TWITTER_SITE")` when present - `twitter_creator = Sys.getenv("SHINYSEO_TWITTER_CREATOR")` when present - `schema_type = "WebApplication"` - `operating_system = "Any"` - `author_type = "Person"` - `publisher_type = "Organization"` - `in_language = locale` ## What tags are created The function builds: - `` - `meta name="description"` - `meta name="robots"` - `meta property="og:*"` - `meta name="twitter:*"` - `meta name="msvalidate.01"` when Bing verification is set or when `SHINYSEO_BING_SITE_VERIFICATION` is present - `meta name="google-site-verification"` when Google verification is set - `meta name="yandex-verification"` when Yandex verification is set - `meta name="baidu-site-verification"` when Baidu verification is set - `meta name="naver-site-verification"` when Naver verification is set - `meta name="facebook-domain-verification"` when Facebook domain verification is set - `meta name="p:domain_verify"` when Pinterest domain verification is set - `