Commit Graph

4 Commits

  • fixing mount points and updating the include
    partial
    
    1. Mounted Configuration Directory: Added /srv/configs as a mount point in
          /srv/dev/hugo/wiki/config/_default/hugo.toml. This allows Hugo's readFile and fileExists functions to
          access your Docker Compose and other configuration files within the virtual filesystem.
    2. Improved include Partial: Rewrote /srv/dev/hugo/wiki/layouts/partials/include.html with the following
          enhancements:
        * Path Mapping: It now automatically maps absolute paths like /srv/configs/... to the new configs/ mount
             and /srv/docs/private/... to the existing content/private/ mount.
        * Raw Content Support: If the included file is not a Markdown file (e.g., .yaml, .env, .sh), it now
             outputs the raw content instead of attempting to render it as Markdown. This ensures that your Docker
             Compose files are included exactly as they are when wrapped in a code block.
        * Robust Lookups: Added better path variation checking to handle both absolute and relative paths more
             gracefully.
  • fixed the include partial and its configuration. The primary issues were the lack of frontmatter stripping and restricted file system access for files outside the Hugo project
    root.
    
      Changes Made:
    
       1. Improved include.html Partial:
           * Page Support: Now uses .Site.GetPage first, allowing files to be included via Hugo's virtual filesystem (mounts).
           * Frontmatter Stripping: Added a regex-based stripper to ensure that if a raw file is read via readFile, its YAML/TOML frontmatter isn't rendered as text/horizontal rules.
           * Shortcode Processing: Confirmed that RenderString correctly processes shortcodes within included content.
    
       2. Updated Hugo Configuration:
           * Added [[module.mounts]] to /srv/dev/hugo/wiki/config/_default/hugo.toml to expose your private documentation directory (/srv/docs/private) to Hugo as content/private.