123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133 |
- <?php
- function baseline_index_start($index_type, $arg) {
- ?>
- <!DOCTYPE html>
- <html lang="<?php echo(SITE_LANGUAGE);?>">
- <head>
- <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);?>/themes/baseline/baseline.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">
- section img {
- filter: saturate(0.4);
- transition: filter 0.2s;
- }
- section:hover img {
- filter: saturate(1);
- }
- section a img {
- margin: -8px -18px 8px -18px;
- max-width: calc(100% + 36px);
- }
- <?php baseline_banner_css() ?>
- </style>
- </head>
- <body>
- <header role="banner">
- <h1><a style="color: var(--text-color); text-decoration: none;" href="<?php echo(SITE_URL);?>"><?php echo(SITE_NAME);?></a></h1>
- <?php baseline_navigation(); ?>
- </header>
-
- <?php if(USE_PPIX) { ?>
- <section class="border-primary" style="padding: 2rem;">
- <?php
- if($index_type == INDEX_TYPE_MAIN) {
- ?>
- <form action="./" >
- <label for="q"><span class="icon">🔎</span>Search this site:</label><br>
- <input style="width: 100%;" type="text" id="q" name="q" placeholder="Search...">
- </form>
- <?php
- if(count($arg) > 0) { ?>
- <details>
- <summary>Browse by tags</summary>
- <ul class="compressed" style="margin-top: 5px;">
- <?php
- foreach ($arg as $tag) {
- ?>
- <li><a href="?tag=<?php echo(urlencode($tag));?>"><?php echo(htmlentities($tag));?></a></li>
- <?php
- }
- ?>
- </ul>
- </details>
- <?php }
- }
- if($index_type == INDEX_TYPE_TAG) {
- ?>
- <label><span class="icon">🏷️</span>Tagged with <em><?php echo(htmlentities($arg));?></em></label>
- <?php
- }
- if($index_type == INDEX_TYPE_SEARCH) {
- ?>
- <form action="./">
- <label for="q"><span class="icon">🔎</span>Search query:</label><br>
- <input style="width: 100%;" type="text" id="q" name="q" value="<?php echo(htmlentities($arg));?>">
- </form>
- <?php
- }
- ?>
- </section>
- <?php
- }
- }
- function baseline_index_no_content($index_type, $arg) {
- if($index_type == INDEX_TYPE_SEARCH) {
- echo('<section class="border-primary background-secondary" style="padding: 2rem;"><label><span class="icon">ℹ️</span>Nothing found for search query "' . htmlentities($arg) . "".</label></section>");
- }
- if($index_type == INDEX_TYPE_MAIN) {
- echo('<section class="border-primary background-secondary" style="padding: 2rem;"><label><span class="icon">ℹ️</span>There doesn\'t seem to be anything here yet. Be sure to check back soon!</label></section>');
- }
- }
- function baseline_index_listing($ppub, $url) {
- ?>
- <section>
- <a href="<?php echo($url);?>">
- <?php
- if($ppub->metadata["poster"] != null) {
- echo("<img src=\"" . $url . "/" . $ppub->metadata["poster"] . "\" alt='' />");
- }
- ?>
- <h3><?php echo(htmlentities($ppub->metadata["title"]));?></h3></a>
- <p><?php echo(htmlentities($ppub->metadata["description"]));?></p>
- <ul class="compressed">
- <?php
- if(USE_PPIX) {
- foreach(explode(" ", $ppub->metadata["tags"]) as $tag) {
- ?>
- <li><a href="<?php echo(SITE_URL);?>/?tag=<?php echo(urlencode($tag));?>"><?php echo(htmlentities($tag));?></a></li>
- <?php
- }
- }
- ?>
- </ul>
- </section>
- <?php
- }
- function baseline_index_end() {
- ?>
- <footer>
- <section class="subtle">
- <p class="tight"><strong><?php echo($_SERVER['SERVER_NAME'])?></strong>
- <br/><small>Site powered by <a href="https://git.sr.ht/~tilo15/php-ppub/" target="_blank">php-ppub</a> and <a href="https://parsedown.org" target="_blank">Parsedown</a>.</p>
- </section>
- </footer>
- </body>
- </html>
- <?php
- }
- ?>
|