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

change home page to posts page #965

Open
olpalu opened this issue Sep 1, 2024 · 7 comments
Open

change home page to posts page #965

olpalu opened this issue Sep 1, 2024 · 7 comments

Comments

@olpalu
Copy link

olpalu commented Sep 1, 2024

Question

is it possible to change the main section in the website to be posts page instead of the actual home page ?
meaning when I open my website home page it shows the posts.

@olpalu
Copy link
Author

olpalu commented Sep 2, 2024

@hossainemruz please reply, is it possible to change the home page to become the posts page, or should I make a changes inside the theme source code ? in that case, what should I change exactly.
thank you

@hossainemruz
Copy link
Member

Unfortunately, not possible currently. You have to fork the theme and make some change to do that.

@olpalu
Copy link
Author

olpalu commented Sep 2, 2024

what changes should I apply in the theme ? @hossainemruz

@hossainemruz
Copy link
Member

Not sure yet. I have to check. I am afraid I won't have time before the weekend.

@BernatBC
Copy link
Contributor

BernatBC commented Sep 6, 2024

Hi @olpalu,

I found a solution (it's not clean, and there are some tweaks needed), but basically I did a brute force solution to place the posts html to index.html. I created a branch with these changes: https://github.com/BernatBC/toha/tree/testing.

There's probably a cleaner way to do it, but at least works.
Some of the tweaks that are missing in my branch:

  • Remove unneeded sections in navbar (you can exclude them by setting hideFromNavbar: true in each section). Probably you won't need to do this, as you won't configure them)
  • /posts will still be usable, and most of the posts buttons will redirect them to /posts

If you need more help, just keep in touch with us

@hossainemruz
Copy link
Member

I was wondering if it possible to redirect using URL overwrite. That would require least amount of change.

@joyao
Copy link
Member

joyao commented Sep 8, 2024

Without a lot of code changes, the most reliable method is to use a rewrite or reverse proxy in the operation field. (ex. Apache, Nginx ...)
In development, the minimal change would be to redirect the root URL in the index.html file, but this is not a reliable approach.

let isRoot = location.pathname == "/";
if (isRoot === true && location.hash.length === 0) {
    window.location.replace("./posts");
}

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

4 participants