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

New structure: theme/ and template/ #613

Closed
atinux opened this issue Aug 1, 2022 — with Volta.net · 9 comments · Fixed by #614
Closed

New structure: theme/ and template/ #613

atinux opened this issue Aug 1, 2022 — with Volta.net · 9 comments · Fixed by #614
Assignees
Labels
enhancement New feature or request

Comments

Copy link
Contributor

atinux commented Aug 1, 2022

This will also fix the deployment, the docs of docus is Docus.

@atinux atinux added the enhancement New feature or request label Aug 1, 2022 — with Volta.net
@atinux atinux changed the title Move docs to content/ Move docs/ to content/ Aug 1, 2022
Copy link
Collaborator

@atinux
Taking a step back, it doesn't look right 🤔
What we want is to have the docs folder deployed. Not merging everything together I guess.
It makes sense that /docs/nuxt.config.ts extends: ['../'] and the root content/ only has an index.md as a starter/template. Docs is a playground of the root project.
Still doing it but with some reflexion it looks wrong.

Copy link
Collaborator

And what about docus.dev?

Copy link
Contributor Author

atinux commented Aug 2, 2022

Docus.dev is the demo and documentation of using the theme.

But I agree, we need to discuss about this like @pi0 mentioned in #616

I suggest:

.github/
theme/
  app/
  components/
  composables/
  layouts/
  plugins/
  utils/
  theme.config.ts
  tokens.config.ts
  nuxt.config.ts
template/
  content/
  theme.config.ts
  tokens.config.ts
  nuxt.config.ts # extends: '@nuxt-themes/docus'
.gitignore
.editorconfig
.eslintrc
README.md
package.json

The package.json at root could handle the resolutions for the template/ to work without publishing the package (example on https://github.com/danielroe/nuxt-ionic/blob/main/package.json#L92-L94)

Happy to know your thoughts about this structure @pi0 @danielroe

@pi0
Copy link
Contributor

pi0 commented Aug 2, 2022

I like the structure and namings for theme/ and template/!

To handle resolutions, i suggest to opt for native esm feature by setting type: 'module' this way you can refernece to package name without depending on pm (yarn/pnpm/npm) feature.

Sandbox: https://stackblitz.com/edit/github-bcbjjq

Copy link
Contributor Author

atinux commented Aug 2, 2022

Awesome! Thanks for helping @pi0

@smarroufin renaming the issue for this new structure, good for you to update the PR as well?

@atinux atinux changed the title Move docs/ to content/ New structure: theme/ and template/ Aug 2, 2022
Copy link
Collaborator

@atinux I guess there will be some things to replug vercel side so it deploys the docs correctly.
Also I think there is no more interest in deploying /theme because it does not contain any pages. Only /template (docs) should be deployed, right?

@pi0
Copy link
Contributor

pi0 commented Aug 3, 2022

On second thoughts, if i may have a suggestion, themes could have /example or /demo instead of /template. I'm thinking of more elegant way with nuxi init --theme docus so that some boilerplate can be removed and demo can include some beautiful prefilled content to be deployed with.

Also note that solution i suggested with type: module cannot work if template/package.json exists.

Copy link
Contributor Author

atinux commented Aug 13, 2022

The idea of nuxi init --theme docus is that it will actually copy only the template/ directory that already includes beautiful pre-filled content to be deployed with.

We have to try but I think it works even if we have template/package.json.

Will push on Alpine to avoid breaking docus edge releases.

Copy link
Contributor Author

atinux commented Aug 13, 2022

Just pushed the new structure: https://github.com/nuxt-themes/alpine

It's working well, see online playground: https://stackblitz.com/edit/nuxt-starter-vjbzvt?file=content%2Findex.md

@atinux atinux mentioned this issue Aug 26, 2022
7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants