-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path404.html
506 lines (446 loc) · 22.5 KB
/
404.html
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
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="">
<meta name="author" content="sh20raj">
<link rel="icon" href="../logo.png">
<meta http-equiv="status" content="200">
<title>ArticlePlanet</title>
<!-- Bootstrap core CSS -->
<link href="../assets/css/bootstrap.min.css" rel="stylesheet">
<script src="https://cdnjs.cloudflare.com/ajax/libs/showdown/1.9.1/showdown.min.js"></script>
<!-- Include Prism for code highlighting -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/prismjs@1.25.0/themes/prism.min.css">
<!-- Fonts -->
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Righteous%7CMerriweather:300,300i,400,400i,700,700i" rel="stylesheet">
<!-- Custom styles for this template -->
<link href="../assets/css/mediumish.css" rel="stylesheet">
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-1992S8P4VR"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-1992S8P4VR');
</script>
</head>
<body>
<!-- Begin Nav
================================================== -->
<nav class="navbar navbar-toggleable-md navbar-light bg-white fixed-top mediumnavigation">
<button class="navbar-toggler navbar-toggler-right" type="button" data-toggle="collapse" data-target="#navbarsExampleDefault" aria-controls="navbarsExampleDefault" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="container">
<!-- Begin Logo -->
<a class="navbar-brand" href="../">
<img src="../logo.png" alt="logo">
</a>
<!-- End Logo -->
<div class="collapse navbar-collapse" id="navbarsExampleDefault">
<!-- Begin Menu -->
<ul class="navbar-nav ml-auto">
<li class="nav-item active">
<a class="nav-link" href="../">Stories <span class="sr-only">(current)</span></a>
</li>
<li class="nav-item">
<a class="nav-link" href="../new/">Write </a>
</li>
<li class="nav-item">
<a id="account" class="nav-link" href="../#.html">Login</a>
</li>
</ul>
<!-- End Menu -->
<!-- Begin Search -->
<form class="form-inline my-2 my-lg-0">
<input class="form-control mr-sm-2" type="text" placeholder="Search">
<span class="search-icon"><svg class="svgIcon-use" width="25" height="25" viewbox="0 0 25 25"><path d="M20.067 18.933l-4.157-4.157a6 6 0 1 0-.884.884l4.157 4.157a.624.624 0 1 0 .884-.884zM6.5 11c0-2.62 2.13-4.75 4.75-4.75S16 8.38 16 11s-2.13 4.75-4.75 4.75S6.5 13.62 6.5 11z"></path></svg></span>
</form>
<!-- End Search -->
</div>
</div>
</nav>
<!-- End Nav
================================================== -->
<!-- Begin Article
================================================== -->
<div class="container">
<div class="row">
<!-- Begin Fixed Left Share -->
<div class="col-md-2 col-xs-12">
<div class="share" >
<!--<p>
Share
</p>
<ul >
<li>
<a target="_blank" href="#">
<svg class="svgIcon-use" width="29" height="29" viewbox="0 0 29 29"><path d="M21.967 11.8c.018 5.93-4.607 11.18-11.177 11.18-2.172 0-4.25-.62-6.047-1.76l-.268.422-.038.5.186.013.168.012c.3.02.44.032.6.046 2.06-.026 3.95-.686 5.49-1.86l1.12-.85-1.4-.048c-1.57-.055-2.92-1.08-3.36-2.51l-.48.146-.05.5c.22.03.48.05.75.08.48-.02.87-.07 1.25-.15l2.33-.49-2.32-.49c-1.68-.35-2.91-1.83-2.91-3.55 0-.05 0-.01-.01.03l-.49-.1-.25.44c.63.36 1.35.57 2.07.58l1.7.04L7.4 13c-.978-.662-1.59-1.79-1.618-3.047a4.08 4.08 0 0 1 .524-1.8l-.825.07a12.188 12.188 0 0 0 8.81 4.515l.59.033-.06-.59v-.02c-.05-.43-.06-.63-.06-.87a3.617 3.617 0 0 1 6.27-2.45l.2.21.28-.06c1.01-.22 1.94-.59 2.73-1.09l-.75-.56c-.1.36-.04.89.12 1.36.23.68.58 1.13 1.17.85l-.21-.45-.42-.27c-.52.8-1.17 1.48-1.92 2L22 11l.016.28c.013.2.014.35 0 .52v.04zm.998.038c.018-.22.017-.417 0-.66l-.498.034.284.41a8.183 8.183 0 0 0 2.2-2.267l.97-1.48-1.6.755c.17-.08.3-.02.34.03a.914.914 0 0 1-.13-.292c-.1-.297-.13-.64-.1-.766l.36-1.254-1.1.695c-.69.438-1.51.764-2.41.963l.48.15a4.574 4.574 0 0 0-3.38-1.484 4.616 4.616 0 0 0-4.61 4.613c0 .29.02.51.08.984l.01.02.5-.06.03-.5c-3.17-.18-6.1-1.7-8.08-4.15l-.48-.56-.36.64c-.39.69-.62 1.48-.65 2.28.04 1.61.81 3.04 2.06 3.88l.3-.92c-.55-.02-1.11-.17-1.6-.45l-.59-.34-.14.67c-.02.08-.02.16 0 .24-.01 2.12 1.55 4.01 3.69 4.46l.1-.49-.1-.49c-.33.07-.67.12-1.03.14-.18-.02-.43-.05-.64-.07l-.76-.09.23.73c.57 1.84 2.29 3.14 4.28 3.21l-.28-.89a8.252 8.252 0 0 1-4.85 1.66c-.12-.01-.26-.02-.56-.05l-.17-.01-.18-.01L2.53 21l1.694 1.07a12.233 12.233 0 0 0 6.58 1.917c7.156 0 12.2-5.73 12.18-12.18l-.002.04z"></path></svg>
</a>
</li>
<li>
<a target="_blank" href="#">
<svg class="svgIcon-use" width="29" height="29" viewbox="0 0 29 29"><path d="M16.39 23.61v-5.808h1.846a.55.55 0 0 0 .546-.48l.36-2.797a.551.551 0 0 0-.547-.62H16.39V12.67c0-.67.12-.813.828-.813h1.474a.55.55 0 0 0 .55-.55V8.803a.55.55 0 0 0-.477-.545c-.436-.06-1.36-.116-2.22-.116-2.5 0-4.13 1.62-4.13 4.248v1.513H10.56a.551.551 0 0 0-.55.55v2.797c0 .304.248.55.55.55h1.855v5.76c-4.172-.96-7.215-4.7-7.215-9.1 0-5.17 4.17-9.36 9.31-9.36 5.14 0 9.31 4.19 9.31 9.36 0 4.48-3.155 8.27-7.43 9.15M14.51 4C8.76 4 4.1 8.684 4.1 14.46c0 5.162 3.75 9.523 8.778 10.32a.55.55 0 0 0 .637-.543v-6.985a.551.551 0 0 0-.55-.55H11.11v-1.697h1.855a.55.55 0 0 0 .55-.55v-2.063c0-2.02 1.136-3.148 3.03-3.148.567 0 1.156.027 1.597.06v1.453h-.924c-1.363 0-1.93.675-1.93 1.912v1.78c0 .3.247.55.55.55h2.132l-.218 1.69H15.84c-.305 0-.55.24-.55.55v7.02c0 .33.293.59.623.54 5.135-.7 9.007-5.11 9.007-10.36C24.92 8.68 20.26 4 14.51 4"></path></svg>
</a>
</li>
</ul>
<div class="sep">
</div>
<p>
Talk
</p>
<ul>
<li>
<a href="#comments">
<br/>
<svg class="svgIcon-use" width="29" height="29" viewbox="0 0 29 29"><path d="M21.27 20.058c1.89-1.826 2.754-4.17 2.754-6.674C24.024 8.21 19.67 4 14.1 4 8.53 4 4 8.21 4 13.384c0 5.175 4.53 9.385 10.1 9.385 1.007 0 2-.14 2.95-.41.285.25.592.49.918.7 1.306.87 2.716 1.31 4.19 1.31.276-.01.494-.14.6-.36a.625.625 0 0 0-.052-.65c-.61-.84-1.042-1.71-1.282-2.58a5.417 5.417 0 0 1-.154-.75zm-3.85 1.324l-.083-.28-.388.12a9.72 9.72 0 0 1-2.85.424c-4.96 0-8.99-3.706-8.99-8.262 0-4.556 4.03-8.263 8.99-8.263 4.95 0 8.77 3.71 8.77 8.27 0 2.25-.75 4.35-2.5 5.92l-.24.21v.32c0 .07 0 .19.02.37.03.29.1.6.19.92.19.7.49 1.4.89 2.08-.93-.14-1.83-.49-2.67-1.06-.34-.22-.88-.48-1.16-.74z"></path></svg>
</a>
</li>
</ul>
<p>
</p>-->
<ul class="svg-list">
<li>
<a href="#edit" id="editbtn" >
<svg style="height:25px" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-6 h-6">
<path stroke-linecap="round" stroke-linejoin="round" d="m16.862 4.487 1.687-1.688a1.875 1.875 0 1 1 2.652 2.652L10.582 16.07a4.5 4.5 0 0 1-1.897 1.13L6 18l.8-2.685a4.5 4.5 0 0 1 1.13-1.897l8.932-8.931Zm0 0L19.5 7.125M18 14v4.75A2.25 2.25 0 0 1 15.75 21H5.25A2.25 2.25 0 0 1 3 18.75V8.25A2.25 2.25 0 0 1 5.25 6H10" />
</svg>
</a>
</li>
<li>
<a href="#gist" id="gist">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-6 h-6">
<path stroke-linecap="round" stroke-linejoin="round" d="M12.75 19.5v-.75a7.5 7.5 0 0 0-7.5-7.5H4.5m0-6.75h.75c7.87 0 14.25 6.38 14.25 14.25v.75M6 18.75a.75.75 0 1 1-1.5 0 .75.75 0 0 1 1.5 0Z" />
</svg>
</a></li>
<li>
<a href="../new/">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-6 h-6">
<path stroke-linecap="round" stroke-linejoin="round" d="M12 9v6m3-3H9m12 0a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z" />
</svg>
</a></li>
<li>
<a href="#Delete" onclick="deletePost()">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-6 h-6">
<path stroke-linecap="round" stroke-linejoin="round" d="m14.74 9-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 0 1-2.244 2.077H8.084a2.25 2.25 0 0 1-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 0 0-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 0 1 3.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 0 0-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 0 0-7.5 0" />
</svg>
</a>
</li>
<li>
<span id="totalviews"></span>
</li>
</ul>
</div>
</div>
<!-- End Fixed Left Share -->
<!-- Begin Post -->
<div class="col-md-8 col-md-offset-2 col-xs-12">
<div class="mainheading">
<!-- Begin Top Meta -->
<div class="row post-top-meta">
<div class="col-md-2">
<a id="authorlink" href="#"><img id="avatar" class="author-thumb" src="../../assets/dot.png" alt="Sal"></a>
</div>
<div class="col-md-10">
<a id="author" class="link-dark" href="user.html">SH20RAJ</a><a href="#" class="btn follow">Follow</a>
<span class="author-description"> Find Interesting stuff here...</span>
<br>
<span id="post-date" class="post-date">27 March 2007</span><span class="dot"></span><span class="post-read"> <a id="vclink" target="_blank" href="https://visitorbadge.io/status?path=ArticlePlanet"><img id="vcimg" src="https://api.visitorbadge.io/api/visitors?path=ArticlePlanet" /></a>
</span>
</div>
</div>
<!-- End Top Menta -->
<h1 class="posttitle" id="post-title"> </h1>
</div>
<!-- Begin Featured Image -->
<img id="post-cover" class="featured-image img-fluid" src="../assets/dot.png" alt="">
<!-- End Featured Image -->
<!-- Begin Post Content -->
<div id="post-content" class="article-post">
</div>
<!-- End Post Content -->
<!-- Begin Tags -->
<div class="after-post-tags">
<ul class="tags">
<li><a href="#">Design</a></li>
<li><a href="#">Growth Mindset</a></li>
<li><a href="#">Productivity</a></li>
<li><a href="#">Personal Growth</a></li>
</ul>
</div>
<!-- End Tags -->
</div>
<!-- End Post -->
</div>
</div>
<!-- End Article
================================================== -->
<div class="hideshare"></div>
<!-- Begin Related
================================================== -->
<div class="graybg">
<div class="container">
<div id="postcontainer" class="row listrecent listrelated">
<!-- begin post -->
<div class="col-md-4">
<div class="card">
<a href="post.html">
<img class="img-fluid img-thumb" src="../assets/img/demopic/9.jpg" alt="">
</a>
<div class="card-block">
<h2 class="card-title"><a href="post.html">Best recreational places to visit on a holiday</a></h2>
<div class="metafooter">
<div class="wrapfooter">
<span class="meta-footer-thumb">
<a href="author.html"><img class="author-thumb" src="https://www.gravatar.com/avatar/e56154546cf4be74e393c62d1ae9f9d4?s=250&d=mm&r=x" alt="Sal"></a>
</span>
<span class="author-meta">
<span class="post-name"><a href="author.html">Sal</a></span><br/>
<span class="post-date">22 July 2017</span><span class="dot"></span><span class="post-read">6 min read</span>
</span>
<span class="post-read-more"><a href="post.html" title="Read Story"><svg class="svgIcon-use" width="25" height="25" viewbox="0 0 25 25"><path d="M19 6c0-1.1-.9-2-2-2H8c-1.1 0-2 .9-2 2v14.66h.012c.01.103.045.204.12.285a.5.5 0 0 0 .706.03L12.5 16.85l5.662 4.126a.508.508 0 0 0 .708-.03.5.5 0 0 0 .118-.285H19V6zm-6.838 9.97L7 19.636V6c0-.55.45-1 1-1h9c.55 0 1 .45 1 1v13.637l-5.162-3.668a.49.49 0 0 0-.676 0z" fill-rule="evenodd"></path></svg></a></span>
</div>
</div>
</div>
</div>
</div>
<!-- end post -->
<!-- begin post -->
<div class="col-md-4">
<div class="card">
<a href="post.html">
<img class="img-fluid img-thumb" src="../assets/img/demopic/8.jpg" alt="">
</a>
<div class="card-block">
<h2 class="card-title"><a href="post.html">How travelling can change your life</a></h2>
<div class="metafooter">
<div class="wrapfooter">
<span class="meta-footer-thumb">
<a href="author.html"><img class="author-thumb" src="https://www.gravatar.com/avatar/e56154546cf4be74e393c62d1ae9f9d4?s=250&d=mm&r=x" alt="Sal"></a>
</span>
<span class="author-meta">
<span class="post-name"><a href="author.html">Sal</a></span><br/>
<span class="post-date">22 July 2017</span><span class="dot"></span><span class="post-read">6 min read</span>
</span>
<span class="post-read-more"><a href="post.html" title="Read Story"><svg class="svgIcon-use" width="25" height="25" viewbox="0 0 25 25"><path d="M19 6c0-1.1-.9-2-2-2H8c-1.1 0-2 .9-2 2v14.66h.012c.01.103.045.204.12.285a.5.5 0 0 0 .706.03L12.5 16.85l5.662 4.126a.508.508 0 0 0 .708-.03.5.5 0 0 0 .118-.285H19V6zm-6.838 9.97L7 19.636V6c0-.55.45-1 1-1h9c.55 0 1 .45 1 1v13.637l-5.162-3.668a.49.49 0 0 0-.676 0z" fill-rule="evenodd"></path></svg></a></span>
</div>
</div>
</div>
</div>
</div>
<!-- end post -->
<!-- begin post -->
<div class="col-md-4">
<div class="card">
<a href="post.html">
<img class="img-fluid img-thumb" src="../assets/img/demopic/7.jpg" alt="">
</a>
<div class="card-block">
<h2 class="card-title"><a href="post.html">Little red dress and a perfect summer</a></h2>
<div class="metafooter">
<div class="wrapfooter">
<span class="meta-footer-thumb">
<a href="author.html"><img class="author-thumb" src="https://www.gravatar.com/avatar/e56154546cf4be74e393c62d1ae9f9d4?s=250&d=mm&r=x" alt="Sal"></a>
</span>
<span class="author-meta">
<span class="post-name"><a href="author.html">Sal</a></span><br/>
<span class="post-date">22 July 2017</span><span class="dot"></span><span class="post-read">6 min read</span>
</span>
<span class="post-read-more"><a href="post.html" title="Read Story"><svg class="svgIcon-use" width="25" height="25" viewbox="0 0 25 25"><path d="M19 6c0-1.1-.9-2-2-2H8c-1.1 0-2 .9-2 2v14.66h.012c.01.103.045.204.12.285a.5.5 0 0 0 .706.03L12.5 16.85l5.662 4.126a.508.508 0 0 0 .708-.03.5.5 0 0 0 .118-.285H19V6zm-6.838 9.97L7 19.636V6c0-.55.45-1 1-1h9c.55 0 1 .45 1 1v13.637l-5.162-3.668a.49.49 0 0 0-.676 0z" fill-rule="evenodd"></path></svg></a></span>
</div>
</div>
</div>
</div>
</div>
<!-- end post -->
</div>
</div>
</div>
<!-- End Related Posts
================================================== -->
<!-- Begin Featured
================================================== -->
<script>
document.addEventListener("DOMContentLoaded", async function () {
// GitHub Gist API endpoint
const gistApiEndpoint = "https://api.github.com/users/sh20raj/gists"; // Replace 'yourusername' with your GitHub username
const tagToFilter = "ArticlePlanet"; // Replace with the specific tag you use for Article Planet Gists
try {
// Fetch the list of Gists
const response = await fetch(gistApiEndpoint);
const gistsData = await response.json();
// Filter Gists that contain the specified tag in their descriptions
const articleGists = gistsData;
// Shuffle the array of articles to get random posts
const shuffledArticles = articleGists.sort(() => Math.random() - 0.5);
// Ensure exactly 3 posts are displayed
const selectedArticles = shuffledArticles.slice(0, 3);
// Extract relevant information from each Article Planet Gist
const articles = await Promise.all(
selectedArticles.map(async (gist) => {
const title = gist.description || "Untitled";
const gistId = gist.id;
const gistUrl = gist.html_url;
// Extract date and cover URL from the Markdown content
const markdownContentResponse = await fetch(gist.files[Object.keys(gist.files)[0]].raw_url);
const markdownContent = await markdownContentResponse.text();
function extractMetadata(markdown) {
const match = markdown.match(/^---([\s\S]*?)---([\s\S]*)/);
const metadata = {};
if (match && match[1]) {
const metadataText = match[1].trim();
metadataText.split("\n").forEach((line) => {
const [key, ...valueParts] = line
.split(":")
.map((item) => item.trim());
metadata[key] = valueParts
.join(":")
.replace(/(^"|"$)/g, "")
.trim();
});
// Convert tags to an array
metadata.tags = metadata.tags
? metadata.tags.split(",").map((tag) => tag.trim())
: [];
}
return metadata;
}
const meta = extractMetadata(markdownContent);
if (!meta.ArticlePlanet) {
return '';
}
function convertToRelativeDate(dateString) {
const currentDate = new Date();
const providedDate = new Date(dateString);
const timeDifferenceInSeconds = Math.floor((currentDate - providedDate) / 1000);
if (timeDifferenceInSeconds < 60) {
return 'just now';
} else if (timeDifferenceInSeconds < 3600) {
const minutes = Math.floor(timeDifferenceInSeconds / 60);
return `${minutes} minute${minutes > 1 ? 's' : ''} ago`;
} else if (timeDifferenceInSeconds < 86400) {
const hours = Math.floor(timeDifferenceInSeconds / 3600);
return `${hours} hour${hours > 1 ? 's' : ''} ago`;
} else if (timeDifferenceInSeconds < 2592000) {
const days = Math.floor(timeDifferenceInSeconds / 86400);
return `${days} day${days > 1 ? 's' : ''} ago`;
} else {
// You can add more conditions for months and years as needed
return 'more than a month ago';
}
}
let date = convertToRelativeDate(meta.datePublished);
let coverUrl = meta.cover;
// Create HTML elements based on the fetched Gists
return `
<div class="col-md-4">
<div class="card">
<a href="../posts/${gistId}">
<img style="height: 200px;width: 100%;" class="img-fluid img-thumb" src="${coverUrl || "https://random.imagecdn.app/500/300" + "?id=" + gistId}" alt="">
</a>
<div class="card-block">
<h2 class="card-title"><a href="../posts/${gistId}">${title}</a></h2>
<div class="metafooter">
<div class="wrapfooter">
<span class="meta-footer-thumb">
<a href="user.html?id=${gist.owner.login}"><img class="author-thumb" src="${gist.owner.avatar_url}" alt="${gist.owner.login}"></a>
</span>
<span class="author-meta">
<span class="post-name"><a href="../user.html?id=${gist.owner.login}">${gist.owner.login}</a></span><br />
<span class="post-date">${date}</span><span class="dot"></span><span class="post-read">6 min read</span>
</span>
<span class="post-read-more"><a href="../posts/${gistId}" title="Read Story"><svg class="svgIcon-use" width="25" height="25" viewBox="0 0 25 25"><path d="M19 6c0-1.1-.9-2-2-2H8c-1.1 0-2 .9-2 2v14.66h.012c.01.103.045.204.12.285a.5.5 0 0 0 .706.03L12.5 16.85l5.662 4.126a.508.508 0 0 0 .708-.03.5.5 0 0 0 .118-.285H19V6zm-6.838 9.97L7 19.636V6c0-.55.45-1 1-1h9c.55 0 1 .45 1 1v13.637l-5.162-3.668a.49.49 0 0 0-.676 0z" fill-rule="evenodd"></path></svg></a></span>
</div>
</div>
</div>
</div>
</div>
`;
})
);
// Insert the generated HTML into the postcontainer
document.getElementById("postcontainer").innerHTML = articles.join("");
} catch (error) {
console.error("Error fetching Gists:", error);
document.getElementById("postcontainer").innerHTML = "<p>Error loading articles.</p>";
}
});
async function deletePost() {
// Display a confirmation dialog
const isConfirmed = confirm('Are you sure you want to delete this post?');
if (!isConfirmed) {
// User cancelled the deletion
return;
}
try {
const response = await fetch(`https://api.github.com/gists/${gistId}`, {
method: 'DELETE',
headers: {
'Authorization': `Bearer ${localStorage.accessToken}`
}
});
if (response.ok) {
// Successfully deleted, you can handle UI updates or navigate to a different page
console.log('Post deleted successfully');
// Example: Redirect to the homepage
window.location.href = '/';
} else {
console.error('Error deleting post:', response.statusText);
// Handle error, show a message, etc.
}
} catch (error) {
console.error('Error deleting post:', error);
// Handle error, show a message, etc.
}
}
</script>
<!-- End Featured
================================================== -->
<!-- Begin Twitter Timeline
================================================== -->
<div class="container margtop3rem">
<a class="twitter-grid" href="https://codexdindia.blogspot.com/">Social</a>
</div>
<!-- End Twitter Timeline
================================================== -->
<!-- Begin AlertBar
==================================================
<div class="alertbar">
<div class="container text-center">
<img src="../assets/img/logo.png" alt=""> Never miss a <b>story</b> from us, get weekly updates in your inbox. <a href="#" class="btn subscribe">Get Updates</a>
</div>
</div>-->
<!-- End AlertBar
================================================== -->
<!-- Begin Footer
================================================== -->
<div class="container">
<div class="footer">
<p class="pull-left">
Copyright © 2024 ArticlePlanet
</p>
<p class="pull-right">
ArticlePlanet by <a target="_blank" href="https://linktr.ee/cxdiin">CXDI</a>
</p>
<div class="clearfix">
</div>
</div>
</div>
<!-- End Footer
================================================== -->
<!-- Bootstrap core JavaScript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script src="../site.js"></script>
<script src="../assets/js/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/tether/1.4.0/js/tether.min.js" integrity="sha384-DztdAPBWPRXSA/3eYEEUWrWCy7G5KFbe8fFjk5JAIxUYHKkDx6Qin1DkWx51bBrb" crossorigin="anonymous"></script>
<script src="../assets/js/bootstrap.min.js"></script>
<script src="../assets/js/ie10-viewport-bug-workaround.js"></script>
<script src="../assets/js/mediumish.js"></script>
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.25.0/prism.min.js"></script>
<script src="../post.js"></script>
</body>
</html>