Skip to content

Commit c5e6e03

Browse files
committed
Generate site using Jekyll via Docker
This makes site-building process more stable and less dependent on the environment, requiring only Docker to be installed locally.
1 parent c526c3f commit c5e6e03

File tree

5 files changed

+15
-84
lines changed

5 files changed

+15
-84
lines changed

gradle.properties

+3
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,6 @@ source_map_support_version=0.5.3
3030
# Settings
3131
kotlin.incremental.multiplatform=true
3232
kotlin.native.ignoreDisabledTargets=true
33+
34+
# Site deneration
35+
jekyll_version=4.0

site/build.gradle

+12-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
*/
44

55
def buildDocsDir = "$buildDir/docs"
6+
def jekyllDockerImage = "jekyll/jekyll:$jekyll_version"
67

78
task copyDocs(type: Copy, dependsOn: rootProject.getTasksByName("dokka", true)) {
89
from (rootProject.getTasksByName("dokka", true).collect { "$it.project.buildDir/dokka" }) {
@@ -23,7 +24,17 @@ task site(type: Exec, description: 'Generate github pages', dependsOn: [copyDocs
2324
inputs.files(fileTree(buildDocsDir))
2425
outputs.dir("$buildDir/dist")
2526
workingDir file(buildDocsDir)
26-
commandLine 'bundle', 'exec', 'jekyll', 'build'
27+
commandLine 'docker', 'run', '--rm', "--volume=$buildDir:/srv/jekyll",
28+
'-t', jekyllDockerImage,
29+
'/bin/bash', '-c', 'cd docs; jekyll build'
30+
}
31+
32+
// A useful task for local debugging -- serves a site locally
33+
task serve(type: Exec, dependsOn: [copyDocs, copyExampleFrontendJs]) {
34+
commandLine 'docker', 'run', '--rm', "--volume=$buildDir:/srv/jekyll",
35+
'-p', '8080:8080',
36+
'-t', jekyllDockerImage,
37+
'/bin/bash', '-c', 'cd docs; jekyll serve --host 0.0.0.0 --port 8080'
2738
}
2839

2940
task clean(type: Delete) {

site/docs/Gemfile

-16
This file was deleted.

site/docs/Gemfile.lock

-64
This file was deleted.

site/docs/_config.yml

-3
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,5 @@ destination: ../dist
1010

1111
# Build settings
1212
markdown: kramdown
13-
exclude:
14-
- Gemfile
15-
- Gemfile.lock
1613
include:
1714
- package-list

0 commit comments

Comments
 (0)