Tags theming + ghost routes


#1

Hello! Trying avoid so much work every time I would create a new project (creating a new blog or app from scratch), I came up with this idea, of creating 1 node app, which hosts the ghost blog, now if I ever wanted to create something special, I could create a route in my node and add manually the theme, then create a new tag on the ghost blog for that project. The real question is, how to have that project stand out of the rest? I looked into the tags, and every time you have an address such as this one: https://elkepon.com/tag/terminal-linux/ where the tag path is included, that kind of has it’s own theme? because it’s not getting the image from the main page, I don’t know if I looked at something wrong?
So…

  1. Was ghost created in a way that each tag has it’s own theme? If so, where can I modify this? I’d like to go to, let’s say… /tag/newProject and being able to have a specific theme for it, specially the image at the top, that right now is non existent.
  2. Can I create new routes, or let’s say pages, such as the posts or pages, so that I can modify the content based on the things that I want to add? Or would I have to create a route outside of ghost?

Edit: I see that there is only 1 tag.hbs file, sorry I’m a little lost with hbs files, how can I create 1 hbs based on the tag?
Thanks for the help


#2

What you’re asking can be accomplished with dynamic routing which will be available in Ghost 2.0. With dynamic routing, you can use (internal) tags to configure routing, and in specific routes (I think) you can use custom templates

Edit: you can currently specify custom tag templates by using the tag-{slug}.hbs naming scheme in your theme


#3

Thanks for the reply vika, that would be great to have, I was looking at this website now http://n4g.com/channel/ and wondering how the accomplish it, I doubt they create a different app for each article hehe.

In regards to tag-{}.hbs, how would I create it and where?

Is there any reference that I can read?

Thanks


#4

The docs for tag templates can be found in the theme docs. You need to add the template you want in your theme.

Channels is the predecessor to dynamic routing and was in an incomplete state


#5

OOOoooooo interesting! hahaha I can’t wait to have those dynamic routing going in ghost, I’ll check out the docs meanwhile for the tags.

@vikaspotluri123 quick question, it’s kind of related. What if I want to create:

 -backend_nodeAPP
    -ghostBlog
    -pageXthemed
       -getcontentFromGhostAndDisplayItHere (those with tags)

How can I refernce the content from ghost app to the main node app?


#6

You could either use ghost as an npm module and mount it, or you can proxy to localhost. I suggest using nginx as the web proxy instead of node because nginx is designed for things like this


#7

Thanks bro