Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
Include videos by default #44
I think that this plugin should include the video in the post by default when it imports from instagram. I know https://gist.github.com/jtsternberg/b7c3b5371c6f639693b8f086859ad129 exists, but I feel like that shouldn't be necessary, and it doesn't give any straightforward way to stick the video into e.g. the middle of the post.
I think we should add some new tags like
Additionally it might make sense to have content-type conditionals such as
Or, alternatively, different templates for different types.
Hey, @jtsternberg: I've been thinking about this for a couple of days, and I wanted to hear your thoughts before I go to far on an implementation.
To fully support videos and carousels in the template, I think we'd need these additions:
The default template would then look something like this:
However, this is starting to get a little complex, and I'm starting to think that we've reached the point where it might make sense to just use a third-party templating language & library instead of implementing all of the above ourselves. I don't have any particular one in mind, and I don't have a strong opinion on it; what do you think?
Oh, and one other thing that crossed my mind and is vaguely related to this: It'd be nice to provide the ability to re-apply an updated template to existing posts. I think we'd need to save the original instagram text in a meta field, and the order of the attachments for carousel posts. Is there anything else we'd need?
One more followup thought: perhaps we could simplify
That would simplify the default template a bit by allowing the it to skip the first two lines and the condition on the third line:
I think that certainly feels a little more friendly and DRY.
We could still keep the conditionals for more advanced usage, but I think this feels like a better starting place. (I think this also makes sense with a third-party templating library.)
I like your thoughts on this, but will introduce more mental overhead when trying to setup the importer settings. If we implement this, I think it would likely be best if we setup a wiki on this repo and link to it from the plugin for help with advanced options. Honestly, this is something I should do either way.
Let me know if you'd like to submit a PR for this.
Yea, I started working on this with twig 1.x (because 1.x supports all of the old versions of PHP that wordpress does), but I don't have it in a working state yet.
I think that's probably going to be the way to go, if it proves too difficult (or to have many conflicts with other WP modules), then I'll drop twig and work on improving the hand-rolled template system.