Skip to content

Commit 7208999

Browse files
author
Invers3
committed
Update repo
Testing netlify listing posts
1 parent 8a16864 commit 7208999

File tree

8 files changed

+1585
-4
lines changed

8 files changed

+1585
-4
lines changed

_index/about.json

Whitespace-only changes.

_index/guides.json

Whitespace-only changes.

assets/css/base.css

Lines changed: 1019 additions & 0 deletions
Large diffs are not rendered by default.

assets/css/index.css

Lines changed: 499 additions & 0 deletions
Large diffs are not rendered by default.

index.html

Lines changed: 30 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
<!DOCTYPE html>
2-
<html>
2+
<html lang="en">
33
<head>
4+
<meta charset="utf-8">
45
<title>Code Invers3 / Welcome</title>
56
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
7+
<link rel="stylesheet" href="assets/css/base.css">
8+
<link rel="stylesheet" href="assets/css/index.css">
69
<script type="text/javascript" src="assets/js/jquery-3.7.1.min.js"></script>
710
<script type="text/javascript" src="assets/js/underscore-min.js"></script>
811
<script type="text/javascript" src="assets/js/backbone-min.js"></script>
@@ -14,10 +17,33 @@
1417
</style>
1518
</head>
1619
<body>
17-
<div id="conteiner">
18-
<h2>Code Invers3 repository</h2>
19-
<p>Here stored PS4 PPPwn paylodas and tools.</p>
20+
<div id="container">
21+
<div class="content">
22+
<div id="header">
23+
<div class="row">
24+
<div class="col-3">
25+
<a href="#">LOGO</a>
26+
</div>
27+
<div class="col-9">
28+
<ul class="menu">
29+
<li><a href="">Home</a></li>
30+
<li><a href="#guides">Guides</a></li>
31+
<li><a href="#about">About</a></li>
32+
</ul>
33+
</div>
34+
</div>
35+
</div>
36+
<div id="section">
37+
<div class="content">
38+
<div class="box">
39+
<h2>Testing script</h2>
40+
<p>Welcome page.</p>
41+
</div>
42+
</div>
43+
</div>
44+
</div>
2045
</div>
46+
<script type="text/javascript" src="assets/js/index.js"></script>
2147
<script type="text/javascript">
2248

2349
</script>

netlify.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[build]
2+
functions = "netlify/functions"

netlify/functions/getPosts.js

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
const fs = require('fs');
2+
const path = require('path');
3+
4+
exports.handler = async function() {
5+
try {
6+
7+
const postsDir = path.join(process.cwd(), '_posts');
8+
const files = fs.readdirSync(postsDir);
9+
10+
const posts = files.filter(file => file.endsWith('.json')).map(file => {
11+
const content = fs.readFileSync(path.join(postsDir, file), 'utf-8');
12+
return JSON.parse(content);
13+
});
14+
15+
return {
16+
statusCode: 200,
17+
body: JSON.stringify(posts)
18+
};
19+
} catch (error) {
20+
console.error('Error to get posts:', error);
21+
return {
22+
statusCode: 500,
23+
body: JSON.stringify({ message: 'Cannot get posts.' })
24+
};
25+
}
26+
};

post.html

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<title>Post</title>
5+
</head>
6+
<body>
7+
<h2>Media page</h2>
8+
</body>
9+
</html>

0 commit comments

Comments
 (0)