Comments (8)
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.
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.
great! we should add some documentation for migrating from 0.1.21 to 0.1.22.
from cryogen-core.
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.
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.
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.
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.
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)
- Change in clean-urls behaviour HOT 7
- Relax config schema
- Centred blue theme inconsistency HOT 1
- Changing `:public-dest` seems to break CSS/JS access HOT 6
- Compass is unmaintained since 2016 HOT 1
- Provide :preview-plaintext to every post, page for SEO HOT 1
- Provide an option to drop the date from file names HOT 2
- Should be able to configure the class on generated toc's HOT 1
- Proposal: Replace :content with :content-dom HOT 3
- An exception in compile-assets-timed should fail the build HOT 2
- Bug: cannot set a page as homepage HOT 1
- Overriding Config HOT 6
- Tags with special characters get a broken tag-output page. Like tag C# HOT 2
- <!-more-> marker characters HOT 5
- Adding `:posts` and `:pages` to params via :extend-params-fn does not behave as expected HOT 3
- Make :posts and :pages available in all posts and pages by default HOT 1
- Making css processing a plugin HOT 1
- Proposed enhancement: Automatically generate post metadata from plain markdown file HOT 9
- It would be nice to omit pages from prev/next if :page-index nil HOT 8
- Add header block for Google's 'Rich Snippets' nonsense HOT 2
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-core.