content: # https://git-cliff.org/docs/integration/github/
  
  [changelog]
  trim = true
  render_always = true
  header = """
  {%- macro remote_url() -%}
    https://github.com/{{ remote.github.owner }}/{{ remote.github.repo }}
  {%- endmacro -%}
  
  {%- macro npm_url() -%}
    https://www.npmjs.com/package/{{ remote.github.owner }}/{{ remote.github.repo }}
  {%- endmacro -%}
  
  {%- macro documentation_url() -%}
    https://{{ remote.github.repo }}.docs.matthewdavis.io
  {%- endmacro -%}
  
  <div align="center">
    <img src="tag.png" width="200" />
    <h1><strong>@mateothegreat/{{ remote.github.repo }}</strong></h1>
    <h3>📋 tl;dr changelog</h3>
    <p>
      <a href="{{ self::remote_url() }}">github</a> •
      <a href="{{ self::npm_url() }}">npm</a> •
      <a href="{{ self::documentation_url() }}">docs</a>
    </p>
  </div>
  
  <div><em>Here are the last 100~ commits ✌️</em></div>
  
  """
  
  body = """
  
  {%- macro remote_url() -%}
    https://github.com/{{ remote.github.owner }}/{{ remote.github.repo }}
  {%- endmacro -%}
  
  {%- macro npm_url() -%}
    https://www.npmjs.com/package/{{ remote.github.owner }}/{{ remote.github.repo }}
  {%- endmacro -%}
  
  {%- macro documentation_url() -%}
    https://docs.router.svelte.spa
  {%- endmacro -%}
  
  {% if version %}\
      ## [{{ version | trim_start_matches(pat="v") }}]({{ self::remote_url() }}/releases/tag/{{ version }}) - {{ timestamp | date(format="%Y-%m-%d") }}
  {% else %}\
      ## [Unreleased]({{ self::remote_url() }}/compare/HEAD...main)
  {% endif %}\
  
  {% if version %}
  ### 📊 Release Summary
  - **Version**: `{{ version | trim_start_matches(pat="v") }}`
  - **Released**: {{ timestamp | date(format="%B %d, %Y") }}
  - **Total Changes**: {{ commits | length }} commit{% if commits | length != 1 %}s{% endif %}
  {% endif %}
  
  {% for group, commits in commits | group_by(attribute="group") %}
    ### {{ group | striptags | trim | upper_first }}
  
    {% for commit in commits %}
      - {% if commit.scope %}**{{ commit.scope }}**: {% endif %} \
        {% if commit.breaking %}⚠️ **BREAKING**: {% endif %} \
        {{ commit.message | upper_first | trim }} \
        {% if commit.author %} by [@{{ commit.author.name }}](https://github.com/{{ commit.author.name }}) {% endif %} \
        ([`{{ commit.id | truncate(length=7, end="") }}`]({{ self::remote_url() }}/commit/{{ commit.id }}))
    {% endfor %}
  {% endfor %}
  
  {% if github.contributors | length != 0 %}
  ### 👥 Contributors
  
  Thanks ❤️‍🔥 to the following people who contributed to this release:
  
  {% for contributor in github.contributors %}
  {% if contributor.username %}
  - [@{{ contributor.username }}](https://github.com/{{ contributor.username }})
  {%- endif %}
  {%- endfor %}
  {% endif %}
  """
  
  # Footer with useful links and metadata
  footer = """
  ---
  
  <div align="center">
    <sub>
      generated by <a href="https://git-cliff.org">git-cliff</a> 💜 • 
      <a href="{{ self::remote_url() }}/issues">report Issues</a> • 
      <a href="{{ self::remote_url() }}/discussions">join discussions</a>
    </sub>
  </div>
  """
  
  # Replace placeholders with actual URLs
  postprocessors = [
      { pattern = '<REPO>', replace = "https://github.com/{{ remote.github.owner }}/{{ remote.github.repo }}" },
      # Clean up multiple blank lines
      { pattern = '\n\n\n+', replace = "\n\n" },
  ]
  
  [git]
  
  conventional_commits = true
  filter_unconventional = false
  require_conventional = false
  use_branch_tags = false
  split_commits = false
  limit_commits = 20
  sort_commits = "newest"
  topo_order = false
  topo_order_commits = true
  recurse_submodules = true
  
  # Preprocess commits to add GitHub links
  commit_preprocessors = [
      # Link to GitHub issues
      { pattern = '\((\w+\s)?#([0-9]+)\)', replace = "([#${2}](https://github.com/{{ remote.github.owner }}/{{ remote.github.repo }}/issues/${2}))" },
      # Link to PRs
      { pattern = 'PR #([0-9]+)', replace = "[PR #${1}](https://github.com/{{ remote.github.owner }}/{{ remote.github.repo }}/pull/${1})" },
  ]
  
  # Protect breaking changes from being filtered
  protect_breaking_commits = true
  
  # Enhanced commit parsers with more categories
  commit_parsers = [
      # Core features
      { message = "^feat", group = "<!-- 00 -->🚀 Features" },
      { message = "^feature", group = "<!-- 00 -->🚀 Features" },
      
      # Bug fixes
      { message = "^fix", group = "<!-- 01 -->🐛 Bug Fixes" },
      { message = "^bugfix", group = "<!-- 01 -->🐛 Bug Fixes" },
      
      # Performance improvements
      { message = "^perf", group = "<!-- 02 -->⚡ Performance" },
      { message = "^optimize", group = "<!-- 02 -->⚡ Performance" },
      
      # Code refactoring
      { message = "^refactor", group = "<!-- 03 -->♻️ Refactoring" },
      { message = "^refact", group = "<!-- 03 -->♻️ Refactoring" },
      
      # Documentation
      { message = "^docs?", group = "<!-- 04 -->📚 Documentation" },
      { message = "^readme", group = "<!-- 04 -->📚 Documentation" },
      
      # Testing
      { message = "^test", group = "<!-- 05 -->🧪 Testing" },
      { message = "^spec", group = "<!-- 05 -->🧪 Testing" },
      { message = "^e2e", group = "<!-- 05 -->🧪 Testing" },
      
      # Styling
      { message = "^style", group = "<!-- 06 -->🎨 Styling" },
      { message = "^css", group = "<!-- 06 -->🎨 Styling" },
      { message = "^ui", group = "<!-- 06 -->🎨 Styling" },
      
      # Dependencies
      { message = "^deps", group = "<!-- 07 -->📦 Dependencies" },
      { message = "^dep", group = "<!-- 07 -->📦 Dependencies" },
      { message = "update.*dependencies", group = "<!-- 07 -->📦 Dependencies" },
      
      # Build & CI
      { message = "^build", group = "<!-- 08 -->🏗️ Build System" },
      { message = "^ci", group = "<!-- 08 -->🏗️ Build System" },
      { message = "^pipeline", group = "<!-- 08 -->🏗️ Build System" },
      
      # Security
      { body = ".*security", group = "<!-- 09 -->🔒 Security" },
      { message = "^security", group = "<!-- 09 -->🔒 Security" },
      { message = "^vuln", group = "<!-- 09 -->🔒 Security" },
      
      # Breaking changes
      { body = ".*BREAKING CHANGE.*", group = "<!-- 10 -->💥 Breaking Changes" },
      { message = "^breaking", group = "<!-- 10 -->💥 Breaking Changes" },
      
      # Reverts
      { message = "^revert", group = "<!-- 11 -->⏪ Reverts" },
      
      # Types
      { message = "^types?", group = "<!-- 12 -->🏷️ Types" },
      { message = "^typing", group = "<!-- 12 -->🏷️ Types" },
      
      # Chores (but only important ones)
      { message = "^chore\\(release\\)", skip = true },
      { message = "^chore\\(deps\\)", skip = true },
      { message = "^chore\\(deps-dev\\)", skip = true },
      { message = "^chore", group = "<!-- 13 -->🔧 Maintenance" },
      
      # Examples
      { message = "^example", group = "<!-- 14 -->📝 Examples" },
      { message = "^demo", group = "<!-- 14 -->📝 Examples" },
      
      # Everything else
      { message = ".*", group = "<!-- 15 -->📋 Other Changes" },
  ]
  
  # Enhanced link parsers
  link_parsers = [
      # Parse GitHub usernames
      { pattern = "@([a-zA-Z0-9_-]+)", href = "https://github.com/${1}" },
      # Parse commit SHAs
      { pattern = "([a-f0-9]{7})[a-f0-9]{33}", href = "https://github.com/{{ remote.github.owner }}/{{ remote.github.repo }}/commit/${0}" },
  ]
  