Skip to content
This repository has been archived by the owner on Oct 4, 2022. It is now read-only.

Commit

Permalink
Take page as default for rendering the snippet title.
Browse files Browse the repository at this point in the history
  • Loading branch information
omarreiss committed Nov 9, 2015
1 parent 20693e6 commit 1cf3e23
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 15 deletions.
8 changes: 3 additions & 5 deletions dist/yoast-seo.js
Original file line number Diff line number Diff line change
Expand Up @@ -2271,7 +2271,7 @@ YoastSEO.SnippetPreview = function( refObj ) {
this.unformattedText = {
snippet_cite: this.refObj.rawData.snippetCite || "",
snippet_meta: this.refObj.rawData.snippetMeta || "",
snippet_title: this.refObj.rawData.snippetTitle || ""
snippet_title: this.refObj.rawData.pageTitle || ""
};
this.init();
};
Expand Down Expand Up @@ -2309,10 +2309,8 @@ YoastSEO.SnippetPreview.prototype.htmlOutput = function() {
* @returns {String}
*/
YoastSEO.SnippetPreview.prototype.formatTitle = function() {
var title = this.refObj.rawData.snippetTitle;
if ( title === "" || typeof title === "undefined" ) {
title = this.refObj.rawData.pageTitle;
}
var title = this.refObj.rawData.pageTitle;

if ( title === "" || typeof title === "undefined" ) {
title = this.refObj.config.sampleText.title;
}
Expand Down
4 changes: 2 additions & 2 deletions dist/yoast-seo.min.js

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion example/example-scraper.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ YoastSEO.ExampleScraper.prototype.getData = function() {
baseUrl: this.getDataFromInput("baseUrl"),
url: this.getDataFromInput("url"),
pageTitle: this.getDataFromInput("title"),
snippetTitle: this.getDataFromInput("title"),
snippetMeta: this.getDataFromInput("meta"),
snippetCite: this.getDataFromInput("url")
};
Expand Down
2 changes: 1 addition & 1 deletion example/example-scraper.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion js/analyzer.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ YoastSEO = ( "undefined" === typeof YoastSEO ) ? {} : YoastSEO;
* @param {String} args.title The actual title of the page.
* @param {String} args.url The full URL that the page will be displayed on.
* @param {String} args.excerpt The page excerpt.
* @param {String} args.snippetTitle The title as displayed in the snippet preview.
* @param {String} args.snippetMeta The meta description as displayed in the snippet preview.
* @param {String} args.snippetCite The URL as displayed in the snippet preview.
*
Expand Down
8 changes: 3 additions & 5 deletions js/snippetPreview.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ YoastSEO.SnippetPreview = function( refObj ) {
this.unformattedText = {
snippet_cite: this.refObj.rawData.snippetCite || "",
snippet_meta: this.refObj.rawData.snippetMeta || "",
snippet_title: this.refObj.rawData.snippetTitle || ""
snippet_title: this.refObj.rawData.pageTitle || ""
};
this.init();
};
Expand Down Expand Up @@ -56,10 +56,8 @@ YoastSEO.SnippetPreview.prototype.htmlOutput = function() {
* @returns {String}
*/
YoastSEO.SnippetPreview.prototype.formatTitle = function() {
var title = this.refObj.rawData.snippetTitle;
if ( title === "" || typeof title === "undefined" ) {
title = this.refObj.rawData.pageTitle;
}
var title = this.refObj.rawData.pageTitle;

if ( title === "" || typeof title === "undefined" ) {
title = this.refObj.config.sampleText.title;
}
Expand Down

0 comments on commit 1cf3e23

Please sign in to comment.