static/style: serve fonts locally
s-ol
1 year, 4 months ago
155 | 155 | return [[<link rel="stylesheet" type="text/css" href="/static/style/:text/css" />]] |
156 | 156 | end |
157 | 157 | end)() |
158 | buf = buf .. [[<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:200,400,600" />]] | |
159 | 158 | buf = buf .. "\n " .. tostring(opts.meta) .. "\n " .. tostring(get_scripts(fileder)) .. "\n </head>\n <body>\n " .. tostring(gen_header()) .. "\n\n " .. tostring(content) .. "\n\n " .. tostring(footer) |
160 | 159 | buf = buf .. (function() |
161 | 160 | if STATIC then |
116 | 116 | <html> |
117 | 117 | <head>]] |
118 | 118 | buf ..= if STATIC then STATIC.style else [[<link rel="stylesheet" type="text/css" href="/static/style/:text/css" />]] |
119 | buf ..= [[<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:200,400,600" />]] | |
120 | 119 | buf ..= " |
121 | 120 | #{opts.meta} |
122 | 121 | #{get_scripts fileder} |
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
0 | import tourl from (require "mmm.mmmfs.util") require "mmm.dom" | |
1 | ||
2 | => | |
3 | link_font = (name) -> | |
4 | "url('#{tourl @path, "#{name}: font/woff2"}') format('woff2'), url('#{tourl @path, "#{name}: font/woff"}') format('woff')" | |
5 | ||
6 | " | |
7 | /* source-sans-pro-200 - latin-ext_latin */ | |
8 | @font-face { | |
9 | font-family: 'Source Sans Pro'; | |
10 | font-style: normal; | |
11 | font-weight: 200; | |
12 | src: local(''), #{link_font "sans_200"}; | |
13 | } | |
14 | ||
15 | /* source-sans-pro-regular - latin-ext_latin */ | |
16 | @font-face { | |
17 | font-family: 'Source Sans Pro'; | |
18 | font-style: normal; | |
19 | font-weight: 400; | |
20 | src: local(''), #{link_font "sans_400"}; | |
21 | } | |
22 | ||
23 | /* source-sans-pro-italic - latin-ext_latin */ | |
24 | @font-face { | |
25 | font-family: 'Source Sans Pro'; | |
26 | font-style: italic; | |
27 | font-weight: 400; | |
28 | src: local(''), #{link_font "sans_400i"}; | |
29 | } | |
30 | ||
31 | /* source-sans-pro-600 - latin-ext_latin */ | |
32 | @font-face { | |
33 | font-family: 'Source Sans Pro'; | |
34 | font-style: normal; | |
35 | font-weight: 600; | |
36 | src: local(''), #{link_font "sans_600"}; | |
37 | } | |
38 | ||
39 | /* source-code-pro-regular - latin */ | |
40 | @font-face { | |
41 | font-family: 'Source Code Pro'; | |
42 | font-style: normal; | |
43 | font-weight: 400; | |
44 | src: local(''), #{link_font "code_400"}; | |
45 | } | |
46 | " |
6 | 6 | -moz-osx-font-smoothing: grayscale; |
7 | 7 | } |
8 | 8 | |
9 | body { font-family: 'Source Sans Pro'; } | |
9 | 10 | body, html, h1, h2, h3, h4, h5, h6 { |
10 | 11 | margin: 0; |
11 | 12 | padding: 0; |
23 | 24 | color: graytext; |
24 | 25 | } |
25 | 26 | } |
26 | tt, code, kbd, samp { font-family: monospace; } | |
27 | tt, code, kbd, samp { font-family: 'Source Code Pro', monospace; } | |
27 | 28 | code { font-size: 0.8em; } |
28 | 29 | b, strong { font-weight: bold; } |
29 | 30 | em, i { font-style: italic; } |