aboutsummaryrefslogtreecommitdiffstats
path: root/root
diff options
context:
space:
mode:
authors-ol <s+removethis@s-ol.nu>2022-05-24 09:37:09 +0000
committers-ol <s+removethis@s-ol.nu>2022-05-24 09:37:09 +0000
commit9f20fe67afa31868587e9a59c41c19673a31c986 (patch)
tree3f5e2017ffce3a2d9e8c051e6c57a79d501891ac /root
parentlink to the correct facet if specified in mmm-embed (diff)
downloadmmm-9f20fe67afa31868587e9a59c41c19673a31c986.tar.gz
mmm-9f20fe67afa31868587e9a59c41c19673a31c986.zip
static/style: serve fonts locally
Diffstat (limited to 'root')
-rw-r--r--root/$mmm/plugins/layout/converts: text$lua -> table.lua1
-rw-r--r--root/$mmm/plugins/layout/converts: text$moonscript -> table.moon1
-rw-r--r--root/static/style/$order1
-rw-r--r--root/static/style/fonts/code_400: font$woff.woffbin0 -> 12772 bytes
-rw-r--r--root/static/style/fonts/code_400: font$woff2.woff2bin0 -> 9960 bytes
-rw-r--r--root/static/style/fonts/sans_200: font$woff.woffbin0 -> 25164 bytes
-rw-r--r--root/static/style/fonts/sans_200: font$woff2.woff2bin0 -> 19636 bytes
-rw-r--r--root/static/style/fonts/sans_400: font$woff.woffbin0 -> 26096 bytes
-rw-r--r--root/static/style/fonts/sans_400: font$woff2.woff2bin0 -> 20496 bytes
-rw-r--r--root/static/style/fonts/sans_400_i: font$woff.woffbin0 -> 25716 bytes
-rw-r--r--root/static/style/fonts/sans_400_i: font$woff2.woff2bin0 -> 20212 bytes
-rw-r--r--root/static/style/fonts/sans_600: font$woff.woffbin0 -> 26008 bytes
-rw-r--r--root/static/style/fonts/sans_600: font$woff2.woff2bin0 -> 20300 bytes
-rw-r--r--root/static/style/fonts/text$moonscript -> fn -> text$x-scss.moon47
-rw-r--r--root/static/style/reset/text$x-scss.scss3
15 files changed, 50 insertions, 3 deletions
diff --git a/root/$mmm/plugins/layout/converts: text$lua -> table.lua b/root/$mmm/plugins/layout/converts: text$lua -> table.lua
index 670f1c9..46fa32a 100644
--- a/root/$mmm/plugins/layout/converts: text$lua -> table.lua
+++ b/root/$mmm/plugins/layout/converts: text$lua -> table.lua
@@ -156,7 +156,6 @@ render = function(content, fileder, opts)
return [[<link rel="stylesheet" type="text/css" href="/static/style/:text/css" />]]
end
end)()
- buf = buf .. [[<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:200,400,600" />]]
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)
buf = buf .. (function()
if STATIC then
diff --git a/root/$mmm/plugins/layout/converts: text$moonscript -> table.moon b/root/$mmm/plugins/layout/converts: text$moonscript -> table.moon
index b3af5bd..eb59122 100644
--- a/root/$mmm/plugins/layout/converts: text$moonscript -> table.moon
+++ b/root/$mmm/plugins/layout/converts: text$moonscript -> table.moon
@@ -117,7 +117,6 @@ render = (content, fileder, opts={}) ->
<html>
<head>]]
buf ..= if STATIC then STATIC.style else [[<link rel="stylesheet" type="text/css" href="/static/style/:text/css" />]]
- buf ..= [[<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:200,400,600" />]]
buf ..= "
#{opts.meta}
#{get_scripts fileder}
diff --git a/root/static/style/$order b/root/static/style/$order
index 655aac7..29c97ca 100644
--- a/root/static/style/$order
+++ b/root/static/style/$order
@@ -1,3 +1,4 @@
+fonts
defs
reset
header
diff --git a/root/static/style/fonts/code_400: font$woff.woff b/root/static/style/fonts/code_400: font$woff.woff
new file mode 100644
index 0000000..5a12ef5
--- /dev/null
+++ b/root/static/style/fonts/code_400: font$woff.woff
Binary files differ
diff --git a/root/static/style/fonts/code_400: font$woff2.woff2 b/root/static/style/fonts/code_400: font$woff2.woff2
new file mode 100644
index 0000000..6fec74d
--- /dev/null
+++ b/root/static/style/fonts/code_400: font$woff2.woff2
Binary files differ
diff --git a/root/static/style/fonts/sans_200: font$woff.woff b/root/static/style/fonts/sans_200: font$woff.woff
new file mode 100644
index 0000000..7ee1a93
--- /dev/null
+++ b/root/static/style/fonts/sans_200: font$woff.woff
Binary files differ
diff --git a/root/static/style/fonts/sans_200: font$woff2.woff2 b/root/static/style/fonts/sans_200: font$woff2.woff2
new file mode 100644
index 0000000..01147e4
--- /dev/null
+++ b/root/static/style/fonts/sans_200: font$woff2.woff2
Binary files differ
diff --git a/root/static/style/fonts/sans_400: font$woff.woff b/root/static/style/fonts/sans_400: font$woff.woff
new file mode 100644
index 0000000..b6f56cf
--- /dev/null
+++ b/root/static/style/fonts/sans_400: font$woff.woff
Binary files differ
diff --git a/root/static/style/fonts/sans_400: font$woff2.woff2 b/root/static/style/fonts/sans_400: font$woff2.woff2
new file mode 100644
index 0000000..1916745
--- /dev/null
+++ b/root/static/style/fonts/sans_400: font$woff2.woff2
Binary files differ
diff --git a/root/static/style/fonts/sans_400_i: font$woff.woff b/root/static/style/fonts/sans_400_i: font$woff.woff
new file mode 100644
index 0000000..3c990ae
--- /dev/null
+++ b/root/static/style/fonts/sans_400_i: font$woff.woff
Binary files differ
diff --git a/root/static/style/fonts/sans_400_i: font$woff2.woff2 b/root/static/style/fonts/sans_400_i: font$woff2.woff2
new file mode 100644
index 0000000..14388eb
--- /dev/null
+++ b/root/static/style/fonts/sans_400_i: font$woff2.woff2
Binary files differ
diff --git a/root/static/style/fonts/sans_600: font$woff.woff b/root/static/style/fonts/sans_600: font$woff.woff
new file mode 100644
index 0000000..ce90d3a
--- /dev/null
+++ b/root/static/style/fonts/sans_600: font$woff.woff
Binary files differ
diff --git a/root/static/style/fonts/sans_600: font$woff2.woff2 b/root/static/style/fonts/sans_600: font$woff2.woff2
new file mode 100644
index 0000000..82b6c92
--- /dev/null
+++ b/root/static/style/fonts/sans_600: font$woff2.woff2
Binary files differ
diff --git a/root/static/style/fonts/text$moonscript -> fn -> text$x-scss.moon b/root/static/style/fonts/text$moonscript -> fn -> text$x-scss.moon
new file mode 100644
index 0000000..30419c2
--- /dev/null
+++ b/root/static/style/fonts/text$moonscript -> fn -> text$x-scss.moon
@@ -0,0 +1,47 @@
+import tourl from (require "mmm.mmmfs.util") require "mmm.dom"
+
+=>
+ link_font = (name) ->
+ "url('#{tourl @path, "#{name}: font/woff2"}') format('woff2'), url('#{tourl @path, "#{name}: font/woff"}') format('woff')"
+
+ "
+ /* source-sans-pro-200 - latin-ext_latin */
+ @font-face {
+ font-family: 'Source Sans Pro';
+ font-style: normal;
+ font-weight: 200;
+ src: local(''), #{link_font "sans_200"};
+ }
+
+ /* source-sans-pro-regular - latin-ext_latin */
+ @font-face {
+ font-family: 'Source Sans Pro';
+ font-style: normal;
+ font-weight: 400;
+ src: local(''), #{link_font "sans_400"};
+ }
+
+ /* source-sans-pro-italic - latin-ext_latin */
+ @font-face {
+ font-family: 'Source Sans Pro';
+ font-style: italic;
+ font-weight: 400;
+ src: local(''), #{link_font "sans_400i"};
+ }
+
+ /* source-sans-pro-600 - latin-ext_latin */
+ @font-face {
+ font-family: 'Source Sans Pro';
+ font-style: normal;
+ font-weight: 600;
+ src: local(''), #{link_font "sans_600"};
+ }
+
+ /* source-code-pro-regular - latin */
+ @font-face {
+ font-family: 'Source Code Pro';
+ font-style: normal;
+ font-weight: 400;
+ src: local(''), #{link_font "code_400"};
+ }
+ "
diff --git a/root/static/style/reset/text$x-scss.scss b/root/static/style/reset/text$x-scss.scss
index d157fcf..7537bd9 100644
--- a/root/static/style/reset/text$x-scss.scss
+++ b/root/static/style/reset/text$x-scss.scss
@@ -7,6 +7,7 @@
-moz-osx-font-smoothing: grayscale;
}
+body { font-family: 'Source Sans Pro'; }
body, html, h1, h2, h3, h4, h5, h6 {
margin: 0;
padding: 0;
@@ -24,7 +25,7 @@ input, select, button {
color: graytext;
}
}
-tt, code, kbd, samp { font-family: monospace; }
+tt, code, kbd, samp { font-family: 'Source Code Pro', monospace; }
code { font-size: 0.8em; }
b, strong { font-weight: bold; }
em, i { font-style: italic; }