From 83d047c0bac3c3a964802bca78086e9d2315c17b Mon Sep 17 00:00:00 2001 From: Jakob Gillich Date: Thu, 21 Nov 2013 19:44:18 +0100 Subject: [PATCH] Add Customisable Permalinks --- core/client/models/settings.js | 8 ++++++-- core/client/tpl/settings/general.hbs | 9 ++++++++- core/client/views/settings.js | 6 ++++-- core/server/controllers/frontend.js | 2 +- core/server/data/default-settings.json | 8 ++++++++ core/server/helpers/index.js | 17 +++++++++++++++-- core/server/routes/frontend.js | 9 ++++++--- core/test/unit/server_helpers_index_spec.js | 4 ++-- core/test/utils/api.js | 2 +- 9 files changed, 51 insertions(+), 14 deletions(-) diff --git a/core/client/models/settings.js b/core/client/models/settings.js index 738cda7500..82f1dc1212 100644 --- a/core/client/models/settings.js +++ b/core/client/models/settings.js @@ -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; + } }); -}()); \ No newline at end of file +}()); diff --git a/core/client/tpl/settings/general.hbs b/core/client/tpl/settings/general.hbs index 154bf56776..f90b762a49 100644 --- a/core/client/tpl/settings/general.hbs +++ b/core/client/tpl/settings/general.hbs @@ -54,6 +54,13 @@

How many posts should be displayed on each page

+
+ + + +

Include date in your post's links

+
+