Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
content
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Monitor
Service Desk
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ok1kvk.cz
content
Commits
83dab11b
Verified
Commit
83dab11b
authored
9 years ago
by
Isabella Skořepová
Browse files
Options
Downloads
Patches
Plain Diff
Allow to select static and content dir
parent
30a00925
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
index.js
+5
-5
5 additions, 5 deletions
index.js
sitegin/config.js
+17
-8
17 additions, 8 deletions
sitegin/config.js
upload
+1
-13
1 addition, 13 deletions
upload
with
23 additions
and
26 deletions
index.js
+
5
−
5
View file @
83dab11b
...
...
@@ -62,7 +62,7 @@ var sitegin = function(config) {
console
.
log
(
'
Sitegin successfully loaded
'
);
run
();
copyStaticFiles
(
config
.
builddir
);
copyStaticFiles
(
config
.
builddir
,
config
.
staticDir
);
rendersass
(
config
.
builddir
);
if
(
!
options
.
noserver
)
{
...
...
@@ -82,7 +82,7 @@ var sitegin = function(config) {
var
chokidar
=
require
(
'
chokidar
'
);
// article or theme reload
chokidar
.
watch
([
'
con
tent/
'
,
'
theme/
'
],
{
ignoreInitial
:
true
})
chokidar
.
watch
([
con
fig
.
sourceDir
,
'
theme/
'
],
{
ignoreInitial
:
true
})
.
on
(
'
all
'
,
function
(
event
,
path
)
{
console
.
log
(
'
Content or theme changed. Rebuilding...
'
);
run
();
...
...
@@ -101,17 +101,17 @@ var sitegin = function(config) {
});
}
var
copyStaticFiles
=
function
(
builddir
)
{
var
copyStaticFiles
=
function
(
builddir
,
staticdir
)
{
// STATIC FILES
var
fsextra
=
require
(
'
node-fs-extra
'
);
fsextra
.
copy
(
'
static
'
,
static
dir
,
builddir
,
function
(
file
){
return
!
(
file
.
match
(
'
.git
'
)
||
file
.
match
(
'
static/articles
'
));
},
function
(){
console
.
log
(
'
copy static done
'
);}
);
fsextra
.
copy
(
'
static/articles
'
,
static
dir
+
'
/articles
'
,
builddir
+
'
/clanek
'
,
function
(){
console
.
log
(
'
copy static/articles done
'
);}
);
...
...
This diff is collapsed.
Click to expand it.
sitegin/config.js
+
17
−
8
View file @
83dab11b
...
...
@@ -5,13 +5,18 @@
* (or write config reader which would replace this file - I'd appreciate
* merge request for this feature ;) )
*/
var
Git
=
require
(
'
nodegit
'
);
var
cli
=
require
(
'
cli
'
);
var
options
=
cli
.
parse
({
noserver
:
[
'
n
'
,
'
Dont run server
'
],
port
:
[
'
p
'
,
'
Port on which server should run
'
,
'
number
'
,
1337
],
uiport
:
[
null
,
'
BrowserSync UI port
'
,
'
number
'
,
'
port+1
'
],
httpsonly
:
[
null
,
'
Converts all http://ok1kvk.cz links to https
'
],
httponly
:
[
null
,
'
Converts all https://ok1kvk.cz links to http
'
]
httponly
:
[
null
,
'
Converts all https://ok1kvk.cz links to http
'
],
contentdir
:
[
null
,
'
Allows to specify arbitrary content directory.
'
+
'
Can also be http(s) url to zip file.
'
,
'
string
'
,
'
content
'
],
staticdir
:
[
null
,
'
Allows to specify arbitrary directory for static files.
'
+
'
Can also be http(s) url to zip file.
'
,
'
string
'
,
'
static
'
]
});
module
.
exports
=
function
()
{
...
...
@@ -22,14 +27,18 @@ module.exports = function() {
options
.
uiport
=
options
.
port
+
1
;
}
return
Promise
.
resolve
({
config
:
{
options
:
options
,
builddir
:
builddir
,
sourceDir
:
'
content
'
,
articlesLocation
:
'
articles
'
,
linksPerPage
:
6
return
new
Promise
(
function
(
resolve
,
reject
){
function
doResolve
()
{
resolve
({
config
:
{
options
:
options
,
builddir
:
builddir
,
sourceDir
:
options
.
contentdir
,
staticDir
:
options
.
staticdir
,
articlesLocation
:
'
articles
'
,
linksPerPage
:
6
}});
}
doResolve
();
})
}
module
.
exports
.
watch
=
!
options
.
noserver
;
This diff is collapsed.
Click to expand it.
upload
+
1
−
13
View file @
83dab11b
...
...
@@ -5,18 +5,6 @@ then
read -s LFTP_PASSWORD; export LFTP_PASSWORD
fi
rm -rf build
mkdir -p build/theme
time node index.js --noserver
RET=$?
echo "Site compilation ended with status code $RET"
if [ $RET -ne 0 ]
then
echo "Error detected. Exitting."
exit 1
fi
chmod a+X build -R
USER=ok1kvk.cz-www-nove
HOST=krios.blueboard.cz
MAX_RETRIES=2
...
...
@@ -49,5 +37,5 @@ else
RET=$?
echo "LFTP finished with return code $RET"
fi
exit
$RET
exit
0
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment