Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support: How to disable landing page section? #173

Closed
Tracked by #1120
guiadco opened this issue Jan 14, 2020 · 19 comments
Closed
Tracked by #1120

Support: How to disable landing page section? #173

guiadco opened this issue Jan 14, 2020 · 19 comments

Comments

@guiadco
Copy link

guiadco commented Jan 14, 2020

It would be great to use the docsy docs section without the landing page.

I try to force layout: docs at top level, but i think layout/_default apply before docs layout.

  • If i keep the docs section in the folder docs i have a blank page at top-level
  • If i push the docs layout at top-level i have a page without docs layout style.
    • no navbar / no right menu

Could you help me?

@LisaFC
Copy link
Collaborator

LisaFC commented Jan 15, 2020

Hi! So just to clarify, do you want a site that doesn't have a landing page like docsy.dev but has the docs section at the root so you land straight on it?

You need to force not layout: but type: and then it works (I've just tried it) - have your content index page with frontmatter like:

---
title: "Goldydocs"
linkTitle: "Goldydocs"
type: docs
---

@LisaFC
Copy link
Collaborator

LisaFC commented Jan 15, 2020

Just playing around with it a bit more, you'd also probably want to remove any other folders from the example site (if you cloned it) and just have your docs sections as subsections of content. You'd then need to add type:docs to those pages too as they're not in a docs/ folder.

Alternatively you could make the docs layout your default layout - in your own project, add a layouts/ directory that overrides the theme one and add your own _default/ directory with the list.html, baseof.html and single.html from the Docsy docs/ layout directory. Then pages by default will get the left nav and right menu.

@guiadco
Copy link
Author

guiadco commented Jan 15, 2020

Hi, many thanks for your help.

I try to move my subsection from docs/ to .

I add the type: docs on any page ans subsection pages, but i look this:

image

and when i go to section getting started, i see that:

image

but i want to keep the left-menu as he looks like in the docs/ folder.

Do you know, how i could do?

If i create a layout/_default, i have the same effect.

I see i lose this too:

image

I tried to rename docs into documentation and add type: docs:

  • it's the same effect at top-level but in documentation folder he as the good behavior

@LisaFC
Copy link
Collaborator

LisaFC commented Jan 15, 2020

I'll take a look!

@LisaFC
Copy link
Collaborator

LisaFC commented Jan 22, 2020

Just to let you know I haven't forgotten about this, I just need to find a bit of time to see if I can get my test site to do what you want and then let you know how I did it. :) Hopefully have something by the end of the week.

@shahidhk
Copy link

I am also trying this, very new to Hugo and Docsy, tried copying the partials as well, doesn't seem to work. Any help is appreciated.

Thanks for the project, it works really well.

@LisaFC
Copy link
Collaborator

LisaFC commented Jan 23, 2020

Nearly there! Creating your own layouts/_default/ and copying the baseof.html, list.html, and single.html from the theme's layouts/docs/ into it is the way to go anyway, as then you don't need to specify any special types for your docs pages even if they're not in a docs folder - they get the "docs" type layout with the side nav by default. I've already got it working for a site that just has a Documentation section.

Just checking if you also want your site to have the About, Blog, and Community pages? If so I'll need to keep tweaking things a bit to make sure the menus work, and you may need to create your own layout type for About and Community too so that they don't get the side nav....

@guiadco
Copy link
Author

guiadco commented Jan 24, 2020

Hi thanks for your help :)

I tried this method but i still have some problems

When you look at the menu:
image

It's ok on the first page, but the right-menu still reset on each submenu:
image

And i still lose this section on first page:
image

Thanks for your help :)

@LisaFC
Copy link
Collaborator

LisaFC commented Jan 24, 2020

Ah yes, I see what's happening. Let me see if I can fix it.

@shahidhk
Copy link

Thanks @LisaFC! Really appreciate it.

Just checking if you also want your site to have the About, Blog, and Community pages?

I am only interested in the docs part of it. So no About, Blog and Community 😄

@LisaFC
Copy link
Collaborator

LisaFC commented Jan 24, 2020

I've now fixed the sidebar menu so it stops showing just the subsection when you change pages, just need to figure out why the section index on the main landing page isn't working and we're ready to go.

Once I have it all working I'll push my layout modifications to a copy in my own repo and you can have a look!

@LisaFC
Copy link
Collaborator

LisaFC commented Jan 29, 2020

Nearly there, just have to stop the search results page showing up in the sidebar. I'll have something up later today.

@LisaFC
Copy link
Collaborator

LisaFC commented Jan 29, 2020

Annnnnnd finally! https://docsyjustdocs.netlify.com/

Repo is here: https://github.com/LisaFC/justdocs

Main differences are the overrides in layouts/, a much cut-down content/en/ with just our docs/ sections, and the search results page (search.md) has a nomenu page param so we can hide it from the menu (might be a useful feature for other sites who want to hide pages?)

Hope you find it useful! I can share it on the mailing list and see if anyone else would like to use it as a reference.

@aslafy-z
Copy link

Thank you @LisaFC, that's awesome!

@guiadco
Copy link
Author

guiadco commented Jan 29, 2020

This is perfect 👍 Really thanks for your help.

@shahidhk
Copy link

Thanks a lot @LisaFC!

@guiadco
Copy link
Author

guiadco commented Jan 31, 2020

I test on my documentation, and it work perfectly.

Becareful with the option sidebar_menu_compact:

  • keep it at value false

We could close the issue if you want @LisaFC

For better experience, if we could have an option like landing_page: true or false on the config.toml

@LisaFC
Copy link
Collaborator

LisaFC commented Feb 17, 2020

Glad it works for you! I'll close the issue for now, as I think switching the landing page on and off with a config flag would need significant refactoring (as I said, it changes the entire default layout and site hierarchy).

@LisaFC LisaFC closed this as completed Feb 17, 2020
@mojave27
Copy link

mojave27 commented Aug 4, 2020

@LisaFC Thank you so much for your efforts on this. Was fumbling around trying to make this work, and found this issue. Works great!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants