How to pass custom variable to partial in hexo?
<p><a href="https://i.stack.imgur.com/UQPNo.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/UQPNo.png" alt="layout"></a></p>

<p>I want to create an alternating layout using the static site generator <a href="http://hexo.io" rel="nofollow noreferrer">hexo</a> – the text of every second post on an overview page should be on the right. </p>

<p>The partial I’m using needs to pass on a custom variable like <code>textOrientation = "left"</code> to the partial function.</p>

<pre><code>&lt;%site.tags.findOne({name: 'featured'}).posts.sort('date', -1).limit(5).each(function(post, index) {%&gt;
    &lt;%- partial('_partial/project-excerpt', {item: post}) %&gt;
&lt;% })%&gt;
</code></pre>

<p>The template <code>project_excerp.ejs</code> then needs to generate the according classes bases on the passed variable.</p>

<p>My template (project_excerp.ejs):  </p>

<pre><code>&lt;a class="???" href="/project/&lt;%= item.slug %&gt;"&gt;&lt;%= item.title %&gt;&lt;/a&gt;
</code></pre>

<p>So the questions are:</p>

<ol>
<li>How can I extend the <code>post</code> variable with my own variable <code>textOrientation</code> and </li>
<li>How can I use an <code>if then else</code> in my <code>project_excerp.ejs</code>-template?</li>
</ol>