Skip to content

Commit 8e76fe8

Browse files
Post Routing
1 parent 4f6e183 commit 8e76fe8

File tree

5 files changed

+8
-6
lines changed

5 files changed

+8
-6
lines changed

index.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,7 @@ app.get('/', (req, res) => {
2828
// title: posts
2929
});
3030
});
31-
// app.get('/posts',(req,res)=>res.render('post.ejs'));
3231
app.get('/posts/:activepost',(req,res)=>{
33-
// console.log(req.params.activepost);
3432
posts.forEach((post)=>{
3533
if(_.lowerCase(post.title)==_.lowerCase(req.params.activepost)){
3634
res.render('post.ejs',{

public/css/style.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,10 @@
9797
color: black;
9898
/* font-weight: bold; */
9999
}
100+
.post-title-mod{
101+
font-size: 2.5em;
102+
font-weight: 700;
103+
}
100104
.compose-hero{
101105
text-transform: capitalize;
102106
font-size: 2em;

views/home.ejs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@
2525
<label class="post-published">Published On <span class="date">
2626
1 Jan 2020
2727
</span></label>
28-
<button class="read-more">
28+
<a href="/posts/<%= posts[i].title %>"><button class="read-more">
2929
Read More
30-
</button>
30+
</button></a>
3131
</div>
3232
</div>
3333
</div>

views/partials/header.ejs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<nav class="nav-desk">
1414
<center>
1515
<div class="nav-logo">
16-
<a class="nav-title" href="index.html">
16+
<a class="nav-title" href="/">
1717
Blog | <span>ishandeveloper</span>
1818
<!-- <span>by ishandeveloper</span> -->
1919
</a>

views/post.ejs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
<div class="jumbotron jumbotron-fluid post-container">
1515
<div class="container">
16-
<h1 class="display-4 post-title">
16+
<h1 class="display-4 post-title post-title-mod">
1717
<%= title %>
1818
</h1>
1919
<p class="lead post-content">

0 commit comments

Comments
 (0)