#28 Make headers have permalinks next to them
Merged 2 years ago by kevin. Opened 2 years ago by codeblock.
codeblock/fedora-mediawikitheme master  into  master

@@ -6,4 +6,13 @@ 

      $("#wpTextbox1").addClass("form-control");

      $("#wpSummary").addClass("form-control");

      mw.loader.load( 'https://apps.fedoraproject.org/global/fedora-bootstrap-1.0.1/fedora-bootstrap.js' );

+ 

+     // https://pagure.io/fedora-infrastructure/issue/6912

+     $('.mw-headline').each(

+       function(f) {

+         $(this).prepend(

+           '<a href="#' + $(this).attr('id') + '">' + String.fromCodePoint(128279) + '</a> '

+         );

+       }

+     );

  });

This fixes https://pagure.io/fedora-infrastructure/issue/6912

It uses JS for now because it seems like the simplest way to do it, but in the future it might be better to figure out how to tie into the mediawiki code that renders headers and do it server-side.

Pull-Request has been merged by kevin

2 years ago
Metadata