Skip to content

Commit 5479f82

Browse files
authored
Merge pull request emilbaehr#9 from QYL/master
bug fix & add support for manually setting page title
2 parents 031e225 + cb3172d commit 5479f82

File tree

4 files changed

+14
-5
lines changed

4 files changed

+14
-5
lines changed

_config.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
#page title
2+
page_title : # Automatically populates with app name if not set and if iOS app ID is set. Otherwise enter manually.
3+
14
# App Info
25
ios_app_id : 1234793120 # Required. Enter iOS app ID to automatically populate name, price and icons (e.g. 718043190).
36

_includes/appstoreimages.html

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,12 @@
1818
// Set favicon
1919
$('link[rel="shortcut icon"]').attr("href", appInfo.artworkUrl512);
2020

21+
// Set page title using the iOS app ID if it is not set manually in _config.yml
22+
var $pageTitle = $(".pageTitle");
23+
if ($.trim($($pageTitle).text()).length == 0) {
24+
$($pageTitle).html(appInfo.trackName);
25+
}
26+
2127
// Set large app icon using the iOS app ID if it is not set manually in _config.yml
2228
var $appIconLarge = $(".appIconLarge");
2329
if (!$appIconLarge.attr('src')) {
@@ -44,9 +50,9 @@
4450
$($appPrice).html(appInfo.formattedPrice);
4551
}
4652

47-
// Set price using the iOS app ID if it is not set manually in _config.yml
53+
// Set App Store link using the iOS app ID if it is not set manually in _config.yml
4854
var $appStoreLink = $(".appStoreLink");
49-
if ($.trim($($appStoreLink).text()).length == 0) {
55+
if ($.trim($appStoreLink.attr('href')).length == 0) {
5056
$($appStoreLink).attr("href", appInfo.trackViewUrl);
5157
}
5258

_includes/head.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<meta name="viewport" content="width=device-width, initial-scale=1.0">
55
<base target="_blank">
66

7-
<title>{{ site.app_name }}</title>
7+
<title class="pageTitle">{{ site.page_title }}</title>
88
<meta name="description" content="{{ site.app_description }}">
99

1010
<link rel="shortcut icon" href="{{ site.app_icon }}">

_layouts/default.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,9 @@ <h2 class="appPrice">
5252
</div>
5353
<div class="downloadButtonsContainer">
5454
{% if site.playstore_link %}
55-
<a class="playStoreLink" href=""><img class="playStore" src="assets/playstore.png"></a>
55+
<a class="playStoreLink" href="{{site.playstore_link}}"><img class="playStore" src="assets/playstore.png"></a>
5656
{% endif %}
57-
<a class="appStoreLink" href=""><img class="appStore" src="assets/appstore.png"></a>
57+
<a class="appStoreLink" href="{{site.appstore_link}}"><img class="appStore" src="assets/appstore.png"></a>
5858
</div>
5959
</div>
6060
{% include features.html %}

0 commit comments

Comments
 (0)