mitlibraries-theme 0.1.0 → 0.3.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f71c3d6081f01f45f4cc3364bb9389219723e6df99df2c418b17c5efc6c5b881
4
- data.tar.gz: cfaef0cb2bbff68b3ce7ba16722b12e5951fbccf324faedfc7010718b63144fa
3
+ metadata.gz: ecf72d8fc3f947feff484f614fbd78299b988b60f2917289b1166b8d8045eb33
4
+ data.tar.gz: cced976628bcad6adfd7ae13d7fec3238c9692aa8abb13575a56990882353c74
5
5
  SHA512:
6
- metadata.gz: ec9c85ad890bc7c9f8f590da9ee052bbfedb22d80edf1624d1d2a58a917107d90548181963304bc47865c4a1abee4d32baea4907f2ca35c5e900fe1b2e7cdcfe
7
- data.tar.gz: bc8142960a8ba2e63d03bd45d7f8954a2517e37e23e60082cffc542e9912e4e2afe58ed014a09902dd4872d13f9fb65778f3cdd6a0d562bc13a73341cb0221a9
6
+ metadata.gz: 14ec4af05c669a9f5335ab98bf8cfacaab6acdd2950145c0160aaeb4569a2d3b1b60071316439a7c29e53394130462049a8dda0de6af40b842fc6f2c9c1b9fa9
7
+ data.tar.gz: 514c0869fa969fa8c96bdf55e48b6312f5e612fdf806c856ac74335b5901fe46378d2507b75d5af045cd0a365df6601c42f9812f8e0e6ae0585ade814133ebc5
@@ -0,0 +1,56 @@
1
+ .PHONY: help fetch update cleanup dist publish
2
+ SHELL=/bin/bash
3
+ GEMSPEC=$(shell ls *.gemspec | head -1)
4
+ VERSION=$(shell ruby -e 'puts Gem::Specification::load("$(GEMSPEC)").version')
5
+ PROJECT=$(shell ruby -e 'puts Gem::Specification.load("$(GEMSPEC)").name')
6
+ GEM=$(PROJECT)-$(VERSION).gem
7
+
8
+ help: ## Print this message
9
+ @awk 'BEGIN { FS = ":.*##"; print "Usage: make <target>\n\nTargets:" } \
10
+ /^[-_[:alpha:]]+:.?*##/ { printf " %-15s%s\n", $$1, $$2 }' $(MAKEFILE_LIST)
11
+
12
+ fetch: clean ## Grab latest from theme repo (auto runs clean first)
13
+ mkdir -p tmp
14
+ curl -o tmp/assets.zip https://codeload.github.com/MITLibraries/mitlib-style/zip/master
15
+ unzip -o -d tmp tmp/assets.zip
16
+
17
+ update: fetch ## Synchronize latest (auto runs clean and fetch first)
18
+ # cleanup targets first in case assets were removed
19
+ rm -rf vendor/assets/images/
20
+ rm -rf vendor/assets/stylesheets/
21
+
22
+ mkdir vendor/assets/images/
23
+ mkdir vendor/assets/stylesheets/
24
+
25
+ cp -R tmp/mitlib-style-master/_assets/i/* vendor/assets/images
26
+ cp -R tmp/mitlib-style-master/_assets/sass/* vendor/assets/stylesheets
27
+
28
+ rm -rf vendor/assets/stylesheets/apps/
29
+ rm -f vendor/assets/stylesheets/ebooks-main.scss
30
+ rm -f vendor/assets/stylesheets/guide-helper.scss
31
+ rm -f vendor/assets/stylesheets/quicksubmit.sass
32
+
33
+ # We need to double $ so make doesn't think it's a variable and escape the $ for bash. Hence \$$.
34
+ sed -i '' "s+url('#{\$$image-path}/vi-shape7-tp.svg')+image-url('vi-shape7-tp.svg')+g" vendor/assets/stylesheets/elements/*.scss
35
+
36
+ @tput setaf 2
37
+ @tput bold
38
+ @echo "Assets updated. Make sure to update version in:"
39
+ @echo " lib/mitlibraries/theme/version.rb"
40
+ @echo "before building with 'make dist'"
41
+ @tput sgr0
42
+
43
+ clean: ## Delete downloaded zip and extracted files
44
+ rm -f tmp/assets.zip
45
+ rm -rf tmp/mitlib-style-master
46
+
47
+ dist: ## Build the gem from the current gemspec
48
+ gem build mitlibraries-theme.gemspec
49
+ @tput setaf 2
50
+ @tput bold
51
+ @echo "Finished building gem. To test locally add to your project Gemfile:"
52
+ @echo " gem 'mitlibraries-theme', path: '$(shell pwd)'"
53
+ @tput sgr0
54
+
55
+ publish: ## Publish the gem version defined in the gemspec
56
+ gem push "$(GEM)"
data/README.md CHANGED
@@ -57,11 +57,36 @@ called multiple times the results are concatenated. This is intended primarily
57
57
  for adding external support libraries. For JS you are writing, include via
58
58
  `application.scss` as normal.
59
59
 
60
+ ## Adding Additional Meta headers to HTML Head
61
+
62
+ You can load additional meta headers to individual pages using:
63
+
64
+ ```
65
+ <% content_for :additional_meta_tag do %>
66
+ <meta name="description" content="Words and stuff about stuff or something.">
67
+ <meta name="keywords" content="words,stuff,yoyos">
68
+ <% end %>
69
+ ```
70
+
71
+ This can appear as many times as you need on as many templates as you need. If
72
+ called multiple times the results are concatenated.
73
+
60
74
  ## Development
61
75
 
62
76
  After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
63
77
 
64
- To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
78
+ Building and publishing this gem is handled via the `Makefile`.
79
+
80
+ Run `make help` for details.
81
+
82
+ If your goal is to fetch the latest assets from the style repo and publish the
83
+ changes, this would get you there:
84
+ - `make update`
85
+ - manually update the version in `lib/mitlibraries/theme/version.rb`
86
+ - `make dist`
87
+ - test the gem in a local version of a site that uses it with the info the previous command provided on completion
88
+ - commit and PR
89
+ - `make publish`
65
90
 
66
91
  ## Contributing
67
92
 
@@ -4,6 +4,8 @@
4
4
  <title><%= content_for?(:title) ? yield(:title) : " MIT Libraries" %></title>
5
5
  <%= csrf_meta_tags %>
6
6
 
7
+ <%= yield :additional_meta_tag %>
8
+
7
9
  <!-- Le HTML5 shim, for IE6-8 support of HTML elements -->
8
10
  <!--[if lt IE 9]>
9
11
  <script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.6.1/html5shiv.js" type="text/javascript"></script>
@@ -19,28 +21,24 @@
19
21
  <%= render partial: "layouts/js_exception_handler" %>
20
22
  <%= javascript_include_tag "application" %>
21
23
 
24
+ <script type='text/javascript' src='https://cdnjs.cloudflare.com/ajax/libs/modernizr/2.8.3/modernizr.min.js'></script>
25
+
22
26
  <%= yield :additional_js %>
23
27
 
24
- <% if (ENV['GOOGLE_ANALYTICS']) %>
28
+ <% if (ENV['MATOMO_URL'].present? && ENV['MATOMO_SITE_ID'].present?) %>
29
+ <!-- Matomo -->
25
30
  <script type="text/javascript">
26
- // Google Analytics
27
-
28
- (function(i,s,o,g,r,a,m){
29
- i['GoogleAnalyticsObject']=r;
30
- i[r]=i[r]||function(){
31
- (i[r].q=i[r].q||[]).push(arguments)
32
- };
33
- i[r].l=1*new Date();
34
- a=s.createElement(o);
35
- m=s.getElementsByTagName(o)[0];
36
- a.async=1;
37
- a.src=g;
38
- m.parentNode.insertBefore(a,m);
39
-
40
- }(window,document,'script','https://www.google-analytics.com/analytics.js','ga'));
41
-
42
- ga('create', '<%= ENV['GOOGLE_ANALYTICS'] %>', 'auto');
43
- ga('send', 'pageview');
44
-
31
+ var _paq = window._paq || [];
32
+ /* tracker methods like "setCustomDimension" should be called before "trackPageView" */
33
+ _paq.push(['trackPageView']);
34
+ _paq.push(['enableLinkTracking']);
35
+ (function() {
36
+ var u='<%= ENV['MATOMO_URL'] %>';
37
+ _paq.push(['setTrackerUrl', u+'matomo.php']);
38
+ _paq.push(['setSiteId', '<%= ENV['MATOMO_SITE_ID'] %>']);
39
+ var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
40
+ g.type='text/javascript'; g.async=true; g.defer=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s);
41
+ })();
45
42
  </script>
