Minerva currently uses a hybrid of templates and MinervaTemplate. I am interested in collaborating with somebody who shares my interest to make it use the core SkinMustache class.
Vector will soon be using SkinMustache (see T251212) and it's important that the two most widely used skins (serving desktop and mobile traffic) reflect how we want to build skins going forward. This will help inform the template data provided by SkinMustache and a core skin API.
Proposed roadmap
(Feel free to create subtasks!)
- A new public function MinervaTemplate::getTemplateData is refactored out of the MinervaTemplate::render function - it should take no arguments. The MinervaTemplate::render function should be merged with the execute function (see developer note 1 for how this should look)
- SkinMinerva class is updated so it extends SkinMustache and calls MinervaTemplate::getTemplateData. MinervaTemplate::execute should have an empty body at this point.
- Remove getFooterTemplateData https://gerrit.wikimedia.org/r/c/mediawiki/skins/MinervaNeue/+/631867
Developer notes
[1] Proposed revised MinervaTemplate execute method:
/** * Start render the page in template */ public function execute() { $templateParser = new TemplateParser( __DIR__ ); // begin rendering echo $templateParser->processTemplate( 'skin', $this->getTemplateData() ); $this->printTrail(); ?> </body> </html> <?php }
[2] Proposed revised transitional SkinMinerva class
/** * Initialize Minerva Skin */ public function __construct( $options ) { $options['templateDirectory'] = __DIR__; $options['name'] = 'minerva'; parent::__construct( $options ); $this->skinOptions = MediaWikiServices::getInstance()->getService( 'Minerva.SkinOptions' ); } public function getTemplateData() : array { $tpl = $this->prepareQuickTemplate(); return parent::getTemplateData() + $tpl->getTemplateData(); }