Skip to content

Commit

Permalink
Get rid of Jekyll (#729)
Browse files Browse the repository at this point in the history
Signed-off-by: Juan Cruz Viotti <[email protected]>
  • Loading branch information
jviotti authored Feb 9, 2024
1 parent bdd3969 commit 9f06dba
Show file tree
Hide file tree
Showing 20 changed files with 65 additions and 138 deletions.
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ jobs:
-DJSONBINPACK_COMPILER:BOOL=ON
-DJSONBINPACK_TESTS:BOOL=ON
-DJSONBINPACK_WEBSITE:BOOL=OFF
-DJSONBINPACK_DOCS:BOOL=OFF
-DBUILD_SHARED_LIBS:BOOL=OFF
-DCMAKE_COMPILE_WARNING_AS_ERROR:BOOL=ON
- run: cmake --build ./build --config Release --target clang_format_test
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/website-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -24,6 +24,6 @@ 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
-DJSONBINPACK_DOCS:BOOL=ON
- run: cmake --build ./build --config Release --target website
- run: cmake --build ./build --config Release --target doxygen
8 changes: 4 additions & 4 deletions .github/workflows/website-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -32,17 +32,17 @@ jobs:
-DJSONBINPACK_COMPILER:BOOL=ON
-DJSONBINPACK_TESTS:BOOL=OFF
-DJSONBINPACK_WEBSITE:BOOL=ON
-DJSONBINPACK_DOCS: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
uses: actions/configure-pages@v1
- 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
12 changes: 2 additions & 10 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions Brewfile
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
brew "cmake"
brew "clang-format"
brew "sassc"
18 changes: 6 additions & 12 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ option(JSONBINPACK_COMPILER "Build the JSON BinPack compiler" ON)
option(JSONBINPACK_TESTS "Build the JSON BinPack tests" OFF)
option(JSONBINPACK_INSTALL "Install the JSON BinPack library" ON)
option(JSONBINPACK_WEBSITE "Build the JSON BinPack website" OFF)
option(JSONBINPACK_DOCS "Build the JSON BinPack documentation" OFF)

# TODO: Generate (and test) CMake config

Expand All @@ -35,20 +36,13 @@ if(JSONBINPACK_CLI)
add_subdirectory(src/cli)
endif()

# TODO: Get rid of Jekyll
if(JSONBINPACK_WEBSITE)
string(TOLOWER ${CMAKE_BUILD_TYPE} JSONBINPACK_BUILD_TYPE)
set(JSONBINPACK_WEBSITE_OUT "${PROJECT_SOURCE_DIR}/build/${JSONBINPACK_BUILD_TYPE}/www")
add_subdirectory(www)
endif()

if(JSONBINPACK_DOCS)
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")
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/www/api")
endif()

if(PROJECT_IS_TOP_LEVEL)
Expand Down
4 changes: 0 additions & 4 deletions Gemfile

This file was deleted.

65 changes: 0 additions & 65 deletions Gemfile.lock

This file was deleted.

9 changes: 7 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Programs
CMAKE = cmake
CTEST = ctest
PYTHON = python3

# Options
PRESET = Debug
Expand All @@ -17,6 +18,7 @@ configure: .always
-DJSONBINPACK_COMPILER:BOOL=ON \
-DJSONBINPACK_TESTS:BOOL=ON \
-DJSONBINPACK_WEBSITE:BOOL=ON \
-DJSONBINPACK_DOCS:BOOL=ON \
-DBUILD_SHARED_LIBS:BOOL=$(SHARED)

compile: .always
Expand All @@ -35,10 +37,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

Expand Down
22 changes: 22 additions & 0 deletions www/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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")
1 change: 0 additions & 1 deletion www/CNAME

This file was deleted.

7 changes: 0 additions & 7 deletions www/_config.yml

This file was deleted.

File renamed without changes
File renamed without changes
File renamed without changes
45 changes: 19 additions & 26 deletions www/index.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
---
---
<!DOCTYPE html>
<html lang="en">
<head>
Expand All @@ -9,20 +7,20 @@
<meta http-equiv="x-ua-compatible" content="ie=edge">

<title>JSON BinPack</title>
<link rel="canonical" href="{{ site.url }}">
<link rel="canonical" href="https://jsonbinpack.sourcemeta.com">
<meta name="description" content="A space-efficient open-source binary JSON serialization format based on JSON Schema">
<meta property="og:title" content="JSON BinPack">
<meta property="og:url" content="{{ site.url }}">
<meta property="og:url" content="https://jsonbinpack.sourcemeta.com">
<meta property="og:description" content="A space-efficient open-source binary JSON serialization format based on JSON Schema">
<meta property="og:locale" content="en_US">
<meta property="og:site_name" content="A space-efficient open-source binary JSON serialization format based on JSON Schema">

<link rel="icon" href="{{ site.url }}/favicon.ico" sizes="any">
<link rel="icon" href="{{ site.url }}/icon.svg" type="image/svg+xml">
<link rel="apple-touch-icon" href="{{ site.url }}/apple-touch-icon.png">
<link rel="manifest" href="{{ site.url }}/manifest.webmanifest">
<link rel="icon" href="/favicon.ico" sizes="any">
<link rel="icon" href="/icon.svg" type="image/svg+xml">
<link rel="apple-touch-icon" href="/apple-touch-icon.png">
<link rel="manifest" href="/manifest.webmanifest">

<link rel="stylesheet" href="{{ site.url }}/assets/css/main.css" type="text/css">
<link rel="stylesheet" href="/main.css" type="text/css">

<script defer data-domain="jsonbinpack.sourcemeta.com" src="https://plausible.io/js/script.outbound-links.js"></script>
<script>
Expand All @@ -34,19 +32,14 @@
<body>
<nav class="navbar navbar-expand navbar-light bg-light border-bottom">
<div class="container">
<a class="navbar-brand flex-grow-1 fs-3" href="{{ site.url }}">
<img src="{{ site.url }}/icon.svg" alt="{{ site.name }} logo" width="50" height="50">
<a class="navbar-brand flex-grow-1 fs-3" href="/">
<img src="/icon.svg" alt="JSON BinPack logo" width="50" height="50">
</a>
<div class="navbar-collapse flex-grow-0">
<div class="navbar-nav align-items-center">
<a class="nav-link ms-2 d-none d-md-inline-block" href="https://github.com/sourcemeta/jsonbinpack/discussions">Discussions</a>
<a class="nav-link ms-2 d-none d-md-inline-block" href="{{ site.url }}/api">Docs</a>
{% if page.title %}
<a class="nav-link ms-2 d-none d-md-inline-block" href="{{ site.url }}#research">Research</a>
{% else %}
<a class="nav-link ms-2 d-none d-md-inline-block" href="/api">Docs</a>
<a class="nav-link ms-2 d-none d-md-inline-block" href="#research">Research</a>
{% endif %}

<a class="nav-link ms-2" href="https://github.com/sourcemeta/jsonbinpack">
<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="currentColor" class="bi bi-github" viewBox="0 0 16 16">
<path d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.012 8.012 0 0 0 16 8c0-4.42-3.58-8-8-8z"/>
Expand Down Expand Up @@ -82,7 +75,7 @@ <h2 class="display-6 mb-4">Binary JSON for the Internet of Things</h2>
<div>
<div class="container">
<img
src="{{ site.url }}/assets/images/example.png"
src="/example.png"
class="img-fluid mb-4"
alt="JSON, JSON Schema and JSON BinPack buffer example"
height="550"
Expand All @@ -91,7 +84,7 @@ <h2 class="display-6 mb-4">Binary JSON for the Internet of Things</h2>
<h3 class="h4 mt-4 mb-1 fw-light">Standing on the Shoulders of Giants</h3>
<small>JSON BinPack was optimized for space-efficiency taking insights from almost 40 years of serialization technologies</small>
<img
src="{{ site.url }}/assets/images/timeline.png"
src="/timeline.png"
class="img-fluid px-lg-5 mb-4 mb-lg-0 mt-3"
alt="Timeline of Binary Serialization Formats">
</div>
Expand Down Expand Up @@ -123,7 +116,7 @@ <h2 class="display-6 fw-bold">Highly Space-efficient</h2>
</div>
<div class="col-lg-6">
<img
src="{{ site.url }}/assets/images/benchmark-deck.png"
src="/benchmark-deck.png"
class="img-fluid my-4 my-lg-0"
alt="Example of benchmark plots"
loading="lazy"
Expand Down Expand Up @@ -151,7 +144,7 @@ <h2 class="display-6 fw-bold">Based on JSON Schema</h2>
</div>
<div class="col-lg-6 pe-lg-5">
<img
src="{{ site.url }}/assets/images/jsonschema.png"
src="/jsonschema.png"
class="img-fluid my-4 my-lg-0"
alt="Logs of specifications using JSON Schema"
loading="lazy"
Expand Down Expand Up @@ -179,7 +172,7 @@ <h2 class="display-6 fw-bold">Optional Schema</h2>
</div>
<div class="col-lg-6">
<img
src="{{ site.url }}/assets/images/hybrid.png"
src="/hybrid.png"
class="img-fluid my-4 my-lg-0"
alt="Illustration of JSON Schema as a hybrid serialization format"
loading="lazy"
Expand Down Expand Up @@ -343,7 +336,7 @@ <h3 class="h5 mb-3">Digital Presentations</h2>
<tr>
<th class="shrink ps-0" scope="row">2022</th>
<td>
<a href="{{ site.url }}/assets/oxford-poster.pdf"
<a href="oxford-poster.pdf"
>University of Oxford Academic Poster</a>
</td>
<td class="shrink pe-0"><span class="badge bg-secondary">Poster</span></td>
Expand All @@ -363,14 +356,14 @@ <h3 class="h5 mb-3">Digital Presentations</h2>

<div class="container px-4 mt-2 mt-lg-5">
<footer class="d-flex flex-wrap justify-content-between align-items-center py-3 my-4 border-top">
<a href="{{ site.url }}" class="col-12 col-md-6 d-flex align-items-center justify-content-center justify-content-md-start mb-3 mb-md-0 me-md-auto link-dark text-decoration-none">
<img src="{{ site.url }}/icon.svg" alt="{{ site.name }} logo" width="40" height="40">
<a href="https://jsonbinpack.sourcemeta.com" class="col-12 col-md-6 d-flex align-items-center justify-content-center justify-content-md-start mb-3 mb-md-0 me-md-auto link-dark text-decoration-none">
<img src="/icon.svg" alt="JSON BinPack logo" width="40" height="40">
</a>

<ul class="col-12 col-md-6 nav justify-content-center justify-content-md-end">
<li class="nav-item"><a class="nav-link px-2 text-muted" href="https://github.com/sourcemeta/jsonbinpack">GitHub</a></li>
<li class="nav-item"><a class="nav-link px-2 text-muted" href="https://github.com/sourcemeta/jsonbinpack/discussions">Discussions</a></li>
<li class="nav-item"><a class="nav-link px-2 text-muted" href="{{ site.url }}/api">Docs</a></li>
<li class="nav-item"><a class="nav-link px-2 text-muted" href="/api">Docs</a></li>
<li class="nav-item"><a class="nav-link px-2 text-muted" href="https://github.com/sourcemeta/jsonbinpack/issues">Issues</a></li>
</ul>
</footer>
Expand Down
File renamed without changes
4 changes: 0 additions & 4 deletions www/assets/css/main.scss → www/main.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
---
sitemap: false
---

$container-max-widths: (
sm: 540px,
md: 720px,
Expand Down
File renamed without changes.
File renamed without changes

0 comments on commit 9f06dba

Please sign in to comment.