aboutsummaryrefslogtreecommitdiff
path: root/templates/html-format.html.php
blob: a62bb16a1dceb2149b7b65fb79060ef7851dbb2e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0"/ >
    <meta name="description" content="RSS-Bridge" />
    <title><?= e($title) ?></title>
    <link href="static/style.css?2023-03-24" rel="stylesheet">
    <link rel="icon" type="image/png" href="static/favicon.png">

    <?php foreach ($formats as $format): ?>

        <link
            href="<?= e($format['url']) ?>"
            title="<?= e($format['name']) ?>"
            rel="alternate"
            type="<?= e($format['type']) ?>"
        >
	<?php endforeach; ?>

    <meta name="robots" content="noindex, follow">
</head>

<body>
    <div class="container">

        <h1 class="pagetitle">
            <a href="<?= e($uri) ?>" target="_blank"><?= e($title) ?></a>
        </h1>

        <div class="buttons">
            <a href="./#bridge-<?= e($bridge_name) ?>">
                <button class="backbutton">← back to rss-bridge</button>
            </a>

            <?php foreach ($formats as $format): ?>
                <a href="<?= e($format['url']) ?>">
                    <button class="rss-feed">
                        <?= e($format['name']) ?>
                    </button>
                </a>
            <?php endforeach; ?>

            <?php if ($donation_uri): ?>
                <a href="<?= e($donation_uri) ?>">
                    <button class="rss-feed">
                        Donate to maintainer
                    </button>
                </a>
            <?php endif; ?>
        </div>

        <?php foreach ($items as $item): ?>
            <section class="feeditem">
                <h2>
                    <a
                        class="itemtitle"
                        href="<?= e($item['url']) ?>"
                    ><?= strip_tags($item['title']) ?></a>
                </h2>

                <?php if ($item['timestamp']): ?>
                    <time datetime="<?= date('Y-m-d H:i:s', $item['timestamp']) ?>">
                        <?= date('Y-m-d H:i:s', $item['timestamp']) ?>
                    </time>
                    <p></p>
                <?php endif; ?>

                <?php if ($item['author']): ?>
                    <p class="author">by: <?= e($item['author']) ?></p>
                <?php endif; ?>

                <!-- Intentionally not escaping for html context -->
                <?= break_annoying_html_tags($item['content']) ?>

                <?php if ($item['enclosures']): ?>
                    <div class="attachments">
                        <p>Attachments:</p>
                        <?php foreach ($item['enclosures'] as $enclosure): ?>
                            <li class="enclosure">
                                <a href="<?= e($enclosure) ?>" rel="noopener noreferrer nofollow">
                                    <?= e(substr($enclosure, strrpos($enclosure, '/') + 1)) ?>
                                </a>
                            </li>
                        <?php endforeach; ?>
                    </div>
                <?php endif; ?>

                <?php if ($item['categories']): ?>
                    <div class="categories">
                        <p>Categories:</p>
                        <?php foreach ($item['categories'] as $category): ?>
                            <li class="category"><?= e($category) ?></li>
                        <?php endforeach; ?>
                    </div>
                <?php endif; ?>
            </section>
        <?php endforeach; ?>

    </div>
 </body>
</html>