diff --git a/src/_components/button/index.md b/src/_components/button/index.md index 65d6c0032..171f32019 100644 --- a/src/_components/button/index.md +++ b/src/_components/button/index.md @@ -54,15 +54,15 @@ anchors: #### Base - Primary -{% include storybook-preview.html height="100px" story="button--base" base_path=site.storybook_mobile_path link_text="va-mobile__button--base" %} +{% include storybook-preview.html height="100px" story="button--base" link_text="va-mobile__button--base" is_mobile=true %} #### Base - Secondary -{% include storybook-preview.html height="100px" story="button--base-secondary" base_path=site.storybook_mobile_path link_text="va-mobile__button--base-secondary" %} +{% include storybook-preview.html height="100px" story="button--base-secondary" link_text="va-mobile__button--base-secondary" is_mobile=true %} #### Destructive -{% include storybook-preview.html height="100px" story="button--destructive" base_path=site.storybook_mobile_path link_text="va-mobile__button--destructive" %} +{% include storybook-preview.html height="100px" story="button--destructive" link_text="va-mobile__button--destructive" is_mobile=true %} ## Usage diff --git a/src/_includes/storybook-preview.html b/src/_includes/storybook-preview.html index d43f85c7f..77358fdfb 100644 --- a/src/_includes/storybook-preview.html +++ b/src/_includes/storybook-preview.html @@ -1,7 +1,7 @@ {% assign storybook_path = site.storybook_path %} -{% if include.base_path %} - {% assign storybook_path = include.base_path %} -{% endif %} +{% if include.is_mobile %}{% assign storybook_path = site.storybook_mobile_path %}{% endif %} +{% assign storybook_iframe_path = storybook_path | append: '/iframe.html?id=' | append: include.story | append: '&viewMode=story' %} +
-[{% if include.link_text %}View {{ include.link_text}}{% else %}See this{% endif %} in Storybook]({{ storybook_path }}/?path=/docs/{{ include.story }}) +{% assign story_name_prefix = '' %} +{% if include.is_mobile %}{% assign story_name_prefix = 'va-mobile_' %}{% endif %} +{% assign storybook_preview_path = site.storybook_path | append: '/?path=/story/' | append: story_name_prefix | append: include.story %} + +[{% if include.link_text %}View {{ include.link_text}}{% else %}See this{% endif %} in Storybook]({{ storybook_preview_path }})