Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix site headers on blog post pages #212

Merged
merged 3 commits into from
Aug 23, 2019

Conversation

m52go
Copy link
Contributor

@m52go m52go commented Aug 23, 2019

Right now, site headers do not render properly on blog post pages.

See example:
https://bisq.network/blog/bisq-dao-for-bitcoin-maximalists/

Fix is to add a ref property in the front matter of posts so that they are rendered with the correct site header (homepage_content.html instead of homepage_content_tr.html).

Steve Jain added 3 commits August 23, 2019 11:57
Posts were previously getting the wrong site header because of a missing
'ref' attribute.
Copy link
Contributor

@huey735 huey735 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK

I've ran this locally and it works. But can you help me understand how is Jekyll serving the page?

Is it through this lines in _layouts/default.html

<!--Select includes/main_nav according to page lang or absence of lang-->
          {% if page.lang == "en" or page.ref == "blog" %}
            {% include main_nav.html %}
          {% else %}
            {% include main_nav_tr.html %}
          {% endif %}


            {% if page.url == '/' %}

                <div class="outter">
                    {% include homepage_content.html %}
                </div>

            {% else %}

                <div class="outter">
<!-- Select includes/homepage_content according to page lang -->
                  {% if page.ref == "index" %}
                    {% include homepage_content_tr.html %}
                  {% else %}
                    {{ content }}
                  {% endif %}
                </div>

            {% endif %}

<!-- Select includes/footer according to page lang -->
              {% if page.lang == "en" or page.ref == "blog" %}
                {% include footer.html %}
              {% else %}
                {% include footer_tr.html %}
              {% endif %}

@m52go
Copy link
Contributor Author

m52go commented Aug 23, 2019

Is it through this lines in _layouts/default.html

Yes, exactly. Before adding the ref: blog front matter to posts, post pages met neither of these conditions to show main_nav.html, so main_nav_tr.html was rendered instead, which caused the problem.

@m52go m52go merged commit f5cb65e into bisq-network:master Aug 23, 2019
@m52go m52go deleted the fix-post-headers branch August 23, 2019 17:08
m52go pushed a commit that referenced this pull request Sep 5, 2019
To apply fix from #212 to this post.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants