-
Notifications
You must be signed in to change notification settings - Fork 1
/
SiteConfig.groovy
136 lines (121 loc) · 3.79 KB
/
SiteConfig.groovy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
import com.sysgears.theme.ResourceMapper
import com.sysgears.theme.deploy.GHPagesDeployer
import com.sysgears.theme.taglib.OctopressTagLib
import com.sysgears.theme.taglib.ThemeTagLib
Locale.setDefault(new Locale("el","GR"))
// Resource mapper and tag libs.
resource_mapper = new ResourceMapper(site).map
tag_libs = [ThemeTagLib, OctopressTagLib]
excludes += ['/_[^/]*/.*'] // excludes directories that start from '_'
base_dir = System.getProperty('user.dir')
theme_dir = "${base_dir}/theme"
features {
highlight = 'pygments' // 'none', 'pygments'
compass = 'auto'
markdown = 'txtmark' // 'txtmark', 'pegdown'
}
environments {
dev {
log.info 'Development environment is used'
url = "http://localhost:${jetty_port}"
show_unpublished = true
}
prod {
log.info 'Production environment is used'
url = 'https://thanosfisherman.github.io' // site URL, for example http://www.example.com
show_unpublished = false
features {
minify_xml = true
minify_html = true
minify_js = true
minify_css = true
}
}
cmd {
features {
compass = 'none'
highlight = 'none'
}
}
}
python {
interpreter = 'jython' // 'auto', 'python', 'jython'
//cmd_candidates = ['python2', 'python', 'python2.7']
//setup_tools = '2.1'
}
ruby {
interpreter = 'jruby' // 'auto', 'ruby', 'jruby'
//cmd_candidates = ['ruby', 'ruby1.8.7', 'ruby1.9.3', 'user.home/.rvm/bin/ruby']
//ruby_gems = '2.2.2'
}
// Site configuration.
posts_base_url = '/posts/' // the base url for blog entries
// Deployment settings.
s3_bucket = '' // your S3 bucket name
deploy_s3 = "s3cmd sync --acl-public --reduced-redundancy ${destination_dir}/ s3://${s3_bucket}/"
gh_pages_url = '[email protected]:ThanosFisherman/thanosfisherman.github.io.git' // path to GitHub repository in format [email protected]:{username}/{repo}.git
deploy = new GHPagesDeployer(site).deploy
title = "Development adventures"
logo = '/images/mainimage.jpg'
avatar = '/images/myavatar.jpg'
firstName = 'Thanos'
lastName = 'Psaridis'
siteName = 'thanosfisherman'
author = firstName + " " + lastName
description = 'A blog mostly about my Android programming experience as well as other tools I encounter through time'
social {
twitter_username = 'thanosfisherman'
facebook_username = 'ThanosFisherman'
disqus_username = 'thanosfisherman'
}
// RSS feed.
rss {
feed = 'atom.xml' // url to blog RSS feed
email = '' // email address for the RSS feed
post_count = 5 // the number of posts in the RSS feed
}
// Blog and Archive.
posts_per_blog_page = 3 // the number of posts to display per blog page
posts_per_archive_page = 6 // the number of posts to display per archive page
// Custom commands-line commands.
commands = [
/*
* Creates new page.
*
* location - relative path to the new page, should start with the /, i.e. /pages/index.html.
* pageTitle - new page title
*/
'create-page': { String location, String pageTitle ->
file = new File(content_dir, location)
file.parentFile.mkdirs()
file.exists() || file.write("""---
layout: default
title: "${pageTitle}"
published: true
---
""")
},
/*
* Creates new post.
*
* title - new post title
*/
'create-post': { String postTitle ->
def date = new Date()
def fileDate = date.format("yyyy-MM-dd")
def filename = fileDate + "-" + postTitle.encodeAsSlug() + ".markdown"
def blogDir = new File(content_dir + "${posts_base_url}")
if (!blogDir.exists()) {
blogDir.mkdirs()
}
def file = new File(blogDir, filename)
file.exists() || file.write("""---
layout: post
title: "${postTitle}"
image:
date: "${date.format(datetime_format)}"
published: true
---
""")
},
]