mirror of
https://github.com/godotengine/godot-website.git
synced 2026-01-06 14:09:58 +03:00
Asset minification (#799)
* Minify asset on each build * Fix style * Add github action step to install minify * Remove unnecessary require * Remove unnecessary lines
This commit is contained in:
3
.github/workflows/build-pr.yml
vendored
3
.github/workflows/build-pr.yml
vendored
@@ -24,6 +24,9 @@ jobs:
|
||||
# Runs 'bundle install' and caches installed gems automatically
|
||||
bundler-cache: true
|
||||
|
||||
- name: Install Minify
|
||||
run: sudo apt-get update && sudo apt-get install minify
|
||||
|
||||
# Build the website.
|
||||
|
||||
- name: Build the static website
|
||||
|
||||
3
.github/workflows/build-website.yml
vendored
3
.github/workflows/build-website.yml
vendored
@@ -29,6 +29,9 @@ jobs:
|
||||
# Runs 'bundle install' and caches installed gems automatically
|
||||
bundler-cache: true
|
||||
|
||||
- name: Install Minify
|
||||
run: sudo apt-get update && sudo apt-get install minify
|
||||
|
||||
# Build the website.
|
||||
|
||||
- name: Build the static website
|
||||
|
||||
@@ -33,9 +33,11 @@ To build the website locally, follow these steps:
|
||||
|
||||
1. Install [Jekyll prerequisites](https://jekyllrb.com/docs/installation/).
|
||||
- Make sure `bundle` is available from the command line.
|
||||
2. Clone this repository.
|
||||
3. Install the necessary dependencies: `bundle install`.
|
||||
4. Build the site: `bundle exec jekyll build`.
|
||||
2. Install [Minify](https://github.com/tdewolff/minify/tree/master/cmd/minify).
|
||||
- Make sure `minify` is available from the command line.
|
||||
3. Clone this repository.
|
||||
4. Install the necessary dependencies: `bundle install`.
|
||||
5. Build the site: `bundle exec jekyll build`.
|
||||
- Append `--config _config.yml,_config.development.yml` to use the development config with your build.
|
||||
|
||||
For simplicity, these two commands are also available as a `build.sh` script in this repository.
|
||||
|
||||
@@ -14,9 +14,7 @@
|
||||
<nav id="nav">
|
||||
<ul class="left">
|
||||
<li><a href="/features">Features</a></li>
|
||||
<div class="only-on-mobile" style="width: 100%">
|
||||
<li><a href="/showcase">Showcase</a></li>
|
||||
</div>
|
||||
<li class="only-on-mobile"><a href="/showcase">Showcase</a></li>
|
||||
<li><a href="/blog">Blog</a></li>
|
||||
<li><a href="/community">Community</a></li>
|
||||
<li><a href="/contact">About</a></li>
|
||||
|
||||
5
_plugins/minify-assets.rb
Normal file
5
_plugins/minify-assets.rb
Normal file
@@ -0,0 +1,5 @@
|
||||
# Minify assets after each build
|
||||
Jekyll::Hooks.register :site, :post_write do
|
||||
puts "Minifying assets"
|
||||
`minify -r -o _site/ _site/`
|
||||
end
|
||||
Reference in New Issue
Block a user