Skip to content

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

Merged
merged 2 commits into from
Jun 19, 2019
Merged

Generate better page titles #538

merged 2 commits into from
Jun 19, 2019

Conversation

cherifGsoul
Copy link
Member

@cherifGsoul cherifGsoul requested a review from chasenlehara June 9, 2019 20:47
Copy link
Member

@chasenlehara chasenlehara left a 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?

@cherifGsoul cherifGsoul requested a review from chasenlehara June 12, 2019 15:45
@chasenlehara chasenlehara changed the title I44 better page titles Generate better page titles Jun 12, 2019
@@ -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");
Copy link
Member

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'

Copy link
Member Author

@cherifGsoul cherifGsoul Jun 13, 2019

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!

Copy link
Member Author

Choose a reason for hiding this comment

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

Is fixed now

@cherifGsoul cherifGsoul requested a review from chasenlehara June 13, 2019 12:33
static/canjs.js Outdated
// helpers
var ucfirst = function (str) {
return str.charAt(0).toUpperCase() + str.slice(1);
};
Copy link
Member

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?

Copy link
Member Author

@cherifGsoul cherifGsoul Jun 13, 2019

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?

Copy link
Member

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.

@@ -12,10 +17,10 @@ module.exports = function(docMap, options, getCurrent, helpers, OtherHandlebars)
"makeSignature": function(code){

if(code){
return escapeHTML(code);
Copy link
Member

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.

var groupGrandParent = docMap[groupParent.parent];
var groupGrandParentParent = docMap[groupGrandParent.parent];
if (!groupGrandParentParent) {
// the "API Docs" as parent is missing in some pages, can-connect
Copy link
Member

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?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah I think so.

@cherifGsoul cherifGsoul force-pushed the i44-better-page-titles branch from d4ebce4 to 5907bf8 Compare June 17, 2019 14:29
@cherifGsoul cherifGsoul requested a review from chasenlehara June 17, 2019 15:23
@chasenlehara chasenlehara merged commit 18d3a3a into master Jun 19, 2019
@chasenlehara chasenlehara deleted the i44-better-page-titles branch June 19, 2019 22:22
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

Successfully merging this pull request may close these issues.

Generate better page titles
2 participants