Commit 8c240d9c authored by Jan-Philipp Stauffert's avatar Jan-Philipp Stauffert
Browse files

Update to prebuild js dependencies

parent 63f6220a
# frozen_string_literal: true
require 'fileutils'
require 'mkmf'
require 'rake/clean'
require 'rake'
task :default => [:build]
task :build do
print 'Building HCI-Theme'
system 'npm install'
system 'npx webpack -p --config webpack.config.js --mode=production'
FileUtils.mkdir_p('_sass')
FileUtils.copy_entry 'node_modules/slick-carousel', '_sass/slick-carousel'
FileUtils.mkdir_p('assets/css/fonts')
FileUtils.copy_entry(
'node_modules/slick-carousel/slick/fonts/slick.woff',
'assets/css/fonts/slick.woff'
)
FileUtils.copy_entry(
'node_modules/slick-carousel/slick/fonts/slick.ttf',
'assets/css/fonts/slick.ttf'
)
FileUtils.copy_entry(
'node_modules/slick-carousel/slick/ajax-loader.gif',
'assets/css/ajax-loader.gif'
)
end
CLOBBER << 'assets/bundle.js'
CLOBBER << "assets/css/ajax-loader.gif"
CLOBBER.include(FileList["assets/css/fonts/slick*"])
CLOBBER << "_sass/slick-carousel"
CLEAN << "node_modules"
task :gem => [:build] do
system "gem build hci-theme.gemspec"
end
...@@ -28,15 +28,6 @@ Or install it yourself as: ...@@ -28,15 +28,6 @@ Or install it yourself as:
$ gem install hci-theme $ gem install hci-theme
## Development Version
If you want to most up to date version of the theme use the git dependencies in your Gemfile.
```ruby
gem "hci-theme", :git => "git@gitlab2.informatik.uni-wuerzburg.de:hci-development/hci-theme.git"
gem "jekyll-img-srcset", :git => "git@gitlab2.informatik.uni-wuerzburg.de:hci-development/jekyll-img-srcset.git"
```
## Usage ## Usage
### Menu ### Menu
......
require 'fileutils'
require 'mkmf'
print "Installing HCI-Theme"
system "npm install"
system "npx webpack -p --config webpack.config.js --mode=production"
FileUtils.mkdir_p("_sass")
FileUtils.copy_entry "node_modules/slick-carousel", "_sass/slick-carousel"
FileUtils.mkdir_p("assets/css/fonts")
FileUtils.copy_entry "node_modules/slick-carousel/slick/fonts/slick.woff", "assets/css/fonts/slick.woff"
FileUtils.copy_entry "node_modules/slick-carousel/slick/fonts/slick.ttf", "assets/css/fonts/slick.ttf"
FileUtils.copy_entry "node_modules/slick-carousel/slick/ajax-loader.gif", "assets/css/ajax-loader.gif"
create_makefile ''
\ No newline at end of file
...@@ -3,7 +3,7 @@ require 'rake' ...@@ -3,7 +3,7 @@ require 'rake'
Gem::Specification.new do |spec| Gem::Specification.new do |spec|
spec.name = "hci-theme" spec.name = "hci-theme"
spec.version = "0.1.2" spec.version = "0.2.0"
spec.authors = ["Jan-Philipp Stauffert"] spec.authors = ["Jan-Philipp Stauffert"]
spec.email = ["jan-philipp.stauffert@uni-wuerzburg.de"] spec.email = ["jan-philipp.stauffert@uni-wuerzburg.de"]
...@@ -14,21 +14,23 @@ Gem::Specification.new do |spec| ...@@ -14,21 +14,23 @@ Gem::Specification.new do |spec|
spec.files = FileList[ spec.files = FileList[
'_includes/*', '_includes/*',
'_layouts/*', '_layouts/*',
'_sass/*', '_sass/*.scss',
'extconf.rb', '_sass/slick-carousel/slick/*.scss',
'_config.yml',
'bibsonomy.js', 'bibsonomy.js',
'entry.jsx',
'webpack.config.js', 'webpack.config.js',
'package.json' 'package.json',
'assets/bundle.js',
'assets/css/*',
'assets/css/fonts/*',
'assets/images/*'
].to_a ].to_a
spec.required_ruby_version = '>= 2.6' spec.required_ruby_version = '>= 2.4.0'
spec.add_runtime_dependency "jekyll", "~> 4.0" spec.add_runtime_dependency "jekyll", "~> 4.0"
spec.add_runtime_dependency 'jekyll-sass-converter', "~> 2.0" spec.add_runtime_dependency 'jekyll-sass-converter', "~> 2.0"
spec.add_development_dependency "bundler", "~> 1.16" spec.add_development_dependency "bundler", "~> 1.16"
spec.add_development_dependency "rake", "~> 12.0" spec.add_development_dependency "rake", "~> 12.0"
spec.post_install_message = "HCI-Theme installed!"
spec.extensions << 'extconf.rb'
end end
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment