-
Notifications
You must be signed in to change notification settings - Fork 0
/
blog.html
219 lines (211 loc) · 6.83 KB
/
blog.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Jobstronauts Blog</title>
<meta name="description" content="Read the latest blog posts and newsletter issues from Jobstronauts. Stay updated with our latest news and articles.">
<meta name="keywords" content="Jobstronauts blog, newsletter, articles, updates">
<meta name="author" content="Jobstronauts">
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap" rel="stylesheet">
<link rel="icon" href="favicon.ico" type="image/x-icon">
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
html, body {
height: 100%;
font-family: 'Roboto', sans-serif;
color: #333;
}
body {
display: flex;
flex-direction: column;
justify-content: space-between;
background-color: #f8f9fa;
}
header, footer {
background-color: #fff;
padding: 10px 20px;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
header {
display: flex;
justify-content: space-between;
align-items: center;
position: fixed;
top: 0;
left: 0;
right: 0;
z-index: 1000;
}
.logo {
font-size: 28px;
font-weight: bold;
color: #007bff;
}
nav {
display: flex;
gap: 15px;
}
nav a {
color: #007bff;
text-decoration: none;
font-weight: 500;
font-size: 18px;
padding: 10px 15px;
border-radius: 5px;
transition: background-color 0.3s ease;
}
nav a:hover {
background-color: #007bff;
color: #fff;
}
footer {
display: flex;
justify-content: space-between;
padding: 15px 20px;
position: fixed;
bottom: 0;
left: 0;
right: 0;
background-color: #fff;
border-top: 1px solid #ddd;
}
.footer-left {
display: flex;
flex-direction: column;
gap: 10px;
}
.footer-right {
display: flex;
flex-direction: column;
align-items: flex-end;
gap: 10px;
}
.social-links {
display: flex;
gap: 20px;
}
.social-links a {
color: #007bff;
font-size: 24px;
transition: color 0.3s ease;
}
.social-links a:hover {
color: #0056b3;
}
.container {
background-color: #fff;
padding: 30px;
border-radius: 8px;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
margin: 80px 20px 60px;
flex-grow: 1;
max-width: 800px;
margin-left: auto;
margin-right: auto;
}
.post {
background-color: white;
border-radius: 8px;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
margin-bottom: 20px;
padding: 20px;
}
.post h2 {
margin-top: 0;
color: #007bff;
}
.post p {
color: #333;
}
.post .meta {
font-size: 14px;
color: #777;
margin-top: 5px;
}
</style>
</head>
<body>
<header>
<div class="logo">Jobstronauts</div>
<nav>
<a href="index.html">Home</a>
<a href="blog.html">Blog</a>
<a href="contact.html">Contact</a>
</nav>
</header>
<div class="container" id="postsContainer">
<!-- Blog posts will be appended here by JavaScript -->
</div>
<footer>
<div class="footer-left">
<p>© 2024 Jobstronauts. All rights reserved.</p>
</div>
<div class="footer-right">
<div class="social-links">
<a href="https://www.facebook.com/Jobstronauts" target="_blank">Facebook</a>
<a href="https://www.twitter.com/Jobstronauts" target="_blank">Twitter</a>
<a href="https://www.linkedin.com/company/Jobstronauts" target="_blank">LinkedIn</a>
</div>
</div>
</footer>
<script>
const apiKey = 'kM3ez1qsEVm88T3JUpr8k76UJjxdNJd2LkM61AGUVHZ8KKnMOqfp1MNP0QF0aGzQ';
async function fetchPublications() {
const url = `https://api.beehiiv.com/v2/publications`;
const headers = {
'Authorization': `Bearer ${apiKey}`,
'Accept': 'application/json'
};
try {
const response = await fetch(url, { headers });
if (!response.ok) {
throw new Error('Network response was not ok');
}
const data = await response.json();
const publicationId = data.data[0].id; // Assuming you want the first publication
fetchIssues(publicationId);
} catch (error) {
console.error('Failed to fetch publications:', error);
}
}
async function fetchIssues(publicationId) {
const url = `https://api.beehiiv.com/v2/publications/${publicationId}/issues`;
const headers = {
'Authorization': `Bearer ${apiKey}`,
'Accept': 'application/json'
};
try {
const response = await fetch(url, { headers });
if (!response.ok) {
throw new Error('Network response was not ok');
}
const data = await response.json();
displayPosts(data.data);
} catch (error) {
console.error('Failed to fetch issues:', error);
}
}
function displayPosts(posts) {
const postsContainer = document.getElementById('postsContainer');
postsContainer.innerHTML = ''; // Clear any existing content
posts.forEach(post => {
const postElement = document.createElement('div');
postElement.className = 'post';
postElement.innerHTML = `
<h2>${post.name}</h2>
<p>${post.summary}</p>
<div class="meta">Published on ${new Date(post.created * 1000).toLocaleDateString()}</div>
`;
postsContainer.appendChild(postElement);
});
}
// Fetch and display the publications and issues on page load
fetchPublications();
</script>
</body>
</html>