Aug. 26th, 2009

afuna: Cat under a blanket. Text: "Cats are just little people with Fur and Fangs" (Default)
[personal profile] afuna
Here's the process to take an existing theme layer and convert it into patch form (with all the fluff and trimmings to make it work on the customize page, have proper credit, etc).

Adding a theme layer to an existing style



To add a theme layer to an existing style, you need to edit two files:

bin/upgrading/s2layers/$layoutname/themes.s2 (or themes-local.s2)
cgi-bin/LJ/S2Theme/$layoutname.pm (or $layoutname_local.pm)

in detail )

Adding an entirely new style from a theme layer



This entry is purely about generating patches from a layer which is already s2-ified, so I won't cover the conversion from a stylesheet to a theme layer. If you need it, see the tutorial for S2 property conversion, which is thoroughly amazing. :)

Hopefully you won't need to do that yourself (the task is time-consuming, but not very complicated,so it's perfect for when you have plenty of time on your hands, but not much brainpower to spare). Let's just move on past it; I'll assume that either the theme came ready-converted, or that you did the conversion on your own.

So, you'll basically end up editing five files:

bin/upgrading/s2layers.dat
bin/upgrading/s2layers/$layoutname/layout.s2
bin/upgrading/s2layers/$layoutname/themes.s2

cgi-bin/LJ/S2Theme/$layoutname.pm
cgi-bin/LJ/S2Theme.pm

in detail )


Other things: images for layouts go under: htdocs/stc/$layoutname/imagename.png, etc. (under stc so that we can access them as relative urls from stylesheets, though in practice, we've been setting them as absolute URLs in properties by using variables, etc)

And uhh. I guess that's it!

Edit: 10/01: fixed a few errors, clarified a few instructions, courtesy of [personal profile] zvi

Profile

dw_dev_training: The stylised 'd', with the word 'dev' above, and the word 'training' at the side, representing the dw_dev_training comm. (Default)
Dreamwidth Development Training

September 2022

S M T W T F S
    123
45678910
1112131415 1617
18192021222324
252627282930 

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Aug. 15th, 2025 09:59 pm
Powered by Dreamwidth Studios