-
Notifications
You must be signed in to change notification settings - Fork 0
Generate better page titles #538
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pages like Technical Highlights should also show their “path,” i.e. Technical Highlights | About | CanJS.
Right now I’m seeing “map | can-define | API Docs | CanJS” for can-define/map/map
. I think it should be “can-define/map/map | API Docs | CanJS”.
can-fixture
has “can-fixture | Data modeling | API Docs | CanJS” for its title, but the Store page has “Store | can-fixture | API Docs | CanJS” for its title. I think it should be “Store | can-fixture | Data modeling | API Docs | CanJS”.
Also, some of the code looks the same between the two files. Can it be refactored to share code?
templates/helpers.js
Outdated
@@ -2,6 +2,12 @@ var fs = require("fs"); | |||
var path = require("path"); | |||
var escapeHTML = require("escape-html"); | |||
var unescapeHTML = require("unescape-html"); | |||
var generateTitle = require("./generate-title"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When I npm run styles
, I get the error: Error: Cannot find module './generate-title'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My bad I wrote a shared code in a file and I removed it, because there's no need for it!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is fixed now
static/canjs.js
Outdated
// helpers | ||
var ucfirst = function (str) { | ||
return str.charAt(0).toUpperCase() + str.slice(1); | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this function need to be declared inside setDocTitle
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I put it there because is only used inside setDocTitle
function, Should I put it outside?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, otherwise a new function gets made every time setDocTitle
is called.
templates/helpers.js
Outdated
@@ -12,10 +17,10 @@ module.exports = function(docMap, options, getCurrent, helpers, OtherHandlebars) | |||
"makeSignature": function(code){ | |||
|
|||
if(code){ | |||
return escapeHTML(code); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this file indented with spaces? I think it should be indented with tabs.
templates/helpers.js
Outdated
var groupGrandParent = docMap[groupParent.parent]; | ||
var groupGrandParentParent = docMap[groupGrandParent.parent]; | ||
if (!groupGrandParentParent) { | ||
// the "API Docs" as parent is missing in some pages, can-connect |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this working around an issue that should be fixed in the docs?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I think so.
d4ebce4
to
5907bf8
Compare
Fixes bit-docs/bit-docs-generate-html#44