# Liquid conditional logic producing different results on different machines

**URL:** <https://talk.jekyllrb.com/t/liquid-conditional-logic-producing-different-results-on-different-machines/1020>\
**Category:** Help\
**Created:** [September 28, 2017, 2:19pm UTC](https://talk.jekyllrb.com/t/liquid-conditional-logic-producing-different-results-on-different-machines/1020 "2017-09-28T14:19:15Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![marii](https://avatars.discourse-cdn.com/v4/letter/m/5daacb/32.png) [@marii](https://talk.jekyllrb.com/u/marii)\
**Post date:** [September 28, 2017, 2:19pm UTC](https://talk.jekyllrb.com/t/liquid-conditional-logic-producing-different-results-on-different-machines/1020/1 "2017-09-28T14:19:15Z")

</div>

I have a simple Jekyll site that switches between Arabic and English versions of my pages with a language selector include, as follows:

```
<div class="language-selector">

  <!-- get opposite lang -->
  {% if page.lang == 'en' %}{% assign lang_change = 'ar' %}
  {% else %}{% assign lang_change = 'en' %}{% endif %}

  <!-- construct link differently for photo pages, index pages, and regular pages -->
  {% if page.layout == "photo-page" %}
    <a href="{{ baseurl }}/photopages/{{ lang_change }}/{{ page.ref }}.html">
  {% elsif page.ref == 'index' %}
    <a href="{{ site.index[lang_change] | relative_url }}">
  {% else %}
    <a href="{{ baseurl }}/{{ lang_change }}/{{ page.ref }}.html">
  {% endif %}

  <!-- print language and close link -->
  {% if lang_change == 'ar' %}العربية
  {% elsif lang_change == 'en' %}English{% endif %}
    </a>
</div>

```

Everything works perfectly on my end:

Regular pages go from /en/ref.html \<–\> /ar/ref.html  
My index page knows to switch from the root \<–\> /ar/index.html and  
Photopages switch from /photopages/en/ref.html \<–\> /photopages/ar/ref.html  
However, when my repository is cloned and the site is built and put on the in Sudan, the photopages lose the “/photopages/” part of the link, so that:

/photopages/en/ref.html --\> /ar/ref.html --\> 404

Has anyone encountered anything like this? I’ve tried it on multiple machines, including an Ubuntu VM to mirror the prod server, but am unable to even reproduce the issue.

Example: [http://sudanphoto.uofk.edu/photopages/en/NAS-01-001.html](http://sudanphoto.uofk.edu/photopages/en/NAS-01-001.html)

---

<div class="post-metadata">

**Author:** ![rdyar](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/rdyar/32/710_2.png) [@rdyar](https://talk.jekyllrb.com/u/rdyar)\
**Post date:** [September 28, 2017, 4:48pm UTC](https://talk.jekyllrb.com/t/liquid-conditional-logic-producing-different-results-on-different-machines/1020/2 "2017-09-28T16:48:28Z")

</div>

> [@marii](#):
>
> {% if page.layout == “photo-page” %}

I would guess that this part is the problem, no idea why it would work locally but not somewhere else.

What is the front matter for that page?

You could also compare the url with `contains` - `if page.url contains "photopages"` (something like that - just wrote that from memory so probably something wrong with it).
