Move source documents to src/
This commit is contained in:
parent
37bed0c769
commit
048fa894e4
12 changed files with 21 additions and 22 deletions
4
.gitignore
vendored
4
.gitignore
vendored
|
@ -1,9 +1,7 @@
|
|||
*.gz
|
||||
temp/*
|
||||
mdp.php
|
||||
antopie/css
|
||||
antopie/*.html
|
||||
!antopie/*.inc.html
|
||||
*/css
|
||||
/docs
|
||||
/miraty
|
||||
.directory
|
||||
|
|
31
compil.php
31
compil.php
|
@ -61,8 +61,6 @@ else
|
|||
|
||||
define("CSS_FILENAME", Less_Cache::Get($lessFiles, $options, $colorScheme));
|
||||
|
||||
exec(FIND . " " . SITE . " -name '*.gmi' -o -name '*.md'", $pages);
|
||||
|
||||
// URLs don't end with .html on the Antopie website
|
||||
function formerUrlLocale($page) {
|
||||
if (DESTINATION === "dns" OR DESTINATION === "onion") {
|
||||
|
@ -81,13 +79,25 @@ function clearnetOrOnion($clearnetUrl, $onionUrl) {
|
|||
}
|
||||
}
|
||||
|
||||
exec(FIND . " " . SITE . "/src -name '*.gmi' -o -name '*.md'", $pages);
|
||||
|
||||
foreach ($pages as $page) {
|
||||
|
||||
$pathParts = pathinfo($page);
|
||||
$pathParts = pathinfo(str_replace("/src", "", $page));
|
||||
|
||||
// Create parent directory if needed
|
||||
if (!file_exists($pathParts['dirname']))
|
||||
mkdir($pathParts['dirname'], 0755, true);
|
||||
|
||||
// Execute PHP code
|
||||
ob_start();
|
||||
eval("?>" . file_get_contents($page));
|
||||
file_put_contents($pathParts['dirname'] . "/" . $pathParts['basename'], ob_get_contents());
|
||||
ob_end_clean();
|
||||
|
||||
// Convert Gemtext to Markdown
|
||||
if ($pathParts['extension'] === "gmi") {
|
||||
$gmilines = explode("\n", file_get_contents($page));
|
||||
$gmilines = explode("\n", file_get_contents($pathParts['dirname'] . "/" . $pathParts['basename']));
|
||||
|
||||
if (substr($gmilines[0], 0, 2) === "# ")
|
||||
$title = substr($gmilines[0], 2);
|
||||
|
@ -126,13 +136,6 @@ foreach ($pages as $page) {
|
|||
}
|
||||
|
||||
|
||||
// Execute PHP code
|
||||
ob_start();
|
||||
eval("?>" . file_get_contents($pathParts['dirname'] . "/" . $pathParts['filename'] . ".md"));
|
||||
$pageContent = ob_get_contents();
|
||||
ob_end_clean();
|
||||
|
||||
|
||||
// Compile Markdown to HTML with Parsedown
|
||||
require_once ROOT . "/bibli/parsedown/Parsedown.php";
|
||||
require_once ROOT . "/bibli/parsedown-extra/ParsedownExtra.php";
|
||||
|
@ -140,7 +143,7 @@ foreach ($pages as $page) {
|
|||
$Parsedown = $Parsedown->setUrlsLinked(false);
|
||||
$Parsedown = $Parsedown->setMarkupEscaped(false);
|
||||
$Parsedown = $Parsedown->setBreaksEnabled(true);
|
||||
$pageContent = $Parsedown->text($pageContent);
|
||||
$pageContent = $Parsedown->text(file_get_contents($pathParts['dirname'] . "/" . $pathParts['filename'] . ".md"));
|
||||
|
||||
|
||||
// .md > .html for local links
|
||||
|
@ -162,11 +165,9 @@ foreach ($pages as $page) {
|
|||
else
|
||||
echo $config['siteTitle'];
|
||||
?></title>
|
||||
<meta name="distribution" content="global">
|
||||
<meta name="robots" content="index, follow">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<?php if ($config['css']) { ?>
|
||||
<link type="text/css" rel="stylesheet" href="/css/<?= CSS_FILENAME ?>">
|
||||
<link type="text/css" rel="stylesheet" media="screen" href="/css/<?= CSS_FILENAME ?>">
|
||||
<?php } ?>
|
||||
<?php
|
||||
if (file_exists(SITE . "/head.inc.html"))
|
||||
|
|
|
@ -27,7 +27,7 @@ body {
|
|||
margin: 0px;
|
||||
|
||||
font-size: 30px;
|
||||
line-height: 42px;
|
||||
line-height: 50px;
|
||||
|
||||
@media @light {
|
||||
background-color: @lightlessColor;
|
||||
|
@ -74,7 +74,7 @@ a, a:visited {
|
|||
color: @lightColor;
|
||||
}
|
||||
|
||||
&:hover {
|
||||
&:hover, &:focus {
|
||||
text-decoration: none;
|
||||
color: @mainColor;
|
||||
}
|
||||
|
@ -99,7 +99,7 @@ a, a:visited {
|
|||
border-color: @lightColor;
|
||||
}
|
||||
|
||||
&:hover {
|
||||
&:hover, &:focus {
|
||||
color: @mainColor;
|
||||
border: 2px solid @mainColor;
|
||||
}
|
||||
|
@ -125,7 +125,7 @@ a, a:visited {
|
|||
border-color: @lightColor;
|
||||
}
|
||||
|
||||
&:hover {
|
||||
&:hover, &:focus {
|
||||
color: @mainColor;
|
||||
border: 2px solid @mainColor;
|
||||
}
|
||||
|
|
Reference in a new issue