Skip to content

Conversation

@MrHinsh
Copy link
Member

@MrHinsh MrHinsh commented Jul 31, 2025

This pull request introduces improvements to content rendering and resource management in the layout templates. The key changes include the introduction of a $contentAvailable variable for better content validation, updates to dynamically load CSS and JavaScript resources, and a new translationDraft parameter for draft content management.

Content Rendering Enhancements:

  • Introduced a $contentAvailable variable to validate content availability based on length and translation draft status. This variable is used to conditionally render the table of contents, main content, and fallback content in render-guide.html. [1] [2] [3] [4]

Resource Management:

  • Updated baseof.html to dynamically load the main CSS and language-specific CSS files using Hugo's resource pipeline. This replaces the hardcoded CSS reference.
  • Modified the JavaScript inclusion for the submenu to dynamically load the script using Hugo's resource pipeline.

Draft Content Handling:

  • Added a translationDraft parameter in the front matter of the guide content (index.min.md) to mark content as a draft, which is now considered in the $contentAvailable validation logic.

@MrHinsh MrHinsh self-assigned this Jul 31, 2025
Copilot AI review requested due to automatic review settings July 31, 2025 09:04
@MrHinsh MrHinsh enabled auto-merge July 31, 2025 09:05
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This pull request enhances content rendering logic and modernizes resource management in the layout templates. The main purpose is to improve content validation and move from hardcoded resource paths to Hugo's resource pipeline for better maintainability.

  • Introduces a $contentAvailable variable that validates content based on length and translation draft status
  • Migrates CSS and JavaScript loading from hardcoded paths to Hugo's resource pipeline
  • Adds support for translation draft marking via a new translationDraft parameter

Reviewed Changes

Copilot reviewed 3 out of 5 changed files in this pull request and generated 1 comment.

File Description
site/content/Guide1/2020.12/index.min.md Adds translationDraft: true parameter to mark content as draft
module/layouts/baseof.html Replaces hardcoded CSS/JS paths with dynamic resource loading using Hugo's pipeline
module/layouts/_partials/components/guide/render-guide.html Implements content availability validation logic and applies it to TOC and main content rendering
Comments suppressed due to low confidence (1)

module/layouts/_partials/components/guide/render-guide.html:71

  • The attribute name 'nkda-data-contentavailable' appears to contain a typo or unclear prefix. Consider using a more standard data attribute name like 'data-content-available' or clarify what 'nkda' represents.
        <article class="content-details" nkda-data-contentavailable="{{ $contentAvailable }}">

@MrHinsh MrHinsh added this pull request to the merge queue Jul 31, 2025
Merged via the queue into main with commit b0f96ec Jul 31, 2025
5 checks passed
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