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

[Bug]: page variables to not rendered correctly #9519

Open
yonz2 opened this issue Jan 3, 2024 · 2 comments
Open

[Bug]: page variables to not rendered correctly #9519

yonz2 opened this issue Jan 3, 2024 · 2 comments

Comments

@yonz2
Copy link

yonz2 commented Jan 3, 2024

Operating System

Ubuntu 20.04.6

Ruby Version

ruby 3.2.2 (2023-03-30 revision e51014f9c0) [x86_64-linux]

Jekyll Version

jekyll 4.3.3

  * jekyll (4.3.3)
        Summary: A simple, blog aware, static site generator.
        Homepage: https://jekyllrb.com
        Source Code: https://github.com/jekyll/jekyll
        Changelog: https://github.com/jekyll/jekyll/releases
        Bug Tracker: https://github.com/jekyll/jekyll/issues
        Path: /usr/local/rvm/gems/ruby-3.2.2/gems/jekyll-4.3.3
        Reverse Dependencies: 
                jekyll-data (1.1.1) depends on jekyll (>= 3.3, < 5.0.0)
                jekyll-feed (0.17.0) depends on jekyll (>= 3.7, < 5.0)
                jekyll-include-cache (0.2.1) depends on jekyll (>= 3.7, < 5.0)
                jekyll-polyglot (1.7.0) depends on jekyll (>= 4.0, >= 3.0)
                jekyll-remote-theme (0.4.3) depends on jekyll (>= 3.5, < 5.0)
                jekyll-sitemap (1.4.0) depends on jekyll (>= 3.7, < 5.0)
                minimal-mistakes-jekyll (4.24.0) depends on jekyll (>= 3.7, < 5.0)

GitHub Pages Version

No response

Expected Behavior

I expect the page.title and pages.lang variables to render correctly on bundle exec jekyll build

Current Behavior

Consider this frontmatter for a page:

---
layout: single
title: Über uns
permalink: /about/
page-id: about
header:
  overlay_image: /assets/images/NetInnovate_TitleImage.png
lang: de
toc: false
---

The following code snippet:

  <select id="language-switcher-select" autocompletion="off" onchange="window.location.href = this.value;">
    {% for lang in site.languages %}
      <option value="{{ lang }}" {% if lang==page.lang %}selected{% endif %}>{{ site.data[lang].l10n.lang_name }}</option>
      <!--  {{ lang }} , {{ page.lang }}, {{ site.default_lang }}, {{ page.title }} -->
    {% endfor %}
  </select>

Renders as:

  <select id="language-switcher-select" autocompletion="off" onchange="window.location.href = this.value;">
    
      <option value="en" selected>English</option>
      <!--  en , en, en, Revolutionizing ITSM with AI: Automating Issue Classification and Resolution -->
    
      <option value="de" >Deutsch</option>
      <!--  de , en, en, Revolutionizing ITSM with AI: Automating Issue Classification and Resolution -->
    
  </select>

Here the page.lang and page.title variables are wrong. Their values are actually taken from the frontmatter of the first file in the ./_posts folder. The frontmatter of that file is:

---
layout: posts
title: "Revolutionizing ITSM with AI: Automating Issue Classification and Resolution"
date: 2023-11-15
categories: AI
lang: en
---

Relevant log output

@yonz2 ➜ /workspaces/netinnovate (main) $ bundle exec jekyll build
Configuration file: /workspaces/netinnovate/_config.yml
To use retry middleware with Faraday v2.0+, install `faraday-retry` gem
            Source: /workspaces/netinnovate
       Destination: /workspaces/netinnovate/_site
 Incremental build: disabled. Enable with --incremental
      Generating... 
       Jekyll Feed: Generating feed for posts
       Jekyll Feed: Generating feed for posts
                    done in 0.805 seconds.
 Auto-regeneration: disabled. Use --watch to enable.
@yonz2 ➜ /workspaces/netinnovate (main) $ bundle exec jekyll build -V | grep about
To use retry middleware with Faraday v2.0+, install `faraday-retry` gem
           Reading: _pages/about-de.md
           Reading: _pages/about-en.md
           Reading: _pages/about-de.md
           Reading: _pages/about-en.md
         Rendering: _pages/about-en.md
  Pre-Render Hooks: _pages/about-en.md
  Rendering Markup: _pages/about-en.md
Post-Convert Hooks: _pages/about-en.md
  Rendering Layout: _pages/about-en.md
         Rendering: _pages/about-de.md
  Pre-Render Hooks: _pages/about-de.md
  Rendering Markup: _pages/about-de.md
Post-Convert Hooks: _pages/about-de.md
  Rendering Layout: _pages/about-de.md
           Writing: /workspaces/netinnovate/_site/about/index.html
           Writing: /workspaces/netinnovate/_site/de/about/index.html

Code Sample

Steps to reproduce

I use github CodeSpace to run my code.

Repo: https://github.com/yonz2/netinnovate

So to reproduce, create a codespace for the repo, run bundle update followed by bundle exec jekyll build and inspect the generated output in e.g. ./_site/de/about/index.html

See also an issue files on the Polyglot repo untra/polyglot#187

@yonz2 yonz2 changed the title [Bug]: page variables to not rendered correctly [Bug]: page variables to not rendered correctly Jan 3, 2024
@vincerubinetti
Copy link

Just curious, was this working properly before 4.3.3 released a few weeks ago? I'm experiencing some other bugs -- possibly related, possibly not -- where code that was working fine previously now throws Liquid errors, and I'm wondering if the last release broke some things.

@yonz2
Copy link
Author

yonz2 commented Jan 26, 2024

Not sure ... I gave up on this and re implemented everything in Hugo

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

No branches or pull requests

2 participants