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

AJAX navigation #136

Open
Viiprogrammer opened this issue Aug 7, 2022 · 12 comments
Open

AJAX navigation #136

Viiprogrammer opened this issue Aug 7, 2022 · 12 comments

Comments

@Viiprogrammer
Copy link
Contributor

Is your feature request related to a problem? Please describe.

No

Describe the solution you'd like

Add AJAX navigation for menu / @link and other links

Additional context

It's a little more convenient than page reload transitions, and on mobile it's faster and a little more economical.

@ankitskvmdam
Copy link
Owner

@Viiprogrammer Could you explain this a little bit more?

@Viiprogrammer
Copy link
Contributor Author

With ajax navigation no page reload needed (when you click to the link it load content of page / page with fetch or XMLRequestHttp and insert getted HTML to current page HTML, after this push new url to browser history.

Examples of realization:

https://habr.com/ru/post/154617/ (available in Russian only :( )

https://stackoverflow.com/questions/2586661/url-navigation-in-an-ajax-based-website

https://developer.mozilla.org/en-US/docs/Web/API/History_API/Example

@ankitskvmdam
Copy link
Owner

Oh.. I think it is something like SPA (Single Page Application).

Do you have any opinion/recommendation on how to implement this?

@Viiprogrammer
Copy link
Contributor Author

Viiprogrammer commented Aug 9, 2022

yes, this technology was before spa and even now it is, where there is no spa, but unlike spa, it is usually there where ssr is used and it is easier to integrate it into any application, it is not necessary to rewrite it on spa

the only thing that is possible after «go to new page» with ajax is to call a couple of functions to initialize code highlighting and other things for the new HTML

@ankitskvmdam
Copy link
Owner

@Viiprogrammer does it mean that now we have to export files in .php, if so then it will change the overall workflow.

I have very limited (or no) knowledge of ajax navigation.

@Viiprogrammer
Copy link
Contributor Author

I thought to do it without a backend (without php, node...) because there is no need for a backend, it will greatly complicate life) and will not give any profit

maybe it has some other name besides ajax/pjax, but I never thought about it

@backspaces
Copy link

11ty may be what you're looking for?

@ankitskvmdam
Copy link
Owner

@backspaces @Viiprogrammer I am working on a new version of clean-jsdoc-theme in which I will use next js. Do you have any opinions?

I have created a repo to test the possibilities. https://github.com/ankitskvmdam/clean-jsdoc-next

@backspaces
Copy link

I don't use React so don't know it's advantages. 11ty is so dead simple yet quite powerful especially for multi page apps. Otoh if you are looking for ready made components, React may be a win,

@Viiprogrammer
Copy link
Contributor Author

@backspaces @Viiprogrammer I am working on a new version of clean-jsdoc-theme in which I will use next js. Do you have any opinions?

I have created a repo to test the possibilities. https://github.com/ankitskvmdam/clean-jsdoc-next

I was thinking about Vue / React options, but they have a problem in that they need SSR if you need to get Server side render and at the same time keep what SPA has.

Maybe It's possible to get both without actually rendering on the server side with Svelte
But I have never used Svelt and don't know for sure if there are any problems

@ankitskvmdam
Copy link
Owner

@backspaces I looking to directly port Nextra or something similar to this.

@Viiprogrammer There is an option in Next.JS to directly export all the static files.

The biggest advantage of using React is its ecosystem.

@Viiprogrammer
Copy link
Contributor Author

@backspaces I looking to directly port Nextra or something similar to this.

@Viiprogrammer There is an option in Next.JS to directly export all the static files.

The biggest advantage of using React is its ecosystem.

In any case, a pretty good idea, I think it would be cool

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

3 participants