Search code examples
javascripthtmltumblrjquery-masonry

Adding {meta:tags} to Masonry on Tumblr


This might sound a bit odd.

I'm trying to make my first tumblr theme and also trying to make it highly customisable.

ie using meta tags instead of hard coded values

<meta name="color:Title" content="#000000"/>

.title {
color:{color:Title};
}

etc

One of the things i'm trying to customise is gutter width - this is currently held in a Masonry variable

$tumblelog.imagesLoaded(function () {
        $tumblelog.masonry({
            columnWidth: 500,       // DEFINES POST WIDTH IN PX
            gutterWidth: 10,        // DEFINES GUTTER WITDH IN PX
            isFitWidth: true        // CENTERS COLUMNS ON PAGE
        });
    });

although i don't really understand how i can add an html meta tag to that JS value. (i imagine i can't.)

but is there a way i can call that value from outside the script or something? how do i make that customisable?

thanks :)


F I X E D : although StackOverflow doesn't let me answer my own question yet :)


ah that was easier than I thought

create Meta tag ie

<meta name="text:Gutter" content="20"/>

then add meta discriptor to JS

   gutterWidth: {text:Gutter},     // DEFINES GUTTER WITDH IN PX

turns out it just works but the tumblr editor bugs out at first

just have to SAVE+CLOSE and it auto updates :)


Solution

  • ah that was easier than I thought

    create Meta tag ie

    <meta name="text:Gutter" content="20"/>
    

    then add meta discriptor to JS

    gutterWidth: {text:Gutter},     // DEFINES GUTTER WITDH IN PX
    

    turns out it just works but the tumblr editor bugs out at first - just have to SAVE+CLOSE and it auto updates :)