Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upvariable content slides on homepage, how? #227
Comments
|
It sounds to me like you're imagining Metalsmith to be a much higher-level library than it is. Metalsmith isn't a UI framework; it's a static site generator. You implement a carousel in Metalsmith the same way you would on any website: by writing the necessary HTML/CSS/JavaScript yourself, or by using an existing library that does it for you. (Slick was the first example of such a library that appeared when I Googled it.) |
|
Hey, thanks for the reply but that is not what im asking. I aleeady have frontend, im using metalsmith as "backend" if it can be called that :) simplest solution that comes to mind is creating a custom object with parameter link / title / thumb than loop over it in tempkate file and display my slider, but there surely is a better way right? |
|
I'm still not quite sure what you're asking. What plugins are you currently using? metalsmith-collections should allow accessing a list of "posts" through the global metadata if that's what you're looking for... |
|
I'm using quite a lot of plugins actually, including collections.
I want to display articles and projects on my slider. slide1:article1,article2,project6 What I would do in say laravel/RoR is to create a table (Entity–attribute–value model) with col1=key/col2=value combination, key would be a slide name/order, and value would be a serialised list of article ids. Than in template I'd run foreach on those and display slides with attached articles. back to metalsmith.
but this seems tedious, and I don't want to keep track of each article url, or title, I want them to come from article.md files themselves. So I've following issues:
this is the best I can do. sorry if my explanation is not great. |
|
This sounds like something you may want to use a custom plugin for. You can "query" for projects by accessing the Here's an article on writing plugins for Metalsmith. If you're already familiar with JavaScript the process is actually pretty straightforward: http://www.andrewgoodricke.com/blog/metalsmith-plugins/ |
How would you implement something like this in metalsmith?
Problem 1:
I've N amount of slides on homepage. Each slide can contain N amount of Posts.
I want to manually control N amount of slides, and posts that are displayed there.
Problem 2:
Post featured image.