Giter Club home page Giter Club logo

Comments (8)

zerg000000 avatar zerg000000 commented on June 12, 2024

Agree.

I have some thoughts on this topic.

Pull out hardcoded template variables into config as default config.

            (render-file "templates/html/layouts/page.html" ;should be read from config
                         (merge params
                                {:servlet-context "../"
                                 :page            page
                                 :uri             uri}))

Select themes by using config.

Add themes folder for containing themes

templates/html -> templates/themes/default/html
templates/css -> templates/themes/default/css
templates/js -> templates/themes/default/js

The resources will be copied first. After themes resources copying, templates/{css,js,404.html}.
will be copied and override the theme's same file name resources if any.

Lookup theme by the theme name in config

This line in config.edn

{:theme "blues"}

Fetch themes from github

Create a central repository for lookup theme

cryogen-project/cryogen-themes

Add leiningen plugin lein-cryogen-theme to template project

The plugin should provide following commands

task subtask description
theme list list the themes on cryogen-project/cryogen-themes
theme add [theme-name] or [theme-github-url] download the theme to templates/themes
theme remove theme-name remove the theme from templates/themes

Add leiningen template cryogen-theme for developing a new theme

lein new cryogen-theme freaky-cool

Is it good for implementing your idea like this?

from cryogen-core.

lacarmen avatar lacarmen commented on June 12, 2024

Yes, I think this is a good way to do it. I've merged your pr and made a few fixes for the config based theme stuff in 4511536.

The project structure has been changed slightly. I'll have to reflect that in the documentation.

I'm going to leave this issue open until I add some more themes

from cryogen-core.

zerg000000 avatar zerg000000 commented on June 12, 2024

great! we should add some documentation for migrating from 0.1.21 to 0.1.22.

from cryogen-core.

LauriListak avatar LauriListak commented on June 12, 2024

Would it be possible to somehow specify additional folders in a theme file? Because right now it seems that only 'css/', 'js/' and 'html/' folders are pulled in from a theme. The current use case is to include additional fonts and images, that can be specific to a theme.

from cryogen-core.

lacarmen avatar lacarmen commented on June 12, 2024

You can add your resources in the theme folder and then specify then in the :resources parameter inside config.edn. The compiler should copy them over to the output folder

from cryogen-core.

KingMob avatar KingMob commented on June 12, 2024

Slight update, if anyone's still reading. As of 0.1.57, themes can have their own config.edn file that gets merged with the main config, so they can specify additional directories for things like :resources.

from cryogen-core.

harlanji avatar harlanji commented on June 12, 2024

I've been with Cryogen since about 0.1.60 and always known the last comment to be true and have utilized it; and I see 0.1.22 and 0.1.57 as the latest versions mentioned. Is there reason for this ticket to be open?

from cryogen-core.

lacarmen avatar lacarmen commented on June 12, 2024

Is there reason for this ticket to be open?

I guess not. The themes are swappable via config right now, but they don't pull from Github -- all of them are included when you create a Cryogen project through Leiningen. I don't see that as a problem, so let's close this.

from cryogen-core.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.