{% if class_name is defined %}
{{ module }}.{{ class_machine_name }}_{{ method_name }}:
  path: '{{ route }}'
  defaults:
    _content: '\Drupal\{{ module }}\Controller\{{ class_name }}::{{ method_name }}'
    _title: '{{module}} Title'
  requirements:
    _permission: 'access content'
{% endif %}


{% if class_name is defined %}
{{ module }}.{{ class_machine_name }}_{{ method_name }}:
  path: '{{ route }}'
  defaults:
    _controller: '\Drupal\{{ module }}\Controller\{{ class_name }}::{{ method_name }}'
    _title: '{{module}} Title'
  requirements:
    _permission: 'access content'
{% endif %}


Replace keyword _content with _controller
Replace keyword _content with _controller
