use-init/init

More specific configuration for pages

Opened this issue · 2 comments

Hey guys,

thanks for putting this together. :)

One question, I just wanted to kick off a new project and am wondering how you guys deal with page specific stuff like different page titles for example.

As far as I see, it's currently always the same (header.phtml)? Please correct me if I'm wrong.

If I'm correct, do you have plans to make that configurable via pages.json maybe?

Thanks.

Already saw this issue #31, which kind of goes in the same direction.

Hey, you could use replace placeholders for that—please look at how we deal with CSS paths (hint: have a look into grunt replace task and its config).
But I agree, it’s not ideal at the moment. Thanks also for sharing the idea to extend the json for this. I like the idea of having this out of the box but easier than it is currently.

Hey, you could use replace placeholders for that—please look at how we deal with CSS paths (hint: have a look into grunt replace task and its config).

Hah, that's exactly what I did. ;)
I'll do it again.

    // Versioned references
    replace: {
        build: {
            src: 'temp/**.html',
            dest: 'dist/',
            maincss: '<%= pkg.version %>/main.min.css',
            modernizr: '<%= pkg.version %>/modernizr.min.js',
            mainjs: '<script src="<%= pkg.version %>/main.min.js"></script>'
        },

        dev: {
            src: 'temp/**.html',
            dest: '.',
            maincss: 'css/main.css',
            modernizr: 'components/modernizr/modernizr.js',
            mainjs: '<script data-main="js/config" src="components/requirejs/require.js"></script>'
        }
    }

But it's basically not the same. You're replacing one placeholder with one value for each site. What I'd like to do, is replacing one placeholder with different values.

Kind of like that ( but with title for example ) -> https://github.com/outaTiME/grunt-replace#built-in-replacements.

Anyway, thanks for quick reply. I'll probably figure something out. :)