Browse Source

Move CSS to themes

Billy Barrow 2 năm trước cách đây
mục cha
commit
8b53c93fe8

+ 1 - 1
router.php

@@ -3,7 +3,7 @@
 $path = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH);
 
 // Exclude some paths from being rewritten
-if (dirname($path) == '/' && (pathinfo($path, PATHINFO_EXTENSION) == 'css' || pathinfo($path, PATHINFO_EXTENSION) == 'js')) {
+if (str_starts_with(dirname($path), "/themes") || (dirname($path) == '/' && (pathinfo($path, PATHINFO_EXTENSION) == 'css' || pathinfo($path, PATHINFO_EXTENSION) == 'js'))) {
   return false;
 }
 else {

+ 1 - 1
themes/_base/content_template.php

@@ -12,7 +12,7 @@ function base_content_start($ppub, $path) {
         <title><?php echo(htmlentities($metadata["title"]));?> - <?php echo(SITE_NAME);?></title>
         <meta name="description" content="<?php echo(htmlentities($metadata["description"]));?>">
         <meta name="author" content="<?php echo(htmlentities($metadata["author"]));?>">
-        <link rel="stylesheet" href="<?php echo(SITE_URL);?>/vanilla.css">
+        <link rel="stylesheet" href="<?php echo(SITE_URL);?>/themes/_base/vanilla.css">
         <link rel="alternate" type="application/x-ppub" title="<?php echo(htmlentities($metadata["title"]));?> (as PPUB)" href="?download=true" />
     </head>
     <body>

+ 1 - 1
themes/_base/index_template.php

@@ -10,7 +10,7 @@ function base_index_start($index_type, $arg) {
         <meta charset="utf-8">
         <meta name="viewport" content="width=device-width, initial-scale=1.0"> 
         <title><?php echo(PUBLICATION_NAME)?> Index - <?php echo(SITE_NAME);?></title>
-        <link rel="stylesheet" href="<?php echo(SITE_URL);?>/vanilla.css">
+        <link rel="stylesheet" href="<?php echo(SITE_URL);?>/themes/_base/vanilla.css">
         <link rel="alternate" type="application/rss+xml" title="<?php echo(SITE_NAME);?> RSS Feed" href="<?php echo(SITE_URL);?>/feed.rss" />
         <style type="text/css">
             aside {

+ 0 - 0
vanilla.css → themes/_base/vanilla.css


+ 2 - 2
themes/_base/video_template.php

@@ -11,7 +11,7 @@ function base_video_start($ppub, $path, $video) {
         <title><?php echo(htmlentities($metadata["title"]));?> - <?php echo(SITE_NAME);?></title>
         <meta name="description" content="<?php echo(htmlentities($metadata["description"]));?>">
         <meta name="author" content="<?php echo(htmlentities($metadata["author"]));?>">
-        <link rel="stylesheet" href="<?php echo(SITE_URL);?>/vanilla.css">
+        <link rel="stylesheet" href="<?php echo(SITE_URL);?>/themes/_base/vanilla.css">
         <link rel="alternate" type="application/x-ppub" title="<?php echo(htmlentities($metadata["title"]));?> (as PPUB)" href="?download=true" />
         <style type="text/css">
             .player {
@@ -38,7 +38,7 @@ function base_video_start($ppub, $path, $video) {
     </header>
 
     <?php
-    
+
     generate_embed($path, $video);
 }