Created
          August 11, 2017 22:29 
        
      - 
      
 - 
        
Save JeffTD/39f90c84aa3a37d2b0b99304642d2a0a to your computer and use it in GitHub Desktop.  
Revisions
- 
        
JeffTD created this gist
Aug 11, 2017 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,11 @@ {% assign NationSlug = '' %} <!-- zero out variable at top of page --> {% capture ThemeURLString %}{{ theme[''] }}{% endcapture %} <!-- capture a dummy theme call which gives us a URL string containing the non-custom domain --> {% assign url_parts = ThemeURLString | split:'/' %} <br> <!-- split this URL on /'s to extract the domain (aka slug) --> {% assign SubDomain = url_parts[2] | split:'.' %} <!-- split the subdomain from nationbuilder.com --> {% if SubDomain[0] contains '-' %} <!-- if subdomain contains hyphen aka if site is not primary site --> {% assign NationSlugParts = SubDomain[0] | split:'-' %} <!-- split site.slug from nation.slug --> {% assign NationSlug = NationSlugParts[1] %} {% else %} <!-- if subdomain doesn't contain hyphen --> {% assign NationSlug = SubDomain[0] %} <!-- assign subdomain (aka nation slug) as NationSlug variable --> {% endif %} NationSlug: {{ NationSlug }}