diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 000000000000..e16e2bad933b --- /dev/null +++ b/.dockerignore @@ -0,0 +1,5 @@ +# ignore hidden files +.* + +node_modules/ +_site/ diff --git a/.gitattributes b/.gitattributes index c1d2ba2b3c75..64a13629ea13 100644 --- a/.gitattributes +++ b/.gitattributes @@ -46,3 +46,7 @@ Dockerfile text eol=lf *.mp3 binary *.ogg binary *.flv binary + +# ensure dockerfiles are checked out with LF line endings +Dockerfile text eol=lf +*.dockerfile text eol=lf diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml deleted file mode 100644 index fb01171151fd..000000000000 --- a/.github/FUNDING.yml +++ /dev/null @@ -1,4 +0,0 @@ -# These are supported funding model platforms - -github: daattali -patreon: DeanAttali diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 000000000000..d0fb11d766ce --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,55 @@ +--- +# This file is centrally managed in https://github.com//.github/ +# Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in +# the above-mentioned repo. + +version: 2 +updates: + - package-ecosystem: "docker" + directory: "/" + schedule: + interval: "daily" + time: "08:00" + open-pull-requests-limit: 10 + + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "daily" + time: "08:30" + open-pull-requests-limit: 10 + + - package-ecosystem: "npm" + directory: "/" + schedule: + interval: "daily" + time: "09:00" + open-pull-requests-limit: 10 + + - package-ecosystem: "nuget" + directory: "/" + schedule: + interval: "daily" + time: "09:30" + open-pull-requests-limit: 10 + + - package-ecosystem: "pip" + directory: "/" + schedule: + interval: "daily" + time: "10:00" + open-pull-requests-limit: 10 + + - package-ecosystem: "gitsubmodule" + directory: "/" + schedule: + interval: "daily" + time: "10:30" + open-pull-requests-limit: 10 + + - package-ecosystem: "bundler" + directory: "/" + schedule: + interval: "daily" + time: "11:00" + open-pull-requests-limit: 10 diff --git a/.github/issue_template.md b/.github/issue_template.md deleted file mode 100644 index 2e25e5c9e57e..000000000000 --- a/.github/issue_template.md +++ /dev/null @@ -1,3 +0,0 @@ -Please only submit feature suggestions or bug reports if you believe something is broken. - -If you need help, you can attend the [Office Hours](https://beautifuljekyll.com/officehours) (only available for [sponsors](https://beautifuljekyll.com/plans/)). diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md deleted file mode 100644 index a30e7e4a731d..000000000000 --- a/.github/pull_request_template.md +++ /dev/null @@ -1,5 +0,0 @@ -Please note that if you are trying to update **your** website, this is the wrong place to do so. Please carefully follow the Beautiful Jekyll instructions (found at https://github.com/daattali/beautiful-jekyll#readme) and make sure you submit changes to **your** version of the project. - -If your intention is to submit a Pull Request, please describe what your pull request achieves. - -Thank you! diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c3573a9d8478..90cbf24264cb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,15 +1,67 @@ +--- name: Beautiful Jekyll CI -on: [push, pull_request] + +on: + push: + branches: + - master + pull_request: + branches: + - master + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + jobs: build: name: Build Jekyll runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - uses: ruby/setup-ruby@v1 + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Node + uses: actions/setup-node@v4 + with: + node-version: 'latest' + + - name: Setup Ruby + uses: ruby/setup-ruby@v1 with: ruby-version: '3.3' - - name: Install dependencies - run: bundle install && bundle exec appraisal install + # runs `bundle install` and caches gems automatically, + # unfortunately the `Build site` step fails when using cache + # bundler-cache: true + + - name: Install ruby dependencies + run: | + bundle install + bundle exec appraisal install + - name: Build site - run: bundle exec appraisal jekyll build --future + run: | + bundle exec appraisal jekyll build --future + + - name: Upload Artifacts + uses: actions/upload-artifact@v4 + with: + name: _site + path: _site/ + if-no-files-found: error + + publish: + if: github.event_name == 'push' && github.ref == 'refs/heads/master' + needs: build + runs-on: ubuntu-latest + steps: + - name: Download Artifacts + uses: actions/download-artifact@v4 + with: + name: _site + path: gh-pages + + - name: Deploy + uses: peaceiris/actions-gh-pages@v4 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./gh-pages diff --git a/.gitignore b/.gitignore index e065359ac1ef..292e397200fc 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,6 @@ +# ignore JetBrains IDE files +.idea/ + # project _site .sass-cache @@ -11,3 +14,7 @@ ehthumbs.db Gemfile.lock beautiful-jekyll-theme-*.gem + +# npm +node_modules/ +package-lock.json diff --git a/.run/Dockerfile.run.xml b/.run/Dockerfile.run.xml new file mode 100644 index 000000000000..2cb72d1d0821 --- /dev/null +++ b/.run/Dockerfile.run.xml @@ -0,0 +1,20 @@ + + + + + + + + + + \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 000000000000..ffd61a826462 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,32 @@ +FROM ruby:3.3-bookworm + +SHELL ["/bin/bash", "-o", "pipefail", "-c"] + +RUN <<_DEPS +#!/bin/bash +set -e + +apt-get update -qq +apt-get install -y \ + build-essential \ + nodejs \ + npm +_DEPS + +WORKDIR /app + +COPY . . + +# Install the gems specified in the Gemfile +RUN <<_SETUP +#!/bin/bash +set -e + +bundle install +_SETUP + +# Expose the port that Jekyll will run on +EXPOSE 4000 + +# Command to build and serve the Jekyll site +CMD ["bundle", "exec", "jekyll", "serve", "--trace", "--config", "_config.yml,_config_local.yml"] diff --git a/Gemfile b/Gemfile index d1d370852a7c..be173b205f70 100644 --- a/Gemfile +++ b/Gemfile @@ -3,4 +3,3 @@ source "https://rubygems.org" gemspec - diff --git a/README.md b/README.md index c2d1c5a39d6a..0839deed4f52 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # Beautiful Jekyll +TODO: Update Readme for fork + [![Gem Version](https://badge.fury.io/rb/beautiful-jekyll-theme.svg)](https://badge.fury.io/rb/beautiful-jekyll-theme) > By [Dean Attali](https://deanattali.com) · [Demo](https://beautifuljekyll.com/) diff --git a/_config.yml b/_config.yml index e3f871135f35..9dbc1c1f08e0 100644 --- a/_config.yml +++ b/_config.yml @@ -59,7 +59,7 @@ social-network-links: youtube: "@daattali" whatsapp: 15551212 # medium: yourname -# reddit: yourname +# reddit: yourname or r/yoursubreddit # linkedin: daattali # xing: yourname # stackoverflow: "3943160/daattali" @@ -76,7 +76,7 @@ social-network-links: # bluesky: yourname # ORCID: your ORCID ID # google-scholar: your google scholar -# discord: "invite_code" or "users/userid" or "invite/invite_code" +# discord: "invite_code" or "users/userid" or "invite/invite_code" # kaggle: yourname # hackerrank: yourname # gitlab: yourname @@ -214,23 +214,23 @@ footer-hover-col: "#0085A1" # label: blog-comments # Label that will be assigned to GitHub Issues created by Utterances # To use Staticman comments, uncomment the following section. You may leave the reCaptcha -# section commented if you aren't using reCaptcha for spam protection. -# Using Staticman requires advanced knowledge, please consult -# https://github.com/eduardoboucas/staticman/ and https://staticman.net/ for further -# instructions. For any support with staticman please direct questions to staticman and +# section commented if you aren't using reCaptcha for spam protection. +# Using Staticman requires advanced knowledge, please consult +# https://github.com/eduardoboucas/staticman/ and https://staticman.net/ for further +# instructions. For any support with staticman please direct questions to staticman and # not to BeautifulJekyll. #staticman: # repository : # GitHub username/repository eg. "daattali/beautiful-jekyll" # branch : master # If you're not using `master` branch, then you also need to update the `branch` parameter in `staticman.yml` # endpoint : # URL of your deployment, with a trailing slash eg. "https:///v3/entry/github/" -# reCaptcha: # (optional, set these parameters in `staticman.yml` as well) +# reCaptcha: # (optional, set these parameters in `staticman.yml` as well) # siteKey : # You need to apply for a site key on Google # secret : # Encrypt your password by going to https:///v3/encrypt/ # To use giscus comments: -# (0) Uncomment the following giscus section, (1) Enable Discussions in your GitHub repository, +# (0) Uncomment the following giscus section, (1) Enable Discussions in your GitHub repository, # (2) Install the giscus app in your repository (details at https://giscus.app), -# (3) Fill in *all* the parameters below +# (3) Fill in *all* the parameters below # See more details about giscus and each of the following parameters at https://giscus.app #giscus: # hostname: giscus.app # Replace with your giscus instance's hostname if self-hosting @@ -267,18 +267,41 @@ paginate: 5 kramdown: input: GFM +npm_hook: + modules_dir: node_modules + # npm_dependencies: + # - "@lizardbyte/shared-web@latest" + copy_files: + - src: "bootstrap/dist/css/bootstrap.min.css" + dst: "assets/vendor/css/bootstrap.min.css" + - src: "bootstrap/dist/css/bootstrap.min.css.map" + dst: "assets/vendor/css/bootstrap.min.css.map" + - src: "bootstrap/dist/js/bootstrap.min.js" + dst: "assets/vendor/js/bootstrap.min.js" + - src: "jquery/dist/jquery.min.js" + dst: "assets/vendor/js/jquery.min.js" + - src: "popper.js/dist/umd/popper.min.js" + dst: "assets/vendor/js/popper.min.js" + - src: "@fortawesome/fontawesome-free/css/all.min.css" + dst: "assets/vendor/css/fontawesome.min.css" + copy_dirs: + - src: "@fortawesome/fontawesome-free/webfonts" + dst: "assets/vendor/webfonts" + - src: "@fontsource/lora/" + dst: "assets/vendor/fonts/lora" + - src: "@fontsource/open-sans" + dst: "assets/vendor/fonts/open-sans" + # Default YAML values (more information on Jekyll's site) defaults: - - - scope: + - scope: path: "" type: "posts" values: layout: "post" comments: true # add comments to all blog posts social-share: true # add social media sharing buttons to all blog posts - - - scope: + - scope: path: "" # any file that's not a post will be a "page" layout by default values: layout: "page" @@ -300,4 +323,3 @@ plugins: # Beautiful Jekyll / Dean Attali # 2fc73a3a967e97599c9763d05e564189 - diff --git a/_config_local.yml b/_config_local.yml new file mode 100644 index 000000000000..b5f562033281 --- /dev/null +++ b/_config_local.yml @@ -0,0 +1,5 @@ +--- +host: "localhost" +port: 4000 +baseurl: "" +repository: "octocat/dummy" diff --git a/_includes/head.html b/_includes/head.html index fa0cfd14dd38..13ac85dc14cf 100644 --- a/_includes/head.html +++ b/_includes/head.html @@ -87,7 +87,7 @@ {% include ext-css.html css=css %} {% endfor %} {% endif %} - + {% if page.css %} {% for css in page.css %} diff --git a/_includes/social-networks-links.html b/_includes/social-networks-links.html index 141b27c2297f..991ecb80ca4f 100644 --- a/_includes/social-networks-links.html +++ b/_includes/social-networks-links.html @@ -112,8 +112,12 @@ {%- endif -%} {%- if network[0] == "reddit" -%} + {% assign reddit_start = network[1] | split: "/" | first -%} + {% unless reddit_start == 'r' or reddit_start == 'u' -%} + {% assign reddit_url_prefix = 'u/' -%} + {% endunless -%}
  • - +
  • {%- endif -%} - + {%- if network[0] == "medium" -%}
  • @@ -338,7 +342,7 @@
  • {%- endif -%} - + {%- if network[0] == "discord" -%} {% assign discord_start = network[1] | split: "/" | first -%} {% unless discord_start == 'users' or discord_start == 'invite' -%} @@ -354,7 +358,7 @@ {%- endif -%} - + {%- if network[0] == "kaggle" -%}
  • diff --git a/_layouts/base.html b/_layouts/base.html index df2c16fd7d8a..c334f1c5d6c1 100644 --- a/_layouts/base.html +++ b/_layouts/base.html @@ -1,21 +1,27 @@ --- common-css: + - "/assets/vendor/css/bootstrap.min.css" + - "/assets/vendor/css/fontawesome.min.css" + - "/assets/vendor/fonts/lora/400.css" + - "/assets/vendor/fonts/lora/700.css" + - "/assets/vendor/fonts/lora/400-italic.css" + - "/assets/vendor/fonts/lora/700-italic.css" + - "/assets/vendor/fonts/open-sans/300-italic.css" + - "/assets/vendor/fonts/open-sans/400-italic.css" + - "/assets/vendor/fonts/open-sans/600-italic.css" + - "/assets/vendor/fonts/open-sans/700-italic.css" + - "/assets/vendor/fonts/open-sans/800-italic.css" + - "/assets/vendor/fonts/open-sans/300.css" + - "/assets/vendor/fonts/open-sans/400.css" + - "/assets/vendor/fonts/open-sans/600.css" + - "/assets/vendor/fonts/open-sans/700.css" + - "/assets/vendor/fonts/open-sans/800.css" - "/assets/css/bootstrap-social.css" - "/assets/css/beautifuljekyll.css" -common-ext-css: - - href: "https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" - sri: "sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" - - "https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.2/css/all.min.css" - - "https://fonts.googleapis.com/css?family=Lora:400,700,400italic,700italic" - - "https://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800" -common-ext-js: - - href: "https://code.jquery.com/jquery-3.5.1.slim.min.js" - sri: "sha256-4+XzXVhsDmqanXGHaHvgh1gMQKX40OUvDEBTu8JcmNs=" - - href: "https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js" - sri: "sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo" - - href: "https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js" - sri: "sha384-wfSDF2E50Y2D1uUdj0O3uMBJnjuUD4Ih7YwaYd1iqfktj0Uod8GCExl3Og8ifwB6" common-js: + - "/assets/vendor/js/bootstrap.min.js" + - "/assets/vendor/js/jquery.min.js" + - "/assets/vendor/js/popper.min.js" - "/assets/js/beautifuljekyll.js" --- diff --git a/_layouts/minimal.html b/_layouts/minimal.html index f81f29c82c84..33def22b987b 100644 --- a/_layouts/minimal.html +++ b/_layouts/minimal.html @@ -1,16 +1,11 @@ --- common-css: + - "/assets/vendor/css/bootstrap.min.css" - "/assets/css/beautifuljekyll-minimal.css" -common-ext-css: - - href: "https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" - sri: "sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" -common-ext-js: - - href: "https://code.jquery.com/jquery-3.5.1.slim.min.js" - sri: "sha256-4+XzXVhsDmqanXGHaHvgh1gMQKX40OUvDEBTu8JcmNs=" - - href: "https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js" - sri: "sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo" - - href: "https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js" - sri: "sha384-wfSDF2E50Y2D1uUdj0O3uMBJnjuUD4Ih7YwaYd1iqfktj0Uod8GCExl3Og8ifwB6" +common-js: + - "/assets/vendor/js/bootstrap.min.js" + - "/assets/vendor/js/jquery.min.js" + - "/assets/vendor/js/popper.min.js" --- diff --git a/_plugins/npm_hook.rb b/_plugins/npm_hook.rb new file mode 100644 index 000000000000..ebcd6bdcfe20 --- /dev/null +++ b/_plugins/npm_hook.rb @@ -0,0 +1,69 @@ +require 'fileutils' +require 'yaml' + +module Jekyll + # Pre-build hook to run `npm install` + Jekyll::Hooks.register :site, :after_init do |site| + config = site.config + + puts "Running `npm install`..." + system('npm install') + + # Install extra npm dependencies + if config['npm_hook'] && config['npm_hook']['npm_dependencies'] + config['npm_hook']['npm_dependencies'].each do |dependency| + puts "Installing npm dependency: #{dependency}..." + system("npm install #{dependency}") + end + end + end + + # Post-build hook to copy files and directories + Jekyll::Hooks.register :site, :post_write do |site| + config = site.config + + # Get the build directory from the configuration or default to '_site' + build_dir = config['build_dir'] || '_site' + + # Print the build directory + puts "Build directory: #{build_dir}" + + # Copy files and directories as specified in _config.yml + if config['npm_hook'] + modules_dir = config['npm_hook']['modules_dir'] || 'node_modules' + + # Copy individual files + if config['npm_hook']['copy_files'] + config['npm_hook']['copy_files'].each do |copy_task| + source = File.join(modules_dir, copy_task['src']) + target = File.join(build_dir, copy_task['dst']) + puts "Copying file from #{source} to #{target}..." + unless Dir.exist?(File.dirname(target)) + FileUtils.mkdir_p(File.dirname(target)) + end + FileUtils.cp(source, target) + end + end + + # Copy directories + if config['npm_hook']['copy_dirs'] + config['npm_hook']['copy_dirs'].each do |copy_task| + source = File.join(modules_dir, copy_task['src']) + target = File.join(build_dir, copy_task['dst']) + puts "Copying directory from #{source} to #{target}..." + + # Create directory if it doesn't exist + unless Dir.exist?(target) + puts "Creating directory #{target}..." + FileUtils.mkdir_p(target) + end + + # Copy contents of the source directory to the target directory + Dir.glob("#{source}/*").each do |file| + FileUtils.cp_r(file, target) + end + end + end + end + end +end diff --git a/package.json b/package.json new file mode 100644 index 000000000000..d05d4e6edd20 --- /dev/null +++ b/package.json @@ -0,0 +1,23 @@ +{ + "name": "beautiful-jekyll", + "scripts": { + "build": "npm-run-all build:deps build:exec_install build:exec_build", + "build:deps": "bundle install", + "build:exec_install": "bundle exec appraisal install", + "build:exec_build": "bundle exec appraisal jekyll build --future", + "serve": "bundle exec appraisal jekyll serve --trace", + "test": "echo \"Error: no test specified\" && exit 1" + }, + "license": "MIT", + "dependencies": { + "@fontsource/lora": "5.0.19", + "@fontsource/open-sans": "5.0.30", + "@fortawesome/fontawesome-free": "6.5.2", + "bootstrap": "4.4.1", + "jquery": "3.5.1", + "popper.js": "1.16.0" + }, + "devDependencies": { + "npm-run-all": "4.1.5" + } +}