diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 000000000000..a82e737ec844 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,44 @@ +# Git +.git +.gitignore + +# Docker +Dockerfile +docker-compose.yml +.dockerignore + +# Dependencies +node_modules +vendor/ +.bundle + +# Build outputs +dist/ +_site/ +.sass-cache/ +.jekyll-cache/ +.jekyll-metadata + +# Logs +npm-debug.log* +yarn-debug.log* +yarn-error.log* + +# OS generated files +.DS_Store +.DS_Store? +._* +.Spotlight-V100 +.Trashes +ehthumbs.db +Thumbs.db + +# IDE +.vscode/ +.idea/ +*.swp +*.swo + +# Temporary files +*.tmp +*.temp diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 000000000000..d38fcebc62b9 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,44 @@ +# Use Ruby 3.3.5 as base image +FROM ruby:3.3.5-slim + +# Install system dependencies +RUN apt-get update && apt-get install -y \ + build-essential \ + curl \ + git \ + && rm -rf /var/lib/apt/lists/* + +# Install Node.js 22.10.0 +RUN curl -fsSL https://deb.nodesource.com/setup_22.x | bash - \ + && apt-get install -y nodejs + +# Verify versions +RUN ruby --version && node --version && npm --version + +# Set working directory +WORKDIR /app + +# Copy dependency files first for better caching +COPY Gemfile Gemfile.lock ./ +COPY package.json package-lock.json* ./ + +# Install bundler and Ruby gems +RUN gem install bundler +RUN bundle config set --local path 'vendor/bundle' +RUN bundle install + +# Install Node.js packages +RUN npm install + +# Copy the rest of the application +COPY . . + +# Set up Jekyll source directory +ENV JEKYLL_ENV=development +ENV BUNDLE_PATH=vendor/bundle + +# Expose port 4000 for Jekyll +EXPOSE 4000 + +# Default command - can be overridden in docker-compose +CMD ["npm", "run", "watch"] diff --git a/Gemfile.lock b/Gemfile.lock index c78265925574..c6d32d669bbd 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -3,43 +3,20 @@ GEM specs: addressable (2.8.7) public_suffix (>= 2.0.2, < 7.0) - bigdecimal (3.1.8) colorator (1.1.0) concurrent-ruby (1.3.4) em-websocket (0.5.3) eventmachine (>= 0.12.9) http_parser.rb (~> 0) eventmachine (1.2.7) - ffi (1.17.0) - ffi (1.17.0-aarch64-linux-gnu) - ffi (1.17.0-aarch64-linux-musl) - ffi (1.17.0-arm-linux-gnu) - ffi (1.17.0-arm-linux-musl) - ffi (1.17.0-arm64-darwin) - ffi (1.17.0-x86-linux-gnu) - ffi (1.17.0-x86-linux-musl) - ffi (1.17.0-x86_64-darwin) - ffi (1.17.0-x86_64-linux-gnu) - ffi (1.17.0-x86_64-linux-musl) + ffi (1.17.2) forwardable-extended (2.6.0) - google-protobuf (4.28.3) - bigdecimal - rake (>= 13) - google-protobuf (4.28.3-aarch64-linux) - bigdecimal - rake (>= 13) - google-protobuf (4.28.3-arm64-darwin) - bigdecimal - rake (>= 13) - google-protobuf (4.28.3-x86-linux) - bigdecimal - rake (>= 13) - google-protobuf (4.28.3-x86_64-darwin) - bigdecimal - rake (>= 13) - google-protobuf (4.28.3-x86_64-linux) - bigdecimal - rake (>= 13) + google-protobuf (3.25.8) + google-protobuf (3.25.8-aarch64-linux) + google-protobuf (3.25.8-arm64-darwin) + google-protobuf (3.25.8-x86-linux) + google-protobuf (3.25.8-x86_64-darwin) + google-protobuf (3.25.8-x86_64-linux) http_parser.rb (0.8.0) i18n (1.14.6) concurrent-ruby (~> 1.0) @@ -82,82 +59,40 @@ GEM rexml (3.3.9) rouge (4.5.1) safe_yaml (1.0.5) - sass-embedded (1.80.6) - google-protobuf (~> 4.28) - rake (>= 13) - sass-embedded (1.80.6-aarch64-linux-android) - google-protobuf (~> 4.28) - sass-embedded (1.80.6-aarch64-linux-gnu) - google-protobuf (~> 4.28) - sass-embedded (1.80.6-aarch64-linux-musl) - google-protobuf (~> 4.28) - sass-embedded (1.80.6-aarch64-mingw-ucrt) - google-protobuf (~> 4.28) - sass-embedded (1.80.6-arm-linux-androideabi) - google-protobuf (~> 4.28) - sass-embedded (1.80.6-arm-linux-gnueabihf) - google-protobuf (~> 4.28) - sass-embedded (1.80.6-arm-linux-musleabihf) - google-protobuf (~> 4.28) - sass-embedded (1.80.6-arm64-darwin) - google-protobuf (~> 4.28) - sass-embedded (1.80.6-riscv64-linux-android) - google-protobuf (~> 4.28) - sass-embedded (1.80.6-riscv64-linux-gnu) - google-protobuf (~> 4.28) - sass-embedded (1.80.6-riscv64-linux-musl) - google-protobuf (~> 4.28) - sass-embedded (1.80.6-x86-cygwin) - google-protobuf (~> 4.28) - sass-embedded (1.80.6-x86-linux-android) - google-protobuf (~> 4.28) - sass-embedded (1.80.6-x86-linux-gnu) - google-protobuf (~> 4.28) - sass-embedded (1.80.6-x86-linux-musl) - google-protobuf (~> 4.28) - sass-embedded (1.80.6-x86-mingw-ucrt) - google-protobuf (~> 4.28) - sass-embedded (1.80.6-x86_64-cygwin) - google-protobuf (~> 4.28) - sass-embedded (1.80.6-x86_64-darwin) - google-protobuf (~> 4.28) - sass-embedded (1.80.6-x86_64-linux-android) - google-protobuf (~> 4.28) - sass-embedded (1.80.6-x86_64-linux-gnu) - google-protobuf (~> 4.28) - sass-embedded (1.80.6-x86_64-linux-musl) - google-protobuf (~> 4.28) + sass-embedded (1.69.5) + google-protobuf (~> 3.23) + rake (>= 13.0.0) terminal-table (3.0.2) unicode-display_width (>= 1.1.1, < 3) unicode-display_width (2.6.0) webrick (1.9.0) PLATFORMS + aarch64-linux aarch64-linux aarch64-linux-android - aarch64-linux-gnu aarch64-linux-musl aarch64-mingw-ucrt + arm-linux + arm-linux arm-linux-androideabi - arm-linux-gnu - arm-linux-gnueabihf arm-linux-musl arm-linux-musleabihf arm64-darwin + riscv64-linux riscv64-linux-android - riscv64-linux-gnu riscv64-linux-musl ruby x86-cygwin x86-linux + x86-linux x86-linux-android - x86-linux-gnu x86-linux-musl x86-mingw-ucrt x86_64-cygwin x86_64-darwin + x86_64-linux x86_64-linux-android - x86_64-linux-gnu x86_64-linux-musl DEPENDENCIES diff --git a/README.md b/README.md index cc2ff41e9a35..cb6bce982a92 100644 --- a/README.md +++ b/README.md @@ -19,6 +19,23 @@ The site was recently overhauled. Here you can find documentation on how to add ## Running Locally +### Using Docker + +A [`Dockerfile`](./Dockerfile) and [`docker-compose.yml`](./docker-compose.yml) are provided to build and view the website locally using a containerised environment. To build the docker container use + +```sh +docker compose build +``` + +And then run the container with: + +```sh +docker compose up +``` + +The site is viewable at [`http://localhost:4000/`](http://localhost:4000/). + + ### Tools - (`asdf` for runtime version management) diff --git a/content/_includes/head.html b/content/_includes/head.html index 604e7601edd4..4e90d2446fdc 100644 --- a/content/_includes/head.html +++ b/content/_includes/head.html @@ -5,12 +5,12 @@ - - - + + + {% include external/mathjax.html -%} {% include external/font.html %} - + {% if page.react and (site.pages | where: "name" page.name) %} {%- assign react_source = page.name | append: ".js" -%} {% elsif (site.collections | where: "label" page.collection) %} @@ -18,5 +18,5 @@ {% else %} {%- assign react_source = "default.js" -%} {% endif %} - + diff --git a/content/_includes/post-list.html b/content/_includes/post-list.html index 2970d9999a3e..2e6edcf252b5 100644 --- a/content/_includes/post-list.html +++ b/content/_includes/post-list.html @@ -7,7 +7,7 @@ {%- assign date_format = constants.date_format | default: "%b %-d, %Y" -%} {{ post.date | date: date_format }}
diff --git a/content/pages/search.md b/content/pages/search.md index d0bb72ad623a..2d2691ec91c6 100644 --- a/content/pages/search.md +++ b/content/pages/search.md @@ -4,5 +4,5 @@ title: Search Results react: true --- - + {%- include react/root.html id='site-search' -%} diff --git a/content/properties.css.liquid b/content/properties.css.liquid index 6ca655ab6011..dcfa13b0d293 100644 --- a/content/properties.css.liquid +++ b/content/properties.css.liquid @@ -4,6 +4,6 @@ permalink: properties.css @layer components { :root { - --fiqci-banner-image: url({{ '/assets/images/FiQCI-banner.jpg' | absolute_url }}); + --fiqci-banner-image: url({{ '/assets/images/FiQCI-banner.jpg' | relative_url }}); } } diff --git a/content/site.js.liquid b/content/site.js.liquid index 8b718f7ee81e..61128ec35eaf 100644 --- a/content/site.js.liquid +++ b/content/site.js.liquid @@ -8,9 +8,9 @@ permalink: site.js "key": "{{ forloop.index }}", "type": "{{ publication.filters.Type | default: 'Post' }}", "title": "{{ publication.title }}", - "url": "{{ publication.url | absolute_url }}", + "url": "{{ publication.url | relative_url }}", "date": "{{ publication.date | date: '%-d.%-m.%Y' }}", - "teaser": "{{ publication.header.teaser | absolute_url }}", + "teaser": "{{ publication.header.teaser | relative_url }}", "filters": { {%- for category in publication.filters %} "{{ category[0] }}": "{{ category[1] }}" diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 000000000000..2fad6248dfba --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,18 @@ +services: + fiqci-dev: + build: . + ports: + - "4000:4000" + - "35729:35729" + volumes: + # Mount source code but exclude dependencies + - .:/app + - /app/node_modules # prevent host's node_modules from overriding container's node_modules + - /app/vendor # prevent host's vendor directory from overriding container's Ruby gems + environment: + - BUNDLE_PATH=vendor/bundle + - NODE_ENV=development + - JEKYLL_ENV=development + - JEKYLL_HOST=0.0.0.0 + command: npm run watch + working_dir: /app diff --git a/package.json b/package.json index 54b0f8b62ad6..6c138e89b4b5 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,7 @@ "tailwindcss": "npx tailwindcss --input=${npm_package_config_tailwindcss_inputDir}/main.css --output=${npm_package_config_webpack_outputDir}/main.css", "webpack": "npx webpack", "jekyll": "bundle exec jekyll", - "jekyll:serve": "npm run-script jekyll -- serve --config ${npm_package_config_jekyll_configFilename},${npm_package_config_jekyll_webpackConfigFilename}", + "jekyll:serve": "npm run-script jekyll -- serve --config ${npm_package_config_jekyll_configFilename},${npm_package_config_jekyll_webpackConfigFilename} --livereload --host ${JEKYLL_HOST:-127.0.0.1}", "jekyll:build": "npm run-script jekyll -- build --config ${npm_package_config_jekyll_configFilename},${npm_package_config_jekyll_webpackConfigFilename}", "clean": "npm run-script jekyll -- clean --config ${npm_package_config_jekyll_configFilename},${npm_package_config_jekyll_webpackConfigFilename} && rm ${npm_package_config_jekyll_webpackConfigFilename}", "watch": "npx concurrently --kill-others --prefix-colors ${npm_package_config_conc_colors} --passthrough-arguments 'npm:tailwindcss -- {1}' 'npm:webpack -- --mode=development {1}' 'npm:jekyll:serve -- --livereload' -- --watch", diff --git a/webpack.config.js b/webpack.config.js index 35a7b5d2af7d..fba4390a6f71 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -47,6 +47,7 @@ fs.writeFileSync(jekyllConfigFilepath, yaml.stringify(jekyllConfig)); module.exports = { entry: entryFiles, + devtool: 'inline-source-map', output: { filename: "[name].js", path: outputDirpath,