43
+ <!-- End Matomo Code -->
46
44
  <% end %>
@@ -1,5 +1,5 @@
1
1
  module Mitlibraries
2
2
  module Theme
3
- VERSION = '0.1.0'.freeze
3
+ VERSION = '0.3.3'.freeze
4
4
  end
5
5
  end
@@ -7,7 +7,7 @@
7
7
  }
8
8
 
9
9
  .wrap-footer {
10
- background: $black image-url("vi-shape7-tp.svg") no-repeat 10% center;
10
+ background: $black image-url('vi-shape7-tp.svg') no-repeat 10% center;
11
11
 
12
12
  a {
13
13
  @extend %link;
@@ -61,7 +61,7 @@
61
61
  background: $white none repeat scroll 0 0;
62
62
 
63
63
  path {
64
- fill: $gray-d1;
64
+ fill: $gray-d1;
65
65
  }
66
66
  }
67
67
  }
@@ -26,7 +26,7 @@
26
26
  }
27
27
 
28
28
  .wrap-header {
29
- background: $black image-url("vi-shape7-tp.svg") no-repeat 0 65%;
29
+ background: $black image-url('vi-shape7-tp.svg') no-repeat 0 65%;
30
30
 
31
31
  .logo-mit-lib {
32
32
  display: inline-block;
@@ -90,3 +90,4 @@
90
90
  padding-top: 7px;
91
91
  padding-bottom: 5px;
92
92
  }
93
+
@@ -60,4 +60,8 @@ a {
60
60
  background: -webkit-linear-gradient(45deg, #f23074 0%,#d6d628 36%,#207cca 66%,#544b8c 100%); /* Chrome10-25,Safari5.1-6 */
61
61
  background: linear-gradient(45deg, #f23074 0%,#d6d628 36%,#207cca 66%,#544b8c 100%); /* W3C, IE10+, FF16+, Chrome26+, Opera12+, Safari7+ */
62
62
  filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f23074', endColorstr='#544b8c',GradientType=1 ); /* IE6-9 fallback on horizontal gradient */
63
+
64
+ .wrap-header {
65
+ background: transparent;
66
+ }
63
67
  }
@@ -87,8 +87,8 @@ $fs-smallish: 1.3rem;
87
87
  $fs-small: 1.4rem;
88
88
  $fs-base: 1.6rem;
89
89
  $fs-large: 2.0rem;
90
- $fs-xlarge: 2.8rem;
91
- $fs-xxlarge: 3.6rem;
90
+ $fs-xlarge: 2.6rem;
91
+ $fs-xxlarge: 3.2rem;
92
92
  $fs-xxxlarge: 4.2rem;
93
93
  $fs-xxxxlarge: 4.8rem;
94
94
 
@@ -1,17 +1,39 @@
1
1
  // ------------------------------
2
2
  // MIT Libraries Build Compile - LTR
3
- // this compile makes a plain base css that includes everything for
3
+ // this compile makes a plain base css that includes everything for
4
4
  // header, footer, and basic content styling across apps
5
5
 
6
- // +Get the core styles
6
+ // +Base - Utilities
7
7
  // ====================
8
- @import 'core';
8
+ @import 'global/unsets';
9
+ @import 'global/variables';
10
+ @import 'global/helpers';
9
11
 
10
- // +Select styles that need js
11
- @import 'js-elements/expand-collapse';
12
+ // +Starter
13
+ // ====================
14
+ @import 'global/base';
15
+ @import 'global/typography';
16
+ @import 'global/layouts'; // various standard layouts
17
+
18
+ // +Elements
19
+ // ====================
20
+ @import 'elements/content'; // general content styles
21
+ @import 'elements/controls'; // buttons, link styles, sliders, etc.
22
+ @import 'elements/forms';
23
+ @import 'elements/modules'; // block level UI bits
24
+ @import 'elements/tables';
25
+ @import 'elements/header';
26
+ @import 'elements/footer';
27
+
28
+ // +Specific Views
29
+ // ====================
12
30
 
13
- // TODO - split this into a separate compile
14
- // app specific styles
31
+ // +Utility
15
32
  // ====================
16
- //@import 'apps/ebooks';
17
- //@import 'apps/quicksubmit';
33
+ @import 'global/vendor-overrides'; // overrides to vendor-provided styling
34
+ @import 'global/shame'; // used for any bad-form/orphaned scss
35
+
36
+
37
+ // +Select styles that need js
38
+ @import 'js-elements/expand-collapse';
39
+
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mitlibraries-theme
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeremy Prevost
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-10-23 00:00:00.000000000 Z
11
+ date: 2020-06-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -106,6 +106,7 @@ files:
106
106
  - CODE_OF_CONDUCT.md
107
107
  - Gemfile
108
108
  - LICENSE.txt
109
+ - Makefile
109
110
  - README.md
110
111
  - Rakefile
111
112
  - app/helpers/link_helper.rb
@@ -127,7 +128,6 @@ files:
127
128
  - vendor/assets/images/favicon.ico
128
129
  - vendor/assets/images/mitlib-wordmark.svg
129
130
  - vendor/assets/images/vi-shape7-tp.svg
130
- - vendor/assets/stylesheets/_core.scss
131
131
  - vendor/assets/stylesheets/elements/_content.scss
132
132
  - vendor/assets/stylesheets/elements/_controls.scss
133
133
  - vendor/assets/stylesheets/elements/_footer.scss
@@ -164,8 +164,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
164
164
  - !ruby/object:Gem::Version
165
165
  version: '0'
166
166
  requirements: []
167
- rubyforge_project:
168
- rubygems_version: 2.7.6
167
+ rubygems_version: 3.1.2
169
168
  signing_key:
170
169
  specification_version: 4
171
170
  summary: General theme for MIT Libraries Rails apps
@@ -1,32 +0,0 @@
1
- // ------------------------------
2
- // Core compile of MIT Libraries styles needed for all apps
3
-
4
- // +Base - Utilities
5
- // ====================
6
- @import 'global/unsets';
7
- @import 'global/variables';
8
- @import 'global/helpers';
9
-
10
- // +Starter
11
- // ====================
12
- @import 'global/base';
13
- @import 'global/typography';
14
- @import 'global/layouts'; // various standard layouts
15
-
16
- // +Elements
17
- // ====================
18
- @import 'elements/content'; // general content styles
19
- @import 'elements/controls'; // buttons, link styles, sliders, etc.
20
- @import 'elements/forms';
21
- @import 'elements/modules'; // block level UI bits
22
- @import 'elements/tables';
23
- @import 'elements/header';
24
- @import 'elements/footer';
25
-
26
- // +Specific Views
27
- // ====================
28
-
29
- // +Utility
30
- // ====================
31
- @import 'global/vendor-overrides'; // overrides to vendor-provided styling
32
- @import 'global/shame'; // used for any bad-form/orphaned scss