alshedivat / al-folio

A beautiful, simple, clean, and responsive Jekyll theme for academics
https://alshedivat.github.io/al-folio/
MIT License
9.96k stars 10.73k forks source link

Issue with Collections in _config.yml and Liquid Exception Error during Deployment #2012

Closed VishalKumar-S closed 6 months ago

VishalKumar-S commented 6 months ago

Hi, I'm experiencing an issue with my Jekyll site using the al-folio theme. The problem arises when I try to deploy my site using the bin/deploy --user command.

The main issues are:

  1. Collections in _config.yml: Whenever I run my deployment command, the achievements collection in my _config.yml file gets erased automatically. I have to manually add it back each time before I build the site to make it work again. I commit each time after making the changes.

  2. Liquid Exception Error: I'm also encountering a Liquid Exception error during the build process. The error message is Liquid error (line 55): Cannot sort a null object. in my achievements.html layout.

Here are the relevant snippets from my _config.yml:

`

_config.yml

collections: projects: output: true permalink: /projects/:path/ achievements: output: true permalink: /achievements/:path/

After running the deploy command, the achievements collection disappears from _config.yml:

Collections

collections: latest achievements: defaults: layout: post output: true permalink: /achievements/:path/ projects: output: true permalink: /projects/:path/ `

When I try bin/deploy --user, all the new changes made get reverted, and the older version is restored. In this process, my “Achievements” section collections get removed, causing a sort error since the collections cannot be found inside _site. If I try to add the respective collections code part in _config.yml, I can see the website locally successfully, but if I deploy, the same issue persists. I cannot resolve it, no matter how much I try. Can you help me with this issue?

Thank you!

Best, Vishal _pages/achievements.md

VishalKumar-S commented 6 months ago

_layouts/achievements.html layouts-achievements-html.txt

VishalKumar-S commented 6 months ago

config.yml config-yml.txt

VishalKumar-S commented 6 months ago

@george-gca @alshedivat

george-gca commented 6 months ago

Do you really need to manually call bin/deploy? Also where are you looking for the changes?

When pasting code here, use the GitHub markdown for this.

VishalKumar-S commented 6 months ago

I don't know whether there are other ways to deploy, if yes, can u tell me, other than bin/deploy --user to deploy Jekyll al-folio (I am a beginner in it), I'll share more details about the issue, I need to add the achievements section to my portfolio, after adding the necessary collection, including, pages, it is working smoothly, build-success-config.yml collections terminal output But, after that, when I try to deploy after I commit, I face this issue, deploy command terminal auto-removal of achievements collection in config Here, you can see the "achievements" collections disappeared. Along, other code file changes related to the achievements section are also reverted to their previous versions.

VishalKumar-S commented 6 months ago

Code files:

config.yml

# -----------------------------------------------------------------------------
# Site settings
# -----------------------------------------------------------------------------

