Comments (7)
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.
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.
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.
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.
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.
@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.
Thanks @yogthos and @dl1ely! I'll try it when I have time and then maybe ask something else.
from cryogen.
Related Issues (20)
- Add support for author avatar and bio for multiple authors HOT 1
- How to change the port for `lein serve` HOT 4
- [feature] pagination for posts summary HOT 1
- [feature] unique files names HOT 1
- `clojure -M:build` exite code HOT 1
- Sass-location theme error, with fresh project, using lotus/nucleus HOT 1
- deploy in nginx, but" hljs is not defined" HOT 1
- Doc: "full build" is only mentioned in the end. HOT 3
- MathJax integration HOT 2
- RSS feed: only publishes article's "summary" HOT 2
- deps-new error when creating a new site HOT 2
- Auto-refresh feature doesn't work with Nucleus template. HOT 1
- How to upgrade old blog to newest version of Cryogen HOT 1
- How to set one post to the home page HOT 1
- Router serving static-file only works locally HOT 6
- Lotus Theme error, "resource content/themes/lotus/img not found" HOT 2
- The `/blog/blog/` problem HOT 3
- Cryogen does not list as a clojure project HOT 2
- Feature Request: Marking posts as "unlisted" HOT 3
- `lein serve` fails with "The BROWSE action is not supported on the current platform!"
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cryogen.