Browse Source

Move source documents to src/

master
Miraty 1 week ago
parent
commit
048fa894e4
  1. 4
      .gitignore
  2. 0
      antopie/src/404.md
  3. 0
      antopie/src/cgu.md
  4. 0
      antopie/src/contact.md
  5. 0
      antopie/src/courriel.md
  6. 0
      antopie/src/details-techniques.md
  7. 0
      antopie/src/index.md
  8. 0
      antopie/src/manifeste-sur-le-contenu.md
  9. 0
      antopie/src/matrix.md
  10. 0
      antopie/src/nextcloud.md
  11. 31
      compil.php
  12. 8
      style.less

4
.gitignore

@ -1,9 +1,7 @@
*.gz
temp/*
mdp.php
antopie/css
antopie/*.html
!antopie/*.inc.html
*/css
/docs
/miraty
.directory

0
antopie/404.md → antopie/src/404.md

0
antopie/cgu.md → antopie/src/cgu.md

0
antopie/contact.md → antopie/src/contact.md

0
antopie/courriel.md → antopie/src/courriel.md

0
antopie/details-techniques.md → antopie/src/details-techniques.md

0
antopie/index.md → antopie/src/index.md

0
antopie/manifeste-sur-le-contenu.md → antopie/src/manifeste-sur-le-contenu.md

0
antopie/matrix.md → antopie/src/matrix.md

0
antopie/nextcloud.md → antopie/src/nextcloud.md

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"))

8
style.less

@ -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;
}