mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
blog wip
This commit is contained in:
parent
c5497a6c07
commit
5cf756969e
3 changed files with 23 additions and 0 deletions
17
services/web/app/coffee/Features/Blog/BlogController.coffee
Normal file
17
services/web/app/coffee/Features/Blog/BlogController.coffee
Normal file
|
@ -0,0 +1,17 @@
|
|||
request = require("request")
|
||||
settings = require("settings-sharelatex")
|
||||
logger = require("logger-sharelatex")
|
||||
|
||||
module.exports =
|
||||
|
||||
getPage: (req, res)->
|
||||
url = req.url
|
||||
logger.log url:url, "proxying request to blog api"
|
||||
request.get "#{settings.apis.blog.url}#{url}", (err, r, data)->
|
||||
console.log data
|
||||
try
|
||||
data = JSON.parse(data)
|
||||
catch err
|
||||
logger.err err:err, data:data, "error parsing data from data"
|
||||
res.render "blog/#{data.layout}", data
|
||||
|
|
@ -36,6 +36,7 @@ DropboxUserController = require("./Features/Dropbox/DropboxUserController")
|
|||
PasswordResetRouter = require("./Features/PasswordReset/PasswordResetRouter")
|
||||
StaticPagesRouter = require("./Features/StaticPages/StaticPagesRouter")
|
||||
ChatController = require("./Features/Chat/ChatController")
|
||||
BlogController = require("./Features/Blog/BlogController")
|
||||
|
||||
logger = require("logger-sharelatex")
|
||||
_ = require("underscore")
|
||||
|
@ -64,6 +65,8 @@ module.exports = class Router
|
|||
StaticPagesRouter.apply(app)
|
||||
TemplatesRouter.apply(app)
|
||||
|
||||
app.get '/blog/*', BlogController.getPage
|
||||
|
||||
if Settings.enableSubscriptions
|
||||
app.get '/user/bonus', AuthenticationController.requireLogin(), ReferalMiddleware.getUserReferalId, ReferalController.bonus
|
||||
|
||||
|
|
3
services/web/app/views/blog/post.jade
Normal file
3
services/web/app/views/blog/post.jade
Normal file
|
@ -0,0 +1,3 @@
|
|||
div #{title}
|
||||
div #{author}
|
||||
div !{content}
|
Loading…
Reference in a new issue