Serve export different version

9 views
Skip to first unread message

Christian Schimanski

unread,
Jul 7, 2014, 11:28:58 AM7/7/14
to serve...@googlegroups.com
Hi,

is it possible to export different version from same project? For example i have a html that is the same for different Project only colors changing and some components. II have the colors in 3 variable.scss files and the modules in seperate .erb files. I want to tell serve for example

serve export project_1 -> using variables_1.scss and with if different component

Hope you know what i mean and there is a way. If not i need to copy my html to different locations and do changes and fixes several times.

John W. Long

unread,
Jul 8, 2014, 11:28:45 AM7/8/14
to serve...@googlegroups.com
It should be possible to do something like this with environment variables. Try the following...

Add a helper in your view helpers:

    def theme
      ENV[’THEME’]
    end

Then in your layout:

    <% if theme %>
       <link rel="stylesheet" type="text/css" href=“<%= theme %>.css”>
    <% end %>

And on the console:

    THEME=“cobalt” serve export …

Completely untested, but should work.

—John

--
--
Serve Users Group
Mailing List: http://groups.google.com/group/serve-users/
Project: http://github.com/jlong/serve/

---
You received this message because you are subscribed to the Google Groups "Serve Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to serve-users...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

signature.asc

Christian Schimanski

unread,
Jul 9, 2014, 5:24:20 AM7/9/14
to serve...@googlegroups.com
Runs perfect, thanks.

And with theme="cobalt" serve export html/cobalt i can output every theme to its own folder

runs with

theme="cobalt" serve

for testing


thank you

Christian Schimanski

unread,
Jul 14, 2014, 9:48:42 AM7/14/14
to serve...@googlegroups.com
Is it not possible to use it under windows? I tried only mac until now, but now i need it on windows too.

But i fi use theme="test" serve or theme="test" serve export i get theme command not found.

John Long

unread,
Jul 14, 2014, 10:01:13 AM7/14/14
to serve...@googlegroups.com
Looks like you need to use the `set` command to set the environment
variable before running the command on windows:

set theme="cobalt"
serve export

--John
>>> THEME="cobalt" serve export ...
>>>
>>> Completely untested, but should work.
>>>
>>> --John
Reply all
Reply to author
Forward
0 new messages