GithubHelp home page GithubHelp logo

Comments (7)

lacarmen avatar lacarmen commented on June 12, 2024

All of your templates should go under resources/templates/html/layouts.

The existing templates from Jekyll and Bootstrap can't be applied directly to Cryogen but you can certainly take components from them and add them to the existing templates. You just need to make sure you also copy over whatever JavaScript/CSS is needed to make those components behave as wanted.

Any changes you make to the templates shouldn't affect your content since that gets injected through Selmer once you compile your site.

from cryogen.

laughedelic avatar laughedelic commented on June 12, 2024

Ok, thank you for explanations. I get the general idea, but I'm still a bit confused with details.
Should js/css files from another theme go to resources/templates/css/ or resources/templates/html/layouts/css/? And how is this connected with the :resources setting in the .edn config?
Also, could you give any tips for changing an existing template from Jekyll (or is it called Liquid) to Selmer?
And still I don't get what does "Theming support with Twitter Bootstrap" mean.

P.S. Sorry, I don't want to be a pain in the neck with these stupid questions, but I would really appreciate your help.

from cryogen.

yogthos avatar yogthos commented on June 12, 2024

Questions are good, sometimes things are obvious to you when you design them but not necessarily to others. Hopefully, we can improve the docs based on the question to make it easy to use for everybody. :)

The idea is that stuff like css, images, js are treated as static assets that are simply copied over to the public folder. The :resources key allows specifying the asset folders that should be copied from resources/templates to resources/public when the build is triggered.

Selmer is based of Python Django templates. The idea is that you create HTML templates with whatever theme/layout you want and then you inject the content of your posts and pages into them.

The default is setup so that you have a base HTML template that has the core layout for your site. This template is laid out to work with the Bootstrap CSS.

The post and page templates inherit the base template and the appropriate dynamic content from your markdown files.

Each markdown file representing a post or a page has metadata at the top and one of the keys is the :layout key. This key specifies which HTML template to use in order to render the page.

Hope that helps.

from cryogen.

laughedelic avatar laughedelic commented on June 12, 2024

Thank you @yogthos!

Selmer is based of Python Django templates.

Does it mean that it uses the same template language (or extends it)?

This [base] template is laid out to work with the Bootstrap CSS

So you mean that I can put bootstrap CSS files in resources/templates/css and it will have effect on the base template?

Also about templates, when I'm using {% include "something.html" %} — where should I put this something.html? What is the base path for this?

from cryogen.

yogthos avatar yogthos commented on June 12, 2024

It's inspired by it, it's mostly the same, but some tags are different and there are a few differences in the functionality as well.

Right, the css files should go in the resources/templates/css folder and then you'd add the :resources ["css"] in the config in order to copy them over. The css files can then be referenced using the {% style %} tag in the template.

The something.html should be at the same location as the other templates, it would work the same as extends. For example, the post and page template extend the base template as follows: {% extends "templates/html/layouts/base.html" %}.

from cryogen.

dl1ely avatar dl1ely commented on June 12, 2024

@laughedelic To make things clear, i downloaded a theme (an the form of a bootstrap.min.css) from http://bootswatch.com/ (there are many other sites that offer free bootstrap themes), put it in resources/templates/css/ and added {% style "css/bootstrap.min.css" %} in the head-section of resources/templates/html/layouts/base.html - that was it for a start.

But you are right, as „Theming support“ was announced as a first-class feature, i also expected a simpler approach, too.

from cryogen.

laughedelic avatar laughedelic commented on June 12, 2024

Thanks @yogthos and @dl1ely! I'll try it when I have time and then maybe ask something else.

from cryogen.

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.