Skip to content
This repository was archived by the owner on Aug 9, 2020. It is now read-only.

Conversation

@zsherman
Copy link

  • Adds support for order config
  • Properly order sidebar based on order
  • Passes frontmatter to links as data
  • Merge external and local config ordering

@zsherman zsherman changed the title Pass frontmatter to links Local and external ordering May 13, 2018
@coveralls
Copy link

coveralls commented May 13, 2018

Pull Request Test Coverage Report for Build 87

  • 11 of 46 (23.91%) changed or added relevant lines in 10 files are covered.
  • 4 unchanged lines in 4 files lost coverage.
  • Overall coverage decreased (-0.6%) to 23.077%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/cmds/serve.js 0 1 0.0%
src/core/syntax.js 1 2 50.0%
src/core/static.js 1 2 50.0%
src/utils/path.js 0 1 0.0%
src/core/externals.js 1 4 25.0%
src/core/index.js 2 6 33.33%
src/utils/config.js 3 8 37.5%
src/core/merge.js 2 9 22.22%
src/core/manifest.js 0 12 0.0%
Files with Coverage Reduction New Missed Lines %
src/core/externals.js 1 17.65%
src/core/static.js 1 18.75%
src/core/manifest.js 1 5.97%
src/core/index.js 1 38.89%
Totals Coverage Status
Change from base Build 76: -0.6%
Covered Lines: 155
Relevant Lines: 588

💛 - Coveralls

const bundleBar = progress({ clear: true, total: 100 })

log('Bundling the Javascript app')
log('[\u2713] Bundling the Javascript app')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure why we would show a checkmark before the operation actually completes. Also log will prefix all messages with "❯" already.

return warn(`No docs root found for ${s.name || 'source'}, skipping...`)
}

// Get external docs config, will be merged with cwd config
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This functionality should be extended from src/utils/config.js. There is already a _readConfigFile and _getConfigFilename that should be used, since they do a little more.

// this gets passed to the theme app
const props = {
config,
mergedConfig,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other files depend on props.config so the key name should stay the same here. Otherwise it will break a lot of stuff.


return isIndex ? {
indexLink: hydrated.url,
order: hydrated.order,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why does this need to be in the actual manifest? It should already be sorted by the time it gets passed to the theme app.

text: hydrated.title,
link: hydrated.url,
order: hydrated.order,
data: frontMatter
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also not sure why you need to pass all the front matter to the nav tree. It already exists in the files part of the manifest, we shouldn't duplicate it. I can give more insight on this decision.


// Combine and sort local and external nav trees
const navtree = [...navtreeLocal, ...navtreeExternal]
.sort((a, b) => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why does it get sorted twice? Once here and once on line 138.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The first is only sorting children, not the top level folders—I abstracted it out into a single sorting function.

const syspath = require('path')
const chokidar = require('chokidar')
const { namespaces } = require('../utils/temp')
const log = require('../utils/emit')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should be const { log } = require('../utils/emit')

@zsherman zsherman merged commit 89d2003 into master May 14, 2018
@zsherman zsherman deleted the enhancement/pass-frontmatter-to-links branch May 14, 2018 21:58
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants