-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathindex.tt
169 lines (167 loc) · 6.81 KB
/
index.tt
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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
[% MACRO card_body(source, entry) BLOCK;
content = entry.content.body || entry.summary.body;
IF source == 'twitter' or source == 'cpan' or source == 'last.fm';
'';
ELSIF content.match('\S');
' <div class="card-body">' _
' <div class="card-text">' _
content _
' </div><!-- card-text -->' _
' </div>';
ELSE;
'';
END;
END -%]
[% FOREACH f IN config.feeds;
f.id = f.title.replace('\W+', '-').lower;
END -%]
<!DOCTYPE html>
<html>
<head>
[% IF config.google_ga -%]
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-HD966GMRYP"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', '[% config.google_ga %]');
</script>
[% END -%]
<meta property="og:title" content="Planet Perl" />
<meta property="og:type" content="website" />
<meta property="og:url" content="[% config.url %]" />
<meta property="og:image" content="[% config.url %]planet-perl.jpg" />
<meta property="og:description" content="Planet Perl: Your one-stop destination for the latest Perl blogs, news, and tutorials from around the web. Dive into the world of Perl with curated content from experts and enthusiasts alike."/>
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "WebSite",
"name": "Planet Perl",
"url": "http://perl.theplanetarium.org",
"description": "Planet Perl aggregates the latest Perl blogs, news, and tutorials from experts and enthusiasts across the globe.",
"publisher": {
"@type": "Organization",
"name": "Planet Perl",
"logo": {
"@type": "ImageObject",
"url": "[% config.url %]planet-perl.jpg"
}
}
}
</script>
<title>[% feed.title %]</title>
<meta charset="UTF-8">
<!-- Bootstrap core CSS -->
<link rel="stylesheet"
href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css"
integrity="sha384-T3c6CoIi6uLrA9TneNEoa7RxnatzjcDSCmG1MXxSR1GAsXEV/Dwwykc2MPK8M2HN"
crossorigin="anonymous">
<link rel="alternate" type="application/atom+xml" title="Atom" href="[% config.url %][% config.feed.file.split('/').last %]" />
<link rel="stylesheet" type="text/css" href="/css/style.css">
<script src="https://use.fontawesome.com/releases/v5.13.0/js/all.js" crossorigin="anonymous"></script>
</head>
<body>
<nav class="navbar fixed-top navbar-dark bg-dark">
<a class="navbar-brand" href="#">[% feed.title | html %]</a>
</nav>
<div class="container-fluid">
<div class="row">
<div class="col-md-2 left">
<p>Text: <a href="#" id="show"><b>[s]</b>how</a> / <a href="#" id="hide"><b>[h]</b>ide</a></p>
<hr class="hr" />
<h2>Sources</h2>
<div class="form-check">
<input class="form-check-input" type="checkbox" id="all-feeds" checked>
<label class="form-check-label" for="all-feeds">
All Feeds
</label><br>
[% FOR f IN config.feeds.sort('title') -%]
<input class="feed-checkbox form-check-input" type="checkbox" id="[% f.id %]" checked>
<label class="form-check-label" for="[% f.id %]">
<a href="[% f.web | html %]">[% f.title %]</a>
</label><br>
[% END -%]
</div>
<hr class="hr" />
<p><a href="/atom.xml"><img alt="Web feed" src="/images/feed.gif" /> Web feed</a>
<br />
<a href="/opml.xml"><img alt="OPML" src="/images/opml.png" /> OPML</a></p>
<hr class="hr" />
<p>
<ul>
<li>Powered by <a href="https://metacpan.org/release/Perlanet">Perlanet</a></li>
<li>Code on <a href="https://github.com/davorg/planetperl">Github</a></li>
<li><a href="https://github.com/davorg/planetperl/issues">Feedback welcome</a></li>
</ul>
</p>
</div><!-- col-md-2 -->
<div class="col-md-8">
[% i = 0 -%]
[% FOREACH entry IN feed.entries -%]
[% i = i + 1 -%]
<div class="card [% entry.feed.id %]" id="card_[% i %]">
<div class="card-header">
[% feedname = entry.feed.title; -%]
<h2 class="card-title"><a href="[% entry.link %]">[% entry.title | html %]</a></h2>
[% IF feedname %]<a href="[% entry.feed.web %]" class="badge rounded-pill bg-primary" style="float: right">[% feedname %]</a> [% END %]
[% IF entry.author OR entry.issued OR entry.modified;
entry_date = entry.modified OR entry.issued; %]
<p class="text-right"><small>Published[% IF entry.author %] by [% entry.author | html; END %]
[% IF entry_date %] on [% entry_date.strftime('%A %d %B %Y %H:%M'); END %]</small></p>
[% END -%]
</div> <!-- card-header -->
[% card_body(feedname, entry) %]
[% IF feedname OR entry.author OR entry.issued OR entry.modified;
entry_date = entry.issued OR entry.modified; -%]
<div class="card-footer">
</div><!-- card-footer -->
[% END -%]
</div><!-- card -->
[% END %]
</div><!-- col-md-8 -->
<div class="col-md-2">
<script type="text/javascript"><!--
google_ad_client = "pub-3663319204757145";
/* planet */
google_ad_slot = "8413744374";
google_ad_width = 120;
google_ad_height = 600;
//-->
</script>
<script type="text/javascript"
src="https://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</div><!-- col-md-2 -->
</div><!-- row -->
<footer class="footer">
<div class="container-fluid">
<div class="row>
<div class="col-md-8">
<address><a href="[% config.author.link %]">[% config.author.name | html %]</a> / [% feed.modified.strftime('%A %d %B %Y %H:%M %Z') %]</address>
</div>
</div>
</div><!-- container -->
</footer>
</div><!-- container -->
<!-- Bootstrap core JavaScript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script src="https://code.jquery.com/jquery-3.7.1.min.js"
integrity="sha256-/JqT3SQfawRcv/BIHPThkBvs0OEvtFFmqPF/lYI/Cxo="
crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"
integrity="sha384-C6RzsynM9kWDrMNeT87bh95OGNyZPhcTNXj1NW7RuBCsyN/o0jlpcV8Qyq46cDfL"
crossorigin="anonymous"></script>
<script src="/script.js"></script>
<script>
$('#all-feeds').click(function() {
var isChecked = $(this).prop('checked');
$('.feed-checkbox').each(function() {
$(this).prop('checked', isChecked).trigger('click');
});
});
</script>
<script src="https://perl-ads.perlhacks.com/perl-ads.js">
</body>
</html>