Hey ghost devs,
I love your publishing software, great great product!
So, to my question:
Is it possible to route via the routes.yaml the homepage, the root /, to ones authors page?
Thanks!
Hey ghost devs,
I love your publishing software, great great product!
So, to my question:
Is it possible to route via the routes.yaml the homepage, the root /, to ones authors page?
Thanks!
routes:
/:
data: author.{slug}
collections:
/blog/:
...
This should A) give you access to the author on /
and it will redirect the target author page to /
.
The collection must then live under a different route.
This should work in theory, but I have not tested it. Let me know if it works.
Hi @Kate,
thanks for your fast reply!
Sadly it isnât working, Iâm getting a 422 RC when I visit the page on https://example.com/
Validation (isSlug) failed for slug
But, shouldnât I tell ghost which author it should route?
Have you replaced âslugâ with your author slug?
e.g.
routes:
/:
data: author.katharina
Yes I tried it, but I got a other RC 500:
Cannot read property âmatchâ of undefined
That is a template error because you mis-use something in your theme or itâs no longer compatible now that you are using it differently. If you do not specify a template it falls back to index.hbs.
If you set a new template e.g. âtemplate: rootâ it will load âroot.hbsâ. It should not error. You can then figure out why your fallback template throwed an errorâŚ
Thanks @Kate,
with the template itâs kind of working but data is still missing:
routes:
/:
data: author.ghost
template: author
And Iâm using the original casper theme, nothing modified.
So, is it a issue with casper itself, or because I miss-use the routing and itâs not intending to work? ;-)
The static route renders author data as you asked for
If you want to list posts of the author too, you:
Hey @Kate,
yeah, thatâs what I wanted, thanks!
routes:
/:
data: author.ghost
template: author
controller: channel
filter: primary_author:ghost
Oh, I just recognized, the menu header is missing, can I also get this to be displayed?
Hi @Kate, hi ghost-team,
any news on the issue, that the ghost header is not displayed?
Looks like the same problems exists here too: Page route for homepage, and blog issue - #4 by Kate
Update:
Looks like Iâve found two bugs when using this sort of route, the <nav class="site-nav">
is rendering in the source code, but the screen.css
has a wrong sizing. If you modify the top to 0, the navigation is back again:
.home-template .site-nav {
position: relative;
top: -70px; â top: 0
But whatâs missing from ghost itself is to render the <a class="site-nav-logo"...>
in the `
Update 2:
This problem gets triggered by the css min-width: 900px
in screen.css, chapter 3. Special Template Styles.
Can anyone reproduce this in Casper 2.9.1+?
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.