Comments (3)
It should be possible to implement multiple pages, I might make a PR some time for it. We just have to make an array with all the elements, separated by pages in ./data/index.ts.
from destack.
@JcdeA I've been thinking about multiple pages and came to two possible implementations. Here are my thoughts on the two possibilities and a possible way to get it done!
Possible Solutions
- Have multiple json files in the data folder.
Structure:
- data/default.json
- data/contact.json
- data/blog/first-post.json OR data/blog-first-post.json
👍 Backwards compatible
👍 Possibly easier to implement (not have to rewrite the JSON file each time a different page is changed)
👍 More close to what we have atm
- Have a single json file as we do now but instead of having an object to have an array. In that case each element in the array would represent a page.
Structure:
- data/default.json
👍 Less files to commit in git
Implementation (Solution 1)
- We can get the pathname from the router and send it with handleEvents to handle function (so it knows where to save each page).
- At that point we can parse the
pathname
and save the page to that path eg. pathname =blog/first-post
will save to afirst-blog.json
in folder nameblog
(or to ablog-first-blog.json
file) - We will have to change loadTemplate a little to account for multiple files.
- Lastly, we will need to support multiple files in getStaticProps so we have the props available when the site is statically built for production!
Note: An open question is what to do with dynamic-routes.
from destack.
Note: An open question is what to do with dynamic-routes.
At that point we could just create a custom server. It'll make a lot of things easier, without trying to cater around next.js's implementation.
We could also provide some kind of simple cli to handle installing & configuration automatically.
However, this probably isn't the best, since next's image optimization won't properly work. We could backport it, though.
from destack.
Related Issues (20)
- I want to create multi tenancy with page builder HOT 5
- How to deploy the project with editor HOT 2
- using destack as theming/theme builder for react/next site HOT 1
- Destack v3 - the road to simplicity
- How to Change Color of Components HOT 3
- RTL Support HOT 1
- Error when "next build" HOT 1
- Components are tough to edit HOT 6
- Editor selection font color issue HOT 1
- Drag and Drop multi slider in one page HOT 1
- Documentation HOT 1
- Unhandled Runtime Error HOT 1
- NextJS app router compatibility HOT 4
- path undefined error HOT 2
- Tailwind .text-transparent HOT 1
- Enable custom HTML markup HOT 2
- Vue3 support HOT 3
- Nextjs build can't show the page HOT 12
- Editor standalone use HOT 2
- Destack Not working for latest Next.js HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from destack.