Commit e76e70c
committed
Add JekyllPageGenerator
Jekyll is the underlying technology used for GitHub Pages. Jekyll parses markdown and liquid files to HTML pages for a site.
Generally Jekyll expects "frontmatter" - a `---` delimited block at the top of the markdown file -.
The existence of the frontmatter indicates to Jekyll that the page should be _processed_ by the transformation engine and not just copied over.
Frontmatter also allows for adding variables to the page which can be used in the page/theme to do certain things.
Even though for GitHub Pages, a plugin is active which make the frontmatter not _strictly_ necessary, for this "PHPCS docs" type of website it is useful.
By default, the first `#` (H1) header will be regarded as the `page.title` and this page title is then subsequently used in the website menu and such.
As for these sniff pages, the default title is the full sniffname `Standard.Category.SniffName` and the `Standard` and `Category` are already "levels" in a typical menu due to the folder structure, it is less noisy to use just the plain `SniffName` as the `page.title`.
To that end, I'm adding a separate `JekyllPageGenerator` class which extends the standard `MarkdownGenerator` class and adds the _frontmatter_ to the page.
This will also allow for extending the available frontmatter with additional keys in the future if deemed necessary.
Includes test.1 parent 466e040 commit e76e70c
File tree
2 files changed
+82
-0
lines changed- src/Generator
- tests/Generator
2 files changed
+82
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
0 commit comments