Skip to content

refactor(v2): use absolute path instead of alias for metadata source#967

Merged
endiliey merged 1 commit intofacebook:masterfrom
endiliey:v2-metadata-source
Sep 18, 2018
Merged

refactor(v2): use absolute path instead of alias for metadata source#967
endiliey merged 1 commit intofacebook:masterfrom
endiliey:v2-metadata-source

Conversation

@endiliey
Copy link
Contributor

@endiliey endiliey commented Sep 17, 2018

Motivation

Current metadata for docs in v2 form is like below:

const metadata = {
    id: 'en-permalink',
    title: 'Permalink',
    permalink: '/docs/en/endiliey/permalink',
    language: 'en',
    source:
      '@docs/permalink.md',
    localized_id: 'permalink',
}

This is because I use @docs alias in webpack, but I guess this could be confusing and extra aliasing work. Let's just use absolute import so the generated sstructure is like below:

const metadata = {
    id: 'en-permalink',
    title: 'Permalink',
    permalink: '/docs/en/endiliey/permalink',
    language: 'en',
    source:
      '/mnt/c/Users/endij/Desktop/Linux/Docusaurus/v2/test/__fixtures__/docs/permalink.md',
    localized_id: 'permalink',
  }

Extra: added stronger test for docs processing in v2

Have you read the Contributing Guidelines on pull requests?

Yes

Test Plan

cd v2
yarn
yarn start

All the docs still working including relative linking

@facebook-github-bot facebook-github-bot added the CLA Signed Signed Facebook CLA label Sep 17, 2018
@docusaurus-bot
Copy link
Contributor

Deploy preview for docusaurus-preview ready!

Built with commit e99a634

https://deploy-preview-967--docusaurus-preview.netlify.com

@endiliey endiliey changed the title refactor(v2): use absolute url instead of alias for metadata source refactor(v2): use absolute path instead of alias for metadata source Sep 18, 2018
@endiliey endiliey merged commit b401a2a into facebook:master Sep 18, 2018
@endiliey endiliey deleted the v2-metadata-source branch September 18, 2018 04:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed Signed Facebook CLA

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants