Skip to content

Aakarshk25/Ejs-Blog-Project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

to start the ejs server in github bash you havr to wirte cmd nodemon app.js.

<%=myvar%> this sign is used to replace the file in app.js <%- include('header')-%> we can render the layout from one age to another page. <%- include header.ejs -%> this is another methaod to render the layout.

1 app.get('/about',function(req,res){ res.render('about',{see:aboutContent}) })

explanation , '/about' -> this is the area where you want to show your folder. 'about' -> this your file name.

  • ABOUT US
  • this is the way you have to link your files = /about only this you have to write no root or file directory .

    note => to create a javascript object in ejs var objectName ={ key : value} ex- var myobj={title:req.body.title, content:req.body.main} }) this is two alue pair seprated with coma.

    Route Parameter is very important topic . https://expressjs.com/en/guide/routing.html

    note -> rs is used to restart your noadman server. note -> lodash is very usefull to escape or get rid with upper case and lower case of tite when you search in a search bar

    truncate the chareters into a limited words by using ex =

    <%=post.content.substring(0 , 100) + "..."%>

        New github trick => https://github.com/Aakarshk25/Ejs-Blog-Project/edit/main/readme.md . => just add S in between the github and see the magic
    

    About

    No description, website, or topics provided.

    Resources

    Stars

    Watchers

    Forks

    Releases

    No releases published

    Packages

     
     
     

    Contributors