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
e4093d38
Commit
e4093d38
authored
9 years ago
by
Isabella Skořepová
Browse files
Options
Downloads
Patches
Plain Diff
Make it work on windows
parent
44491ca1
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
README.md
+19
-0
19 additions, 0 deletions
README.md
sitegin/input-hugo.js
+1
-2
1 addition, 2 deletions
sitegin/input-hugo.js
sitegin/transformer-git.js
+9
-10
9 additions, 10 deletions
sitegin/transformer-git.js
with
29 additions
and
12 deletions
README.md
+
19
−
0
View file @
e4093d38
Tento software pro psaní článků NENÍ nutné instalovat.
Články můžete psát přímo z
[
webového rozhraní
](
https://git.ok1kvk.cz/ok1kvk.cz/content
)
# Jak to zprovoznit na fedoře
# Přidat repozitář nodejs - ve fedoře je verze 0.10.x
...
...
@@ -5,3 +7,20 @@
sudo dnf -y install nodejs git
./configure.sh
node index.js
# Jak to zprovoznit na windows
*
Budeme potřebovat
[
git
](
https://git-scm.com/download/win
)
*
Dále budeme potřebovat
[
nodejs
](
https://nodejs.org/en/
)
- stáhněte si tu verzi,
na které je nápis LTS.
*
U obou nástrojů silně doporučuji neměnit žádná nastavení!
Po instalaci obou věcí přejděte do nějaké složky pomocí průzkumníka a klikněte na
`git bash`
. Pak napište následující:
git clone https://git.ok1kvk.cz/ok1kvk.cz/generator.git
cd generator
bash configure.sh
node index.js
Nyní otevřete prohlížeč a přejděte na
[
localhost:1337
](
http://localhost:1337
)
This diff is collapsed.
Click to expand it.
sitegin/input-hugo.js
+
1
−
2
View file @
e4093d38
...
...
@@ -37,7 +37,7 @@ var readPageWorker = function(file, articleName, contentDir) {
obj
.
file
=
articleName
.
replace
(
"
articles
"
,
"
clanek
"
);
obj
.
content
=
file
.
substring
(
fm_end
+
4
);
try
{
obj
.
metadata
=
toml
.
parse
(
file
.
substring
(
0
,
fm_end
-
1
));
obj
.
metadata
=
toml
.
parse
(
file
.
substring
(
0
,
fm_end
-
1
)
+
"
\n
"
);
}
catch
(
e
)
{
console
.
log
(
articleName
+
"
: Failed to parse metadata
"
);
throw
e
;
...
...
@@ -117,4 +117,3 @@ module.exports = function(_contentDir) {
});
};
}
This diff is collapsed.
Click to expand it.
sitegin/transformer-git.js
+
9
−
10
View file @
e4093d38
...
...
@@ -60,13 +60,13 @@ var getFilesHistory = function() {
diffs
.
forEach
(
function
(
data
)
{
var
commit
=
data
[
1
];
var
diff
=
data
[
0
];
diff
.
forEach
(
function
(
entry
)
{
var
p
ath
=
entry
.
newFile
().
path
();
if
(
filehistory
[
p
ath
]
===
undefined
)
{
filehistory
[
p
ath
]
=
[];
var
p
=
path
.
normalize
(
entry
.
newFile
().
path
()
)
;
if
(
filehistory
[
p
]
===
undefined
)
{
filehistory
[
p
]
=
[];
}
filehistory
[
p
ath
].
push
(
commit
);
filehistory
[
p
].
push
(
commit
);
});
});
return
filehistory
;
...
...
@@ -76,7 +76,7 @@ var getFilesHistory = function() {
module
.
exports
=
function
()
{
var
tr
=
this
;
tr
.
fancyname
=
"
transformer git
"
;
tr
.
pre
=
function
(
cb
,
articleList
)
{
getFilesHistory
()
.
then
((
filesHistory
)
=>
{
...
...
@@ -90,7 +90,7 @@ module.exports = function() {
if
(
commits
!==
undefined
)
{
var
newestCommit
=
commits
[
0
];
var
oldestCommit
=
commits
[
commits
.
length
-
1
];
if
(
article
.
metadata
.
date
==
undefined
)
article
.
metadata
.
date
=
{};
...
...
@@ -109,16 +109,15 @@ module.exports = function() {
article
.
commits
=
commits
;
}
todo
--
;
if
(
todo
==
0
)
cb
();
});
})
.
catch
(
function
(
err
)
{
console
.
log
(
err
.
stack
);});
}
tr
.
forEachPage
=
function
(
article
,
cb
)
{
cb
();
}
}
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