diff --git a/.github/workflows/website-build.yml b/.github/workflows/website-build.yml index e767a67eb..14b0eb0d2 100644 --- a/.github/workflows/website-build.yml +++ b/.github/workflows/website-build.yml @@ -15,7 +15,7 @@ jobs: - name: Checkout uses: actions/checkout@v3 - run: sudo apt update - - run: sudo apt-get install --yes doxygen doxygen-latex bundler + - run: sudo apt-get install --yes doxygen doxygen-latex sassc - run: > cmake -S . -B ./build -DCMAKE_BUILD_TYPE:STRING=Release @@ -24,6 +24,5 @@ jobs: -DJSONBINPACK_COMPILER:BOOL=ON -DJSONBINPACK_TESTS:BOOL=OFF -DJSONBINPACK_WEBSITE:BOOL=ON - # Jekyll is often flaky on GitHub Actions - - run: ./scripts/retry.sh cmake --build ./build --config Release --target jekyll + - run: cmake --build ./build --config Release --target website - run: cmake --build ./build --config Release --target doxygen diff --git a/.github/workflows/website-deploy.yml b/.github/workflows/website-deploy.yml index 27fe12584..741aa4510 100644 --- a/.github/workflows/website-deploy.yml +++ b/.github/workflows/website-deploy.yml @@ -23,7 +23,7 @@ jobs: - name: Checkout uses: actions/checkout@v3 - run: sudo apt update - - run: sudo apt-get install --yes doxygen doxygen-latex bundler + - run: sudo apt-get install --yes doxygen doxygen-latex sassc - run: > cmake -S . -B ./build -DCMAKE_BUILD_TYPE:STRING=Release @@ -33,8 +33,7 @@ jobs: -DJSONBINPACK_TESTS:BOOL=OFF -DJSONBINPACK_WEBSITE:BOOL=ON - # Jekyll is often flaky on GitHub Actions - - run: ./scripts/retry.sh cmake --build ./build --config Release --target jekyll + - run: cmake --build ./build --config Release --target website - run: cmake --build ./build --config Release --target doxygen - name: Setup Pages @@ -42,7 +41,7 @@ jobs: - name: Upload artifact uses: actions/upload-pages-artifact@v1 with: - path: ./build/release/www + path: ./build/www - name: Deploy to GitHub Pages id: deployment uses: actions/deploy-pages@v2 diff --git a/.gitignore b/.gitignore index fc60ad9f8..7d4cb73d2 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,5 @@ -# Created by https://www.toptal.com/developers/gitignore/api/c,c++,node,cmake,jekyll -# Edit at https://www.toptal.com/developers/gitignore?templates=c,c++,node,cmake,jekyll +# Created by https://www.toptal.com/developers/gitignore/api/c,c++,node,cmake +# Edit at https://www.toptal.com/developers/gitignore?templates=c,c++,node,cmake ### C ### # Prerequisites @@ -91,14 +91,6 @@ _deps # External projects *-prefix/ -### Jekyll ### -_site/ -.sass-cache/ -.jekyll-cache/ -.jekyll-metadata -# Ignore folders generated by Bundler -.bundle/ - ### Node ### # Logs logs diff --git a/Brewfile b/Brewfile index e576b031d..095eb8228 100644 --- a/Brewfile +++ b/Brewfile @@ -1,2 +1,3 @@ brew "cmake" brew "clang-format" +brew "sassc" diff --git a/CMakeLists.txt b/CMakeLists.txt index 9ba20faea..4cd510bd1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -35,20 +35,12 @@ if(JSONBINPACK_CLI) add_subdirectory(src/cli) endif() -# TODO: Get rid of Jekyll +# TODO: Separate website from docs at the project option level if(JSONBINPACK_WEBSITE) - string(TOLOWER ${CMAKE_BUILD_TYPE} JSONBINPACK_BUILD_TYPE) - set(JSONBINPACK_WEBSITE_OUT "${PROJECT_SOURCE_DIR}/build/${JSONBINPACK_BUILD_TYPE}/www") + set(JSONBINPACK_WEBSITE_OUT "${CMAKE_CURRENT_BINARY_DIR}/www") + add_subdirectory(www) noa_target_doxygen(CONFIG "${PROJECT_SOURCE_DIR}/doxygen/Doxyfile.in" OUTPUT "${JSONBINPACK_WEBSITE_OUT}/api") - find_program(BUNDLE_BIN NAMES bundle REQUIRED) - add_custom_target(jekyll - WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}" - VERBATIM - COMMAND "${BUNDLE_BIN}" install --path "${PROJECT_SOURCE_DIR}/build/bundler" - COMMAND "${BUNDLE_BIN}" exec jekyll build - --source "${PROJECT_SOURCE_DIR}/www" --destination "${JSONBINPACK_WEBSITE_OUT}") - set_target_properties(jekyll PROPERTIES FOLDER "JSON BinPack/Website") endif() if(PROJECT_IS_TOP_LEVEL) diff --git a/Gemfile b/Gemfile deleted file mode 100644 index c5900f620..000000000 --- a/Gemfile +++ /dev/null @@ -1,4 +0,0 @@ -source "https://rubygems.org" -gem "jekyll", "~> 3.9" -gem "kramdown-parser-gfm", "~> 1.1" -gem "webrick", "~> 1.7" diff --git a/Gemfile.lock b/Gemfile.lock deleted file mode 100644 index 0a8671382..000000000 --- a/Gemfile.lock +++ /dev/null @@ -1,65 +0,0 @@ -GEM - remote: https://rubygems.org/ - specs: - addressable (2.8.0) - public_suffix (>= 2.0.2, < 5.0) - colorator (1.1.0) - concurrent-ruby (1.1.10) - em-websocket (0.5.3) - eventmachine (>= 0.12.9) - http_parser.rb (~> 0) - eventmachine (1.2.7) - ffi (1.15.5) - forwardable-extended (2.6.0) - http_parser.rb (0.8.0) - i18n (0.9.5) - concurrent-ruby (~> 1.0) - jekyll (3.9.2) - addressable (~> 2.4) - colorator (~> 1.0) - em-websocket (~> 0.5) - i18n (~> 0.7) - jekyll-sass-converter (~> 1.0) - jekyll-watch (~> 2.0) - kramdown (>= 1.17, < 3) - liquid (~> 4.0) - mercenary (~> 0.3.3) - pathutil (~> 0.9) - rouge (>= 1.7, < 4) - safe_yaml (~> 1.0) - jekyll-sass-converter (1.5.2) - sass (~> 3.4) - jekyll-watch (2.2.1) - listen (~> 3.0) - kramdown (2.3.2) - rexml - kramdown-parser-gfm (1.1.0) - kramdown (~> 2.0) - liquid (4.0.3) - listen (3.7.1) - rb-fsevent (~> 0.10, >= 0.10.3) - rb-inotify (~> 0.9, >= 0.9.10) - mercenary (0.3.6) - pathutil (0.16.2) - forwardable-extended (~> 2.6) - public_suffix (4.0.7) - rb-fsevent (0.11.1) - rb-inotify (0.10.1) - ffi (~> 1.0) - rexml (3.2.5) - rouge (3.26.0) - safe_yaml (1.0.5) - sass (3.7.4) - sass-listen (~> 4.0.0) - sass-listen (4.0.0) - rb-fsevent (~> 0.9, >= 0.9.4) - rb-inotify (~> 0.9, >= 0.9.7) - webrick (1.7.0) - -PLATFORMS - ruby - -DEPENDENCIES - jekyll (~> 3.9) - kramdown-parser-gfm (~> 1.1) - webrick (~> 1.7) diff --git a/Makefile b/Makefile index a640d60c0..143042477 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,7 @@ # Programs CMAKE = cmake CTEST = ctest +PYTHON = python3 # Options PRESET = Debug @@ -35,10 +36,13 @@ test: .always $(CTEST) --test-dir ./build --build-config $(PRESET) \ --output-on-failure --progress --parallel -website: .always - $(CMAKE) --build ./build --config $(PRESET) --target jekyll +doxygen: .always $(CMAKE) --build ./build --config $(PRESET) --target doxygen +website: .always + $(CMAKE) --build ./build --config $(PRESET) --target website + $(PYTHON) -m http.server 3000 --directory build/www + clean: .always $(CMAKE) -E rm -R -f build diff --git a/www/CMakeLists.txt b/www/CMakeLists.txt new file mode 100644 index 000000000..7d7374b43 --- /dev/null +++ b/www/CMakeLists.txt @@ -0,0 +1,22 @@ +configure_file(oxford-poster.pdf oxford-poster.pdf COPYONLY) +configure_file(benchmark-deck.png benchmark-deck.png COPYONLY) +configure_file(example.png example.png COPYONLY) +configure_file(hybrid.png hybrid.png COPYONLY) +configure_file(jsonschema.png jsonschema.png COPYONLY) +configure_file(timeline.png timeline.png COPYONLY) +configure_file(apple-touch-icon.png apple-touch-icon.png COPYONLY) +configure_file(favicon.ico favicon.ico COPYONLY) +configure_file(icon-192x192.png icon-192x192.png COPYONLY) +configure_file(icon-512x512.png icon-512x512.png COPYONLY) +configure_file(icon.svg icon.svg COPYONLY) +configure_file(index.html index.html COPYONLY) +configure_file(manifest.webmanifest manifest.webmanifest COPYONLY) + +find_program(SASSC_BIN NAMES sassc REQUIRED) +add_custom_command(OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/main.css" + COMMAND "${SASSC_BIN}" --style compressed + "${CMAKE_CURRENT_SOURCE_DIR}/main.scss" + "${CMAKE_CURRENT_BINARY_DIR}/main.css" + DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/main.scss") +add_custom_target(website DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/main.css") +set_target_properties(website PROPERTIES FOLDER "JSON BinPack/Website") diff --git a/www/CNAME b/www/CNAME deleted file mode 100644 index d9555405f..000000000 --- a/www/CNAME +++ /dev/null @@ -1 +0,0 @@ -jsonbinpack.sourcemeta.com diff --git a/www/_config.yml b/www/_config.yml deleted file mode 100644 index 68242710a..000000000 --- a/www/_config.yml +++ /dev/null @@ -1,7 +0,0 @@ -title: JSON BinPack -baseurl: "" -url: "https://jsonbinpack.sourcemeta.com" -markdown: kramdown -sass: - style: :compressed - sass_dir: . diff --git a/www/assets/images/benchmark-deck.png b/www/benchmark-deck.png similarity index 100% rename from www/assets/images/benchmark-deck.png rename to www/benchmark-deck.png diff --git a/www/assets/images/example.png b/www/example.png similarity index 100% rename from www/assets/images/example.png rename to www/example.png diff --git a/www/assets/images/hybrid.png b/www/hybrid.png similarity index 100% rename from www/assets/images/hybrid.png rename to www/hybrid.png diff --git a/www/index.html b/www/index.html index 781d4ef5b..5e8dbd66b 100644 --- a/www/index.html +++ b/www/index.html @@ -1,5 +1,3 @@ ---- ---- @@ -9,20 +7,20 @@ JSON BinPack - + - + - - - - + + + + - +