So just in case anyone finds this through searching. So in rails I created a layout template with this content: app_proxy.html.erb {%- layout none -%}
<%= @theme.value.html_safe %> The first line is important because that tells Shopify to render the page without any of the normal layout. Then in controller I load the layout/theme.liquid from the theme through the API so I can change the content of it. I do a simple find and replace on the title tag and something similar (but unfortunately not very "nice" because of the way it is in the template) with the meta description. Then I put my content in with the doing a simple find an replace on the main content liquid tag. I then make sure to send this all back to Shopify with the application/liquid header so that Shopify then renders the full page as normal. Something like this: ShopifyAPI::Base.activate_session(ShopifyAPI::Session.new(domain: @shop.shopify_domain, token: @shop.shopify_token, api_version: '2019-04'))
shop_name = ShopifyAPI::Shop.current.name
site_name = " - #{shop_name}"
page_title.concat(site_name)
meta_desc = "</title><meta name='description' content='#{meta_desc}'>"
@theme = ShopifyAPI::Asset.find('layout/theme.liquid')
content = render_to_string "index", format: :html, layout: false
@theme.value.sub!('{{ content_for_layout }}', content)
@theme.value.sub!('{{ page_title }}', page_title)
@theme.value.sub!('</title>', meta_desc)
render layout: "app_proxy", content_type: 'application/liquid' It's not a perfect solution, but it does the job! Thanks to Ole Thorup for his input on the Shopify Slack Partners Slack workspace.
... View more