mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-05 18:34:39 +03:00
Merge pull request #1533 from jgillich/permalinks
Add Customisable Permalinks
This commit is contained in:
commit
5ec7a95d54
@ -4,7 +4,11 @@
|
||||
//id:0 is used to issue PUT requests
|
||||
Ghost.Models.Settings = Ghost.ProgressModel.extend({
|
||||
url: Ghost.settings.apiRoot + '/settings/?type=blog,theme',
|
||||
id: '0'
|
||||
id: '0',
|
||||
parse: function (resp) {
|
||||
resp.permalinks = resp.permalinks === "/:slug/" ? "" : "1";
|
||||
return resp;
|
||||
}
|
||||
});
|
||||
|
||||
}());
|
||||
}());
|
||||
|
@ -54,6 +54,13 @@
|
||||
<p>How many posts should be displayed on each page</p>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="permalinks">Dated Permalinks</label>
|
||||
<input id="permalinks" name="general[permalinks]" type="checkbox" value="1" {{#if permalinks}}checked{{/if}}>
|
||||
<label class="checkbox" for="permalinks"></label>
|
||||
<p>Include date in your post's links</p>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="activeTheme">Theme</label>
|
||||
<select id="activeTheme" name="general[activeTheme]">
|
||||
@ -66,4 +73,4 @@
|
||||
|
||||
</fieldset>
|
||||
</form>
|
||||
</section>
|
||||
</section>
|
||||
|
@ -157,7 +157,8 @@
|
||||
title = this.$('#blog-title').val(),
|
||||
description = this.$('#blog-description').val(),
|
||||
email = this.$('#email-address').val(),
|
||||
postsPerPage = this.$('#postsPerPage').val();
|
||||
postsPerPage = this.$('#postsPerPage').val(),
|
||||
permalinks = this.$('#permalinks').is(':checked') ? "/:year/:month/:day/:slug/" : "/:slug/";
|
||||
|
||||
Ghost.Validate._errors = [];
|
||||
Ghost.Validate
|
||||
@ -185,7 +186,8 @@
|
||||
description: description,
|
||||
email: email,
|
||||
postsPerPage: postsPerPage,
|
||||
activeTheme: this.$('#activeTheme').val()
|
||||
activeTheme: this.$('#activeTheme').val(),
|
||||
permalinks: permalinks
|
||||
}, {
|
||||
success: this.saveSuccess,
|
||||
error: this.saveError
|
||||
|
Loading…
Reference in New Issue
Block a user