# MkDocs Plugin Configurations Template
# Generated by d361 MkDocs Export System
# this_file: external/int_folders/d361/src/d361/mkdocs/templates/plugin_configs.yml.j2

# Core plugins configuration
plugins:
  # Search plugin (always enabled)
  - search:
      lang: {{ search_lang | default(['en']) }}
      separator: '[\s\u200b\-_,:!=\[\]()"`/]+|\.(?!\d)|&[lg]t;|(?!\b)(?=[A-Z][a-z])'
      min_search_length: {{ min_search_length | default(2) }}
      prebuild_index: {{ prebuild_search_index | default(false) | lower }}
      indexing: 
        - content
        - headings
        {% if index_titles | default(true) %}- titles{% endif %}

  # Core navigation plugins
  {% if enable_autorefs | default(true) %}
  - autorefs:
      external_links: {{ autorefs_external_links | default(false) | lower }}
  {% endif %}

  {% if enable_section_index | default(true) %}
  - section-index
  {% endif %}

  {% if enable_literate_nav | default(false) %}
  - literate-nav:
      nav_file: {{ literate_nav_file | default('SUMMARY.md') }}
      implicit_index: {{ literate_nav_implicit_index | default(true) | lower }}
  {% endif %}

  # Content generation plugins
  {% if enable_gen_files | default(false) %}
  - gen-files:
      scripts:
        {% for script in gen_files_scripts | default([]) %}
        - {{ script }}
        {% endfor %}
  {% endif %}

  {% if enable_macros | default(false) %}
  - macros:
      modules: {{ macros_modules | default([]) }}
      include_dir: {{ macros_include_dir | default('includes') }}
      include_yaml: {{ macros_include_yaml | default([]) }}
  {% endif %}

  # Content enhancement plugins
  {% if enable_include_markdown | default(false) %}
  - include-markdown:
      opening_tag: {{ include_opening_tag | default('{%') }}
      closing_tag: {{ include_closing_tag | default('%}') }}
      preserve_includer_indent: {{ preserve_includer_indent | default(true) | lower }}
  {% endif %}

  # Navigation enhancement plugins
  {% if enable_awesome_pages | default(false) %}
  - awesome-pages:
      filename: {{ awesome_pages_filename | default('.pages') }}
      collapse_single_pages: {{ awesome_pages_collapse | default(false) | lower }}
      strict: {{ awesome_pages_strict | default(true) | lower }}
  {% endif %}

  # Site management plugins
  {% if enable_redirects and redirects %}
  - redirects:
      redirect_maps:
        {% for old_path, new_path in redirects.items() %}
        {{ old_path }}: {{ new_path }}
        {% endfor %}
  {% endif %}

  # Development and debugging plugins
  {% if enable_print_site | default(false) %}
  - print-site:
      add_to_navigation: {{ print_site_add_nav | default(false) | lower }}
      print_page_title: {{ print_site_title | default('Print Site') }}
      add_table_of_contents: {{ print_site_toc | default(true) | lower }}
      add_full_urls: {{ print_site_full_urls | default(false) | lower }}
  {% endif %}

  # Performance optimization plugins
  {% if enable_minify | default(false) %}
  - minify:
      minify_html: {{ minify_html | default(true) | lower }}
      minify_css: {{ minify_css | default(true) | lower }}
      minify_js: {{ minify_js | default(true) | lower }}
      htmlmin_opts:
        remove_comments: {{ minify_remove_comments | default(true) | lower }}
        remove_empty_space: {{ minify_remove_empty_space | default(false) | lower }}
        remove_all_empty_space: {{ minify_remove_all_empty_space | default(false) | lower }}
        strip_whitespaces: {{ minify_strip_whitespace | default(true) | lower }}
        reduce_boolean_attributes: {{ minify_reduce_boolean_attrs | default(false) | lower }}
      cache_safe: {{ minify_cache_safe | default(true) | lower }}
  {% endif %}

  {% if enable_optimize | default(false) %}
  - optimize:
      enabled: !ENV [OPTIMIZE, false]
      optimize_png: {{ optimize_png | default(true) | lower }}
      optimize_jpg: {{ optimize_jpg | default(true) | lower }}
      optimize_svg: {{ optimize_svg | default(true) | lower }}
      cache_dir: {{ optimize_cache_dir | default('.cache/plugins/optimize') }}
      print_gain: {{ optimize_print_gain | default(true) | lower }}
  {% endif %}

  # Material theme specific plugins
  {% if theme_name == 'material' %}
  
  {% if enable_social_cards | default(false) %}
  - social:
      cards: {{ social_cards_enabled | default(true) | lower }}
      cards_dir: {{ social_cards_dir | default('assets/images/social') }}
      cards_layout: {{ social_cards_layout | default('default') }}
      cards_layout_options:
        background_color: {{ social_cards_background | default('#1976d2') }}
        background_image: {{ social_cards_background_image | default('') }}
        color: {{ social_cards_color | default('#ffffff') }}
        font_family: {{ social_cards_font | default('Roboto') }}
      debug: {{ social_cards_debug | default(false) | lower }}
  {% endif %}

  {% if enable_tags | default(false) %}
  - tags:
      tags_file: {{ tags_file | default('tags.md') }}
      tags_extra_files:
        {% for tag_file in tags_extra_files | default([]) %}
        - {{ tag_file }}
        {% endfor %}
  {% endif %}

  {% if enable_blog | default(false) %}
  - blog:
      blog_dir: {{ blog_dir | default('blog') }}
      blog_toc: {{ blog_toc | default(true) | lower }}
      post_dir: {{ blog_post_dir | default('{blog}/posts') }}
      post_date_format: {{ blog_date_format | default('full') }}
      post_url_date_format: {{ blog_url_date_format | default('yyyy/MM/dd') }}
      post_url_format: {{ blog_url_format | default('{date}/{slug}') }}
      post_excerpt: {{ blog_excerpt | default('optional') }}
      post_excerpt_max_authors: {{ blog_excerpt_max_authors | default(1) }}
      post_excerpt_max_categories: {{ blog_excerpt_max_categories | default(5) }}
      post_readtime: {{ blog_readtime | default(true) | lower }}
      post_readtime_words_per_minute: {{ blog_readtime_wpm | default(265) }}
      archive: {{ blog_archive | default(true) | lower }}
      archive_name: {{ blog_archive_name | default('Archive') }}
      archive_date_format: {{ blog_archive_date_format | default('yyyy') }}
      archive_url_date_format: {{ blog_archive_url_date_format | default('yyyy') }}
      archive_url_format: {{ blog_archive_url_format | default('archive/{date}') }}
      archive_toc: {{ blog_archive_toc | default(true) | lower }}
      categories: {{ blog_categories | default(true) | lower }}
      categories_name: {{ blog_categories_name | default('Categories') }}
      categories_url_format: {{ blog_categories_url_format | default('category/{slug}') }}
      categories_toc: {{ blog_categories_toc | default(true) | lower }}
      authors: {{ blog_authors | default(true) | lower }}
      authors_file: {{ blog_authors_file | default('{blog}/.authors.yml') }}
      draft: {{ blog_draft | default(false) | lower }}
      draft_if_future_date: {{ blog_draft_future | default(false) | lower }}
      draft_on_serve: {{ blog_draft_on_serve | default(true) | lower }}
      pagination: {{ blog_pagination | default(true) | lower }}
      pagination_per_page: {{ blog_pagination_per_page | default(10) }}
      pagination_url_format: {{ blog_pagination_url_format | default('page/{page}') }}
      pagination_format: {{ blog_pagination_format | default('~2~') }}
      pagination_keep_content: {{ blog_pagination_keep_content | default(false) | lower }}
  {% endif %}

  {% if enable_offline | default(false) %}
  - offline:
      enabled: !ENV [OFFLINE, false]
  {% endif %}

  {% if enable_privacy | default(false) %}
  - privacy:
      enabled: !ENV [PRIVACY, false]
      cache: {{ privacy_cache | default(true) | lower }}
      cache_dir: {{ privacy_cache_dir | default('.cache/plugins/privacy') }}
      assets: {{ privacy_assets | default(true) | lower }}
      assets_fetch: {{ privacy_assets_fetch | default(true) | lower }}
      assets_fetch_dir: {{ privacy_assets_fetch_dir | default('assets/external') }}
      links: {{ privacy_links | default(true) | lower }}
      links_attr_map:
        target: {{ privacy_links_target | default('_blank') }}
        rel: {{ privacy_links_rel | default('noopener') }}
  {% endif %}

  {% endif %}

  # API documentation plugins
  {% if enable_mkdocstrings | default(false) %}
  - mkdocstrings:
      default_handler: {{ mkdocstrings_handler | default('python') }}
      handlers:
        python:
          paths: {{ mkdocstrings_paths | default(['src']) }}
          options:
            docstring_style: {{ mkdocstrings_docstring_style | default('google') }}
            docstring_options:
              ignore_init_summary: {{ mkdocstrings_ignore_init_summary | default(true) | lower }}
            merge_init_into_class: {{ mkdocstrings_merge_init | default(true) | lower }}
            show_submodules: {{ mkdocstrings_show_submodules | default(true) | lower }}
            show_source: {{ mkdocstrings_show_source | default(true) | lower }}
            show_root_heading: {{ mkdocstrings_show_root_heading | default(false) | lower }}
            show_root_toc_entry: {{ mkdocstrings_show_root_toc | default(true) | lower }}
            show_root_full_path: {{ mkdocstrings_show_root_full_path | default(false) | lower }}
            show_object_full_path: {{ mkdocstrings_show_object_full_path | default(false) | lower }}
            show_category_heading: {{ mkdocstrings_show_category_heading | default(false) | lower }}
            show_if_no_docstring: {{ mkdocstrings_show_if_no_docstring | default(false) | lower }}
            show_signature: {{ mkdocstrings_show_signature | default(true) | lower }}
            show_signature_annotations: {{ mkdocstrings_show_signature_annotations | default(false) | lower }}
            separate_signature: {{ mkdocstrings_separate_signature | default(false) | lower }}
            group_by_category: {{ mkdocstrings_group_by_category | default(true) | lower }}
            heading_level: {{ mkdocstrings_heading_level | default(2) }}
  {% endif %}

  # Additional specialized plugins
  {% if enable_git_revision_date_localized | default(false) %}
  - git-revision-date-localized:
      type: {{ git_revision_date_type | default('date') }}
      timezone: {{ git_revision_date_timezone | default('UTC') }}
      locale: {{ git_revision_date_locale | default('en') }}
      fallback_to_build_date: {{ git_revision_date_fallback | default(false) | lower }}
      enable_creation_date: {{ git_revision_date_creation | default(true) | lower }}
  {% endif %}

  {% if enable_rss | default(false) %}
  - rss:
      match_path: {{ rss_match_path | default('.*') }}
      date_from_meta:
        as_creation: {{ rss_date_creation_meta | default('date') }}
        as_update: {{ rss_date_update_meta | default('git') }}
      categories:
        {% for category in rss_categories | default([]) %}
        - {{ category }}
        {% endfor %}
      comments_path: {{ rss_comments_path | default('') }}
      description: {{ rss_description | default('') }}
      feed_ttl: {{ rss_feed_ttl | default(1440) }}
      image: {{ rss_image | default('') }}
      length: {{ rss_length | default(20) }}
      pretty_print: {{ rss_pretty_print | default(false) | lower }}
      url_parameters:
        utm_source: {{ rss_utm_source | default('documentation') }}
        utm_medium: {{ rss_utm_medium | default('RSS') }}
        utm_campaign: {{ rss_utm_campaign | default('feed-syndication') }}
  {% endif %}

  # Custom plugins (user-defined)
  {% if custom_plugins %}
  {% for plugin in custom_plugins %}
  - {{ plugin.name }}{% if plugin.config %}:
      {% for key, value in plugin.config.items() %}
      {{ key }}: {{ value }}
      {% endfor %}{% endif %}
  {% endfor %}
  {% endif %}