Skip to content

Commit

Permalink
refactoring: templates
Browse files Browse the repository at this point in the history
  • Loading branch information
gregorybesson committed Oct 3, 2016
1 parent a10c333 commit e8fa11e
Show file tree
Hide file tree
Showing 11 changed files with 10 additions and 174 deletions.
1 change: 0 additions & 1 deletion package.json
Expand Up @@ -75,7 +75,6 @@
"prettyjson": "^1.1.3",
"prompt": "^1.0.0",
"qs": "^6.0.1",
"redis": "^2.6.2",
"request": "^2.69.0",
"watch": "^0.19.2",
"xss": "^0.2.10"
Expand Down
2 changes: 1 addition & 1 deletion src/cli/Create.js → src/cli/cms/Create.js
Expand Up @@ -4,7 +4,7 @@ import slug from 'limax'

import {
config
} from './'
} from '../'

export default class Create {

Expand Down
File renamed without changes.
Expand Up @@ -13,7 +13,7 @@ import {
Hooks,
removeDuplicateAttr,
Manager
} from '../../cli'
} from '../../'

var traverseFileSystem = function (currentPath, arr) {
var res = []
Expand Down
Expand Up @@ -11,7 +11,7 @@ import {
,escapeTextToRegex
,Hooks
,Plugins
} from '../../cli'
} from '../../'

export function addOrder(text) {
var regAbe = /{{abe[\S\s].*?key=['|"]([\S\s].*?['|"| ]}})/g
Expand Down
7 changes: 1 addition & 6 deletions src/cli/core/config/config.json
Expand Up @@ -96,10 +96,5 @@
"partials": "templates/partials",
"custom": "custom",
"siteUrl": false,
"sitePort": false,
"redis": {
"enable": false,
"port": "6379",
"host":"127.0.0.1"
}
"sitePort": false
}
133 changes: 0 additions & 133 deletions src/cli/helpers/abe-config.js

This file was deleted.

8 changes: 4 additions & 4 deletions src/cli/index.js
Expand Up @@ -34,7 +34,7 @@ import {
} from './cms/editor/index'

import Manager from './core/manager/Manager'
import Page from './models/Page'
import Page from './cms/Page'

import {dateSlug, dateUnslug} from './core/utils/abe-date'
import Locales from './core/utils/abe-locales'
Expand All @@ -44,8 +44,8 @@ import folderUtils from './core/utils/folder-utils'
import slugify from './core/utils/slugify'
import {cleanSlug} from './core/utils/slugify'

import {getTemplate} from './helpers/abe-template'
import Create from './Create'
import {getTemplate} from './cms/templates/abe-template'
import Create from './cms/Create'

import config from './core/config/config'

Expand All @@ -62,7 +62,7 @@ import Hooks from './extend/abe-hooks'
import Plugins from './extend/abe-plugins'


import getSelectTemplateKeys from './helpers/abe-get-select-template-keys'
import getSelectTemplateKeys from './cms/templates/abe-get-select-template-keys'

export {
fileAttr
Expand Down
19 changes: 0 additions & 19 deletions src/cli/services/RedisClient.js

This file was deleted.

6 changes: 0 additions & 6 deletions src/server/app.js
Expand Up @@ -40,8 +40,6 @@ import {
middleWebsite,
} from './middlewares'

import * as redis from '../cli/services/RedisClient'

var abePort = null

if(process.env.ROOT) config.set({root: process.env.ROOT.replace(/\/$/, '') + '/'})
Expand Down Expand Up @@ -81,10 +79,6 @@ if (fileUtils.isFile(path.join(config.root, 'cert.pem'))) {
}

var app = express(opts)

if(config.redis.enable){
redis.connect(config.redis.port, config.redis.host)
}

// Instantiate Singleton Manager (which lists all blog files)
Manager.instance.init()
Expand Down
4 changes: 2 additions & 2 deletions test/template.js
Expand Up @@ -4,8 +4,8 @@ var config = require('../src/cli').config
config.set({root: __dirname + '/fixtures'})

var getTemplate = require('../src/cli').getTemplate
var includePartials = require('../src/cli/helpers/abe-template').includePartials
var getAbeImport = require('../src/cli/helpers/abe-template').getAbeImport
var includePartials = require('../src/cli/cms/templates/abe-template').includePartials
var getAbeImport = require('../src/cli/cms/templates/abe-template').getAbeImport
var Manager = require('../src/cli').Manager;
var fse = require('fs-extra');

Expand Down

0 comments on commit e8fa11e

Please sign in to comment.