Skip to content

Commit

Permalink
Fix adamcooke#382: self hosted fonts
Browse files Browse the repository at this point in the history
  • Loading branch information
nioupola committed Sep 5, 2022
1 parent 58c073c commit edf9ca4
Show file tree
Hide file tree
Showing 21 changed files with 83 additions and 0 deletions.
1 change: 1 addition & 0 deletions app/assets/config/manifest.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//= link_tree ../images
//= link_tree ../fonts
//= link_directory ../javascripts .js
//= link_directory ../stylesheets .css
Binary file added app/assets/fonts/DroidSansMono.woff2
Binary file not shown.
Binary file added app/assets/fonts/open-sans-v34-latin-300.woff
Binary file not shown.
Binary file added app/assets/fonts/open-sans-v34-latin-300.woff2
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added app/assets/fonts/open-sans-v34-latin-600.woff
Binary file not shown.
Binary file added app/assets/fonts/open-sans-v34-latin-600.woff2
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added app/assets/fonts/open-sans-v34-latin-700.woff
Binary file not shown.
Binary file added app/assets/fonts/open-sans-v34-latin-700.woff2
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added app/assets/fonts/open-sans-v34-latin-italic.woff
Binary file not shown.
Binary file added app/assets/fonts/open-sans-v34-latin-italic.woff2
Binary file not shown.
Binary file added app/assets/fonts/open-sans-v34-latin-regular.woff
Binary file not shown.
Binary file not shown.
80 changes: 80 additions & 0 deletions app/assets/stylesheets/fonts.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
/* open-sans-300 - latin */
@font-face {
font-family: 'Open Sans';
font-style: normal;
font-weight: 300;
src: local(''),
asset-url('fonts/open-sans-v34-latin-300.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */
asset-url('fonts/open-sans-v34-latin-300.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
}

/* open-sans-regular - latin */
@font-face {
font-family: 'Open Sans';
font-style: normal;
font-weight: 400;
src: local(''),
asset-url('fonts/open-sans-v34-latin-regular.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */
asset-url('fonts/open-sans-v34-latin-regular.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
}

/* open-sans-600 - latin */
@font-face {
font-family: 'Open Sans';
font-style: normal;
font-weight: 600;
src: local(''),
asset-url('fonts/open-sans-v34-latin-600.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */
asset-url('fonts/open-sans-v34-latin-600.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
}

/* open-sans-700 - latin */
@font-face {
font-family: 'Open Sans';
font-style: normal;
font-weight: 700;
src: local(''),
asset-url('fonts/open-sans-v34-latin-700.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */
asset-url('fonts/open-sans-v34-latin-700.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
}

/* open-sans-300italic - latin */
@font-face {
font-family: 'Open Sans';
font-style: italic;
font-weight: 300;
src: local(''),
asset-url('fonts/open-sans-v34-latin-300italic.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */
asset-url('fonts/open-sans-v34-latin-300italic.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
}

/* open-sans-italic - latin */
@font-face {
font-family: 'Open Sans';
font-style: italic;
font-weight: 400;
src: local(''),
asset-url('fonts/open-sans-v34-latin-italic.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */
asset-url('fonts/open-sans-v34-latin-italic.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
}

/* open-sans-600italic - latin */
@font-face {
font-family: 'Open Sans';
font-style: italic;
font-weight: 600;
src: local(''),
asset-url('fonts/open-sans-v34-latin-600italic.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */
asset-url('fonts/open-sans-v34-latin-600italic.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
}

/* open-sans-700italic - latin */
@font-face {
font-family: 'Open Sans';
font-style: italic;
font-weight: 700;
src: local(''),
asset-url('fonts/open-sans-v34-latin-700italic.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */
asset-url('fonts/open-sans-v34-latin-700italic.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
}

1 change: 1 addition & 0 deletions config/initializers/assets.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
Rails.application.config.assets.paths << File.join(Staytus::Config.theme_root, 'assets', 'images')
Rails.application.config.assets.paths << File.join(Staytus::Config.theme_root, 'assets', 'javascripts')
Rails.application.config.assets.paths << File.join(Staytus::Config.theme_root, 'assets', 'stylesheets')
Rails.application.config.assets.paths << Rails.root.join("app", "assets", "fonts")
Rails.application.config.assets.precompile += ["#{Staytus::Config.theme_name}.css", "#{Staytus::Config.theme_name}.js"]
end

Expand Down
1 change: 1 addition & 0 deletions content/themes/default/views/layouts/default.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<head>
<title><%= @page_title %> - <%= site.title %></title>
<link href='//fonts.googleapis.com/css?family=Open+Sans:400,600,700,300|Droid+Sans+Mono' rel='stylesheet' type='text/css'>
<%= stylesheet_link_tag 'fonts' %>
<%= stylesheet_link_tag 'default' %>
<%= javascript_include_tag 'default' %>
<%= csrf_meta_tags %>
Expand Down

0 comments on commit edf9ca4

Please sign in to comment.