title: blank # the website title (if blank, full name will be used instead)
first_name: Vishal
middle_name: Kumar
last_name: S
email: vishalkumars.work@gmail.com
description: > # the ">" symbol means to ignore newlines until "footer_text:"
  A simple, whitespace theme for academics. Based on [*folio](https://github.com/bogoli/-folio) design.
footer_text: >
  Powered by <a href="https://jekyllrb.com/" target="_blank">Jekyll</a> with <a href="https://github.com/alshedivat/al-folio">al-folio</a> theme.
  Hosted by <a href="https://pages.github.com/" target="_blank">GitHub Pages</a>.
  Photos from <a href="https://unsplash.com" target="_blank">Unsplash</a>.
keywords: jekyll, jekyll-theme, academic-website, portfolio-website  # add your own keywords or leave empty

lang: en # the language of your site (for example: en, fr, cn, ru, etc.)
icon: ⚛️  # the emoji used as the favicon (alternatively, provide image name in /assets/img/)

url: https://VishalKumar-S.github.io # the base hostname & protocol for your site
baseurl: # the subpath of your site, e.g. /blog/
last_updated: false # set to true if you want to display last updated in the footer
impressum_path:  # set to path to include impressum link in the footer, use the same path as permalink in a page, helps to conform with EU GDPR

# -----------------------------------------------------------------------------
# Theme
# -----------------------------------------------------------------------------

# repo color theme
repo_theme_light: default       # https://github.com/anuraghazra/github-readme-stats/blob/master/themes/README.md
repo_theme_dark: dark           # https://github.com/anuraghazra/github-readme-stats/blob/master/themes/README.md
repo_trophies:
  enabled: true
  theme_light: flat    # https://github.com/ryo-ma/github-profile-trophy
  theme_dark: gitdimmed  # https://github.com/ryo-ma/github-profile-trophy

# -----------------------------------------------------------------------------
# RSS Feed
# -----------------------------------------------------------------------------
# will use title and url fields
# Take a look to https://github.com/jekyll/jekyll-feed for more customization

rss_icon: true

# -----------------------------------------------------------------------------
# Layout
# -----------------------------------------------------------------------------

navbar_fixed: true
footer_fixed: true

# Dimensions
max_width: 800px

# TODO: add layout settings (single page vs. multi-page)

# -----------------------------------------------------------------------------
# Open Graph & Schema.org
# -----------------------------------------------------------------------------
# Display links to the page with a preview object on social media.
serve_og_meta: false # Include Open Graph meta tags in the HTML head
serve_schema_org: false # Include Schema.org in the HTML head
og_image: # The site-wide (default for all links) Open Graph preview image

# -----------------------------------------------------------------------------
# Social integration
# -----------------------------------------------------------------------------

github_username: VishalKumar-S
gitlab_username: # your GitLab user name
twitter_username: VishalKumarS11
mastodon_username: # your mastodon instance+username in the format instance.tld/@username
linkedin_username: vishal-kumar-s-095491247/
telegram_username: # your Telegram user name
scholar_userid: # your Google Scholar ID
semanticscholar_id: # your Semantic Scholar ID
whatsapp_number: +91 6383358799
orcid_id: # your ORCID ID
medium_username: # your Medium username
quora_username: # your Quora username
publons_id: # your ID on Publons
lattes_id: # your ID on Lattes (Brazilian Lattes CV)
osf_id: # your OSF ID
research_gate_profile: # your profile on ResearchGate
scopus_id: # your profile on Scopus
blogger_url: # your blogger URL
work_url: # work page URL
keybase_username: # your keybase user name
wikidata_id: # your wikidata id
wikipedia_id: # your wikipedia id (Case sensitive)
dblp_url: # your DBLP profile url
stackoverflow_id: # your stackoverflow id
kaggle_id: # your kaggle id
lastfm_id: # your lastfm id
spotify_id: # your spotify id
pinterest_id: # your pinterest id
unsplash_id: # your unsplash id
instagram_id: # your instagram id
facebook_id: # your facebook id
youtube_id: # your youtube channel id (youtube.com/@<youtube_id>)
discord_id: 980336736381054986
zotero_username: # your zotero username
wechat_qr: # filename of your wechat qr-code saved as an image (e.g., wechat-qr.png if saved to assets/img/wechat-qr.png)

contact_note: >
  Welcome to my portfolio! Whether you're exploring potential collaborations, job opportunities, or just sharing common interests, I'm delighted to connect. Feel free to reach out through any of the listed platforms. Let's engage in discussions about data science, machine learning, and technology. I'm excited about the possibility of working together or sharing insights in the world of data!

# -----------------------------------------------------------------------------
# Analytics and search engine verification
# -----------------------------------------------------------------------------

google_analytics:  # your Google Analytics measurement ID (format: G-XXXXXXXXXX)
cronitor_analytics:  # cronitor RUM analytics site ID (format: XXXXXXXXX)

google_site_verification:  # your google-site-verification ID (Google Search Console)
bing_site_verification:  # out your bing-site-verification ID (Bing Webmaster)

# -----------------------------------------------------------------------------
# Blog
# -----------------------------------------------------------------------------

blog_name: My Blogs # blog_name will be displayed in your blog page
blog_nav_title: Blog # your blog must have a title for it to be displayed in the nav bar
blog_description: My Published Blogs
permalink: /blog/:year/:title/

# Pagination
pagination:
  enabled: true

related_blog_posts:
  enabled: false
  max_related: 5

# Giscus comments (RECOMMENDED)
# Follow instructions on https://giscus.app/ to setup for your repo to fill out
# the information below.
giscus:
  repo:                          # <your-github-user-name>/<your-github-repo-name>
  category: Comments             # name of the category under which discussions will be created
  mapping: title                 # identify discussions by post title
  strict: 1                      # use strict identification mode
  reactions_enabled: 1           # enable (1) or disable (0) emoji reactions
  input_position: bottom         # whether to display input form below (bottom) or above (top) the comments
  theme: preferred_color_scheme  # name of the color scheme (preferred works well with al-folio light/dark mode)
  emit_metadata: 0
  lang: en

# Disqus comments (DEPRECATED)
disqus_shortname: al-folio # put your disqus shortname
# https://help.disqus.com/en/articles/1717111-what-s-a-shortname

# External sources.
# If you have blog posts published on medium.com or other external sources,
# you can display them in your blog by adding a link to the RSS feed.
# external_sources:
#   - name: medium.com
#     rss_url: https://medium.com/@al-folio/feed

# -----------------------------------------------------------------------------
# Collections
# -----------------------------------------------------------------------------

# Collections
collections:
  # latest achievements:
  #   defaults:
  #     layout: post
  #   output: true
  #   permalink: /achievements/:path/
  projects:
    output: true
    permalink: /projects/:path/
  achievements:
    output: true
    permalink: /achievements/:path/

# announcements:
#   enabled: true
#   scrollable: true # adds a vertical scroll bar if there are more than 3 news items
#   limit: 5 # leave blank to include all the news in the `_news` folder

latest_posts:
  enabled: true
  scrollable: true # adds a vertical scroll bar if there are more than 3 new posts items
  limit: 3 # leave blank to include all the blog posts

# latest_achievements:
#   enabled: true
#   scrollable: true # adds a vertical scroll bar if there are more than 3 new posts items
#   limit: 3 # leave blank to include all the blog posts

# -----------------------------------------------------------------------------
# Jekyll settings
# -----------------------------------------------------------------------------

# Markdown and syntax highlight
markdown: kramdown
highlighter: rouge
kramdown:
  input: GFM
  syntax_highlighter_opts:
    css_class: 'highlight'
    span:
      line_numbers: false
    block:
      line_numbers: false
      start_line: 1

# Includes & excludes
include: ['_pages']
exclude:
  - bin
  - Gemfile
  - Gemfile.lock
  - vendor
keep_files:
  - CNAME
  - .nojekyll
  - .git

# Plug-ins
plugins:
  - jekyll-archives
  - jekyll-diagrams
  - jekyll-email-protect
  - jekyll-feed
  - jekyll-get-json
  - jekyll-imagemagick
  - jekyll-jupyter-notebook
  - jekyll-link-attributes
  - jekyll-minifier
  - jekyll-paginate-v2
  - jekyll/scholar
  - jekyll-sitemap
  - jekyll-toc
  - jekyll-twitter-plugin
  - jemoji

# Sitemap settings
defaults:
  - scope:
      path: "assets"
    values:
      sitemap: false

sass:
  style: compressed

# -----------------------------------------------------------------------------
# Jekyll Minifier
# -----------------------------------------------------------------------------

jekyll-minifier:
  exclude: ['robots.txt']
  uglifier_args:
    harmony: true

# -----------------------------------------------------------------------------
# Jekyll Archives
# -----------------------------------------------------------------------------

jekyll-archives:
  enabled: [year, tags, categories] # enables year, tag and category archives (remove if you need to disable one of them).
  layouts:
    year: archive-year
    tag: archive-tag
    category: archive-category
  permalinks:
    year: '/blog/:year/'
    tag: '/blog/tag/:name/'
    category: '/blog/category/:name/'

# display_tags: ['formatting', 'images', 'links', 'math', 'code'] # these tags will be displayed on the front page of your blog
# display_categories: ['blockquotes'] # these categories will be displayed on the front page of your blog

# -----------------------------------------------------------------------------
# Jekyll Scholar
# -----------------------------------------------------------------------------

scholar:

  last_name: [Einstein]
  first_name: [Albert, A.]

  style: apa
  locale: en

  source: /_bibliography/
  bibliography: papers.bib
  bibliography_template: bib
  # Note: if you have latex math in your bibtex, the latex filter
  # preprocessing may conflict with MathJAX if the latter is enabled.
  # See https://github.com/alshedivat/al-folio/issues/357.
  bibtex_filters: [latex, smallcaps, superscript]

  replace_strings: true
  join_strings: true

  details_dir: bibliography
  details_layout: bibtex.html
  details_link: Details

  query: "@*"
  group_by: year
  group_order: descending

# Display different badges withs stats for your publications
enable_publication_badges:
  altmetric: true # Altmetric badge (https://www.altmetric.com/products/altmetric-badges/)
  dimensions: true # Dimensions badge (https://badge.dimensions.ai/)

# Filter out certain bibtex entry keywords used internally from the bib output
filtered_bibtex_keywords: [abbr, abstract, arxiv, bibtex_show, html, pdf, selected, supp, blog, code, poster, slides, website, preview, altmetric]

# Maximum number of authors to be shown for each publication (more authors are visible on click)
max_author_limit: 3  # leave blank to always show all authors
more_authors_animation_delay: 10  # more authors are revealed on click using animation; smaller delay means faster animation

# Enables publication thumbnails. If disabled, none of the publications will display thumbnails, even if specified in the bib entry.
enable_publication_thumbnails: true

# -----------------------------------------------------------------------------
# Jekyll Link Attributes
# -----------------------------------------------------------------------------

# These are the defaults
external_links:
  enabled: true
  rel: external nofollow noopener
  target: _blank
  exclude:

# -----------------------------------------------------------------------------
# Responsive WebP Images
# -----------------------------------------------------------------------------

imagemagick:
  enabled: false # enables responsive images for your site (recommended, see https://github.com/alshedivat/al-folio/issues/537)
  widths:
    - 480
    - 800
    - 1400
  input_directories:
    - assets/img/
  input_formats:
    - ".jpg"
    - ".jpeg"
    - ".png"
    - ".tiff"
  output_formats:
    webp: "-resize 800x"

# -----------------------------------------------------------------------------
# Jekyll Diagrams
# -----------------------------------------------------------------------------

jekyll-diagrams:
    # configuration, see https://github.com/zhustec/jekyll-diagrams.
    # feel free to comment out this section if not using jekyll diagrams.

# -----------------------------------------------------------------------------
# Optional Features
# -----------------------------------------------------------------------------

enable_google_analytics:    false  # enables google analytics
enable_cronitor_analytics: false  # enables cronitor RUM analytics
enable_google_verification: false  # enables google site verification
enable_bing_verification:   false  # enables bing site verification
enable_masonry:             true   # enables automatic project cards arrangement
enable_math:                true   # enables math typesetting (uses MathJax)
enable_tooltips:            false  # enables automatic tooltip links generated
                                   # for each section titles on pages and posts
enable_darkmode:            true   # enables switching between light/dark modes
enable_navbar_social:       false  # enables displaying social links in the
                                   # navbar on the about page
enable_project_categories:  true   # enables categorization of projects into
                                   # multiple categories
enable_medium_zoom:         true   # enables image zoom feature (as on medium.com)
enable_progressbar:         true   # enables a horizontal progress bar linked to the vertical scroll position

# -----------------------------------------------------------------------------
# Library versions
# -----------------------------------------------------------------------------

bootstrap-table:
  version: "1.22.1"
jquery:
  version: "3.6.0"
  integrity: "sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4="
mathjax:
  version: "3.2.0"
masonry:
  version: "4.2.2"
  integrity: "sha256-Nn1q/fx0H7SNLZMQ5Hw5JLaTRZp0yILA/FRexe19VdI="
mdb:
  version: "4.20.0"
  integrity:
    css: "sha256-jpjYvU3G3N6nrrBwXJoVEYI/0zw8htfFnhT9ljN3JJw="
    js: "sha256-NdbiivsvWt7VYCt6hYNT3h/th9vSTL4EDWeGs5SN3DA="
medium_zoom:
  version: "1.0.8"
  integrity: "sha256-7PhEpEWEW0XXQ0k6kQrPKwuoIomz8R8IYyuU1Qew4P8="

# -----------------------------------------------------------------------------
# Get external JSON data
# -----------------------------------------------------------------------------

jekyll_get_json:
  - data: resume
    json: assets/json/resume.json # it can also be an url
jsonresume:
  - basics
  - work
  - education
  - publications
  - Projects
  - volunteer
  - awards
  - certificates
  - skills
  - languages
  - interests
  - references
VishalKumar-S commented 6 months ago

pages/achievements.md

---
layout: page
title: Achievements
permalink: /achievements/
description: My achievements
nav: true
nav_order: 4

horizontal: true
---

<!-- pages/achievements.md -->
{% assign achievements = site.achievements | sort: 'date' | reverse %}

{% for achievement in achievements %}
  {% include achievements.html %}
{% endfor %}
VishalKumar-S commented 6 months ago

includes/achievements.html

<!-- _includes/achievements.html -->
<div class="grid-sizer" style="display: flex; flex-wrap: wrap; justify-content: space-between;"> <!-- Use a flexbox layout -->
    <div class="grid-item" style="width: 45%; margin-bottom: 20px; font-family: Arial, sans-serif;"> <!-- Adjust the width as per your requirement -->
      {% if achievement.redirect -%}
      <a href="{{ achievement.redirect }}">
        {%- else -%}
        <a href="{{ achievement.url | relative_url }}">
          {%- endif %}
          <div class="card hoverable" style="transition: transform .2s; box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2);">
            {%- if achievement.image %}
            {%- include figure.html
              path=achievement.image
              alt="achievement thumbnail" -%}
            {%- endif %}
            <div class="card-body">
              <h2 class="card-title" style="font-weight: bold;">{{ achievement.title }}</h2>
              <p class="card-text">{{ achievement.description }}</p>
              <p class="card-date">{{ achievement.date | date: "%B %d, %Y" }}</p> <!-- Display the date -->
              <div class="row ml-1 mr-1 p-0">
                {%- if achievement.github -%}
                <div class="github-icon">
                  <div class="icon" data-toggle="tooltip" title="Code Repository">
                    <a href="{{ achievement.github }}"><i class="fab fa-github gh-icon"></i></a>
                  </div>
                  {%- if achievement.github_stars -%}
                  <span class="stars" data-toggle="tooltip" title="GitHub Stars">
                    <i class="fas fa-star"></i>
                    <span id="{{ achievement.github_stars }}-stars"></span>
                  </span>
                  {%- endif %}
                </div>
                {%- endif %}
              </div>
            </div>
          </div>
        </a>
    </div>
</div>
VishalKumar-S commented 6 months ago

achievements/achievement_1.md

---
layout: post
title: ":rocket: Celebrating ZenML Testimonial Feature! :star2::speech_balloon:"
date: 2023-10-19
image: /assets/img/Testimonial.jpg
inline: false
related_posts: false
---

:partying_face: **Exciting News!** :rocket:

I'm thrilled to announce that my testimonial about ZenML has been featured on their website [zenml.io](https://zenml.io) 🌟 A big shoutout to the ZenML team for sharing my experience! :clap:

### Testimonial: Empowering ML Workflow with ZenML
<img src="/assets/img/Testimonial.jpg" alt="ZenML Testimonial" style="width: 100%;">

"ZenML has been a game-changer for my ML workflow. It seamlessly streamlines the chaos of managing the pipelines. From proof of concept to production, ZenML empowers us with the tools we need for responsible ML, fostering a culture of reproducibility, flexibility, and above all, peace of mind. It's the secret sauce that keeps our team at the top of our game and makes our MLOps journey easier." :rocket::gear:

Thank you, ZenML, for providing the tools that make AI and Machine Learning a joy to work with! 🙌 #AI #MachineLearning #ZenML #MLOps

---
george-gca commented 6 months ago

If you are trying to deploy it to github.io, this is already done automatically with every commit, considering you followed all steps in README.

VishalKumar-S commented 6 months ago

@george-gca I have tried, it still the same issue persists, in GA Workflow:

      Generating... 
       Jekyll Feed: Generating feed for posts
       Imagemagick: Disabled in site.config
         AutoPages: Disabled/Not configured in site.config.
        Pagination: Complete, processed 1 pagination page(s)
  Liquid Exception: Liquid error (line 55): Cannot sort a null object. in /home/runner/work/VishalKumar-S.github.io/VishalKumar-S.github.io/_layouts/achievements.html
                    ------------------------------------------------
      Jekyll 4.3.2   Please append `--trace` to the `build` command 
                     for any additional information or backtrace. 
                    ------------------------------------------------

config.yml file locally, working fine,

local-host-run-successful achievements-collection-local-working

config.yml file "achievements" collection gets erased, during deployment automatically, so a sort error happens for Achievements section. achievements-collection-missing-deploy

I don't know why it is happening, can u pls help me in resolving it? along with the config.yml file change, other achievements section related modified files also gets reverted, during deployment

george-gca commented 6 months ago

How do you run it locally? Which command do you use?

If when you run it you do not use the --lsi flag I think it might be related to this.

VishalKumar-S commented 6 months ago

issue was in git branches related stuffs,got resolved, thanks