MCPcopy
hub / github.com/jaredly/hexo-admin / getSettings

Function getSettings

api.js:37–49  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

35 // reads admin panel settings from _admin-config.yml
36 // or writes it if it does not exist
37 function getSettings() {
38 var path = hexo.base_dir + '_admin-config.yml'
39 if (!fs.existsSync(path)) {
40 hexo.log.d('admin config not found, creating one')
41 fs.writeFile(hexo.base_dir+'_admin-config.yml', '')
42 return {}
43 } else {
44 var settings = yml.safeLoad(fs.readFileSync(path))
45
46 if (!settings) return {}
47 return settings
48 }
49 }
50
51 function remove(id, body, res) {
52 var post = hexo.model('Post').get(id)

Callers 1

api.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected