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

Routing problem #46

Closed
lightdiscord opened this issue Jun 15, 2018 · 6 comments
Closed

Routing problem #46

lightdiscord opened this issue Jun 15, 2018 · 6 comments

Comments

@lightdiscord
Copy link

lightdiscord commented Jun 15, 2018

Bug Report

Describe the bug

Routes are active only for the current session. If someone shares the link to one of the pages in the documentation (or even reload the page), they will come across a 404 page.

To Reproduce

  1. Go to your documentation.
  2. Click on a new section.
  3. You'll get a root like domain.com/section
  4. Access this url on a new tab

Expected behavior

Access the shared page

2018-06-15_11 56 11

@renatorib
Copy link
Contributor

Github Pages do not support SPA.
You can take a look here https://github.com/rafrex/spa-github-pages/blob/gh-pages/README.md

@adrianoresende
Copy link

adrianoresende commented May 26, 2019

I have the same error, but I deployed on Netlify.
This error happens with Surge.sh too

My configuration:

export default {
  title: 'Docz',
  description: 'This is my awesome documentation',
  menu: [
    'Bem vindo',
    'Princípios de design',
    {
      name: 'Estilos',
      menu: [
        'Cores',
        'Tipografias',
      ],
    },
    {
      name: 'Componentes',
      menu: [
        'Botão',
      ],
    },
    'Marketing',
    'Produto',
    'Recursos',
    'FAQ',
  ],
  src: './src',
  public: './src/public',
  plugins: [],
  theme: 'docz-theme-default',
  themeConfig: {
    logo: {
      src: '/public/imgs/logo.svg',
      width: '100%',
    },
    colors: {
      primary: '#4967a9',
    },
  },
  htmlContext: {
    favicon: '/public/favicon.png',
  },
}

What's the solution?

@adrianoresende
Copy link

@renatorib @pedronauck

tpucci added a commit to tpucci/docz-website that referenced this issue Jun 4, 2019
I added a final step in order to access all urls of the deployed site on Netlify.
It is required as Docz is a single page app.
This adresses doczjs/docz#46.
@tpucci
Copy link

tpucci commented Jun 4, 2019

@adrianoresende Deploying with Netlify, add this file at the root of your project. It should fix your issue:

# COMMENT: This a rule for Single Page Applications
[[redirects]]
  from = "/*"
  to = "/"
  status = 200

References:

@adrianoresende
Copy link

@tpucci Thanks! ;)

@fernandofleury
Copy link

Hey guys, if you want to support gh-pages still, there is a tiny workaround you can do:

https://github.com/sumup/circuit-ui/pull/437/files#diff-eae600270579316beb8b8d9b9a5732d4R4

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