The accepted answer is right, but I found it hard to understand.
The sections on admin/config are actually a page. Take a look at the breadcrumbs after clicking on 'basic site settings': you can click up
one level to a page for system
.
So you need two links, and two routes. The first link defines a page you will rarely use, but also creates the block on the admin/config page.
mymodule.links.menu.yaml:
system.admin_config_mysite:
route_name: system.admin_config_mysite
parent: system.admin_config
title: MySite Settings
description: 'Configure MySite'
weight: 100
mymodule.settings:
title: 'MyModule Settings'
parent: system.admin_config_mysite
description: 'Settings for MyModule'
route_name: mymodule.settings
weight: 100
mymodule.routing.yml
system.admin_config_mysite:
path: '/admin/config/mysite'
defaults:
_controller: '\Drupal\system\Controller\SystemController::systemAdminMenuBlockPage'
_title: 'MySite Settings'
_title_context: 'mysite'
requirements:
_permission: 'access administration pages'
mymodule.settings:
path: '/admin/config/mysite/mymodule'
defaults:
_form: '\Drupal\mymodule\Form\MyModuleSettingsForm'
_title: 'MyModule Settings'
_title_context: 'mysite'
requirements:
_permission: 'administer site configuration'