Add /_css and /_js endpoints.
This commit is contained in:
parent
08249aaaf6
commit
3132a6ea0f
|
@ -53,6 +53,9 @@ Markdown document and it can be at any point.
|
||||||
- `@csgen.displayAuthors = "true"`
|
- `@csgen.displayAuthors = "true"`
|
||||||
- `@csgen.enableComments = "true";`
|
- `@csgen.enableComments = "true";`
|
||||||
- `@csgen.addAuthor = "one author here";`
|
- `@csgen.addAuthor = "one author here";`
|
||||||
|
- `@csgen.author = "author1|author2|author3";`
|
||||||
|
- `@csgen.addTag = "one tag here";`
|
||||||
|
- `@csgen.tag = "tag1|tag2|tag3";`
|
||||||
- `@csgen.markAsFeed = "false";`
|
- `@csgen.markAsFeed = "false";`
|
||||||
- `@csgen.includePage = "/blog/my-awesome-blog-post";`
|
- `@csgen.includePage = "/blog/my-awesome-blog-post";`
|
||||||
- `@csgen.redirectTo = "/blog/rss.xml";`
|
- `@csgen.redirectTo = "/blog/rss.xml";`
|
||||||
|
@ -81,6 +84,10 @@ There are also special csgen reserved endpoints. These are:
|
||||||
- Additional items to prepend to the menu.
|
- Additional items to prepend to the menu.
|
||||||
- `/_404`
|
- `/_404`
|
||||||
- The error to display when no page was found for the endpoint.
|
- The error to display when no page was found for the endpoint.
|
||||||
|
- `/_css`
|
||||||
|
- Stylesheet to append.
|
||||||
|
- `/_js`
|
||||||
|
- JavaScript to append.
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
|
|
11
core.php
11
core.php
|
@ -581,7 +581,16 @@ function printHeader($html, $printpage) {
|
||||||
|
|
||||||
$endpointFound = 1;
|
$endpointFound = 1;
|
||||||
$html .= "\t\t<small id='title'>$Header->data</small>\n";
|
$html .= "\t\t<small id='title'>$Header->data</small>\n";
|
||||||
break;
|
}
|
||||||
|
if ($head['endpoint'] == "/_css") {
|
||||||
|
$html .= "<style>\n";
|
||||||
|
$html .= htmlspecialchars_decode(file_get_contents($head['file']));
|
||||||
|
$html .= "</style>\n";
|
||||||
|
}
|
||||||
|
if ($head['endpoint'] == "/_js") {
|
||||||
|
$html .= "<script>\n";
|
||||||
|
$html .= htmlspecialchars_decode(file_get_contents($head['file']));
|
||||||
|
$html .= "</script>\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue