diff --git a/api/router_static.go b/api/router_static.go index f8146f1..eb46e57 100644 --- a/api/router_static.go +++ b/api/router_static.go @@ -75,7 +75,7 @@ func staticRouterInit(router *mux.Router) error { return err } - for _, dir := range []string{"/js", "/css", "/images"} { + for _, dir := range []string{"/js", "/css", "/images", "/fonts"} { files, err := ioutil.ReadDir(os.Getenv("STATIC") + dir) if err != nil { logger.Errorf("cannot read directory %s%s: %v", os.Getenv("STATIC"), dir, err) diff --git a/frontend/fonts/source-sans-400-cyrillic-ext.woff2 b/frontend/fonts/source-sans-400-cyrillic-ext.woff2 new file mode 100644 index 0000000..6a1f337 Binary files /dev/null and b/frontend/fonts/source-sans-400-cyrillic-ext.woff2 differ diff --git a/frontend/fonts/source-sans-400-cyrillic.woff2 b/frontend/fonts/source-sans-400-cyrillic.woff2 new file mode 100644 index 0000000..470d33e Binary files /dev/null and b/frontend/fonts/source-sans-400-cyrillic.woff2 differ diff --git a/frontend/fonts/source-sans-400-greek-ext.woff2 b/frontend/fonts/source-sans-400-greek-ext.woff2 new file mode 100644 index 0000000..b561ef8 Binary files /dev/null and b/frontend/fonts/source-sans-400-greek-ext.woff2 differ diff --git a/frontend/fonts/source-sans-400-greek.woff2 b/frontend/fonts/source-sans-400-greek.woff2 new file mode 100644 index 0000000..3260634 Binary files /dev/null and b/frontend/fonts/source-sans-400-greek.woff2 differ diff --git a/frontend/fonts/source-sans-400-latin-ext.woff2 b/frontend/fonts/source-sans-400-latin-ext.woff2 new file mode 100644 index 0000000..7e8c634 Binary files /dev/null and b/frontend/fonts/source-sans-400-latin-ext.woff2 differ diff --git a/frontend/fonts/source-sans-400-latin.woff2 b/frontend/fonts/source-sans-400-latin.woff2 new file mode 100644 index 0000000..efa300c Binary files /dev/null and b/frontend/fonts/source-sans-400-latin.woff2 differ diff --git a/frontend/fonts/source-sans-400-vietnamese.woff2 b/frontend/fonts/source-sans-400-vietnamese.woff2 new file mode 100644 index 0000000..5e0f446 Binary files /dev/null and b/frontend/fonts/source-sans-400-vietnamese.woff2 differ diff --git a/frontend/fonts/source-sans-700-cyrillic-ext.woff2 b/frontend/fonts/source-sans-700-cyrillic-ext.woff2 new file mode 100644 index 0000000..fc0f0c4 Binary files /dev/null and b/frontend/fonts/source-sans-700-cyrillic-ext.woff2 differ diff --git a/frontend/fonts/source-sans-700-cyrillic.woff2 b/frontend/fonts/source-sans-700-cyrillic.woff2 new file mode 100644 index 0000000..5a11958 Binary files /dev/null and b/frontend/fonts/source-sans-700-cyrillic.woff2 differ diff --git a/frontend/fonts/source-sans-700-greek-ext.woff2 b/frontend/fonts/source-sans-700-greek-ext.woff2 new file mode 100644 index 0000000..9264306 Binary files /dev/null and b/frontend/fonts/source-sans-700-greek-ext.woff2 differ diff --git a/frontend/fonts/source-sans-700-greek.woff2 b/frontend/fonts/source-sans-700-greek.woff2 new file mode 100644 index 0000000..35198e6 Binary files /dev/null and b/frontend/fonts/source-sans-700-greek.woff2 differ diff --git a/frontend/fonts/source-sans-700-latin-ext.woff2 b/frontend/fonts/source-sans-700-latin-ext.woff2 new file mode 100644 index 0000000..a15b2c8 Binary files /dev/null and b/frontend/fonts/source-sans-700-latin-ext.woff2 differ diff --git a/frontend/fonts/source-sans-700-latin.woff2 b/frontend/fonts/source-sans-700-latin.woff2 new file mode 100644 index 0000000..52b6d69 Binary files /dev/null and b/frontend/fonts/source-sans-700-latin.woff2 differ diff --git a/frontend/fonts/source-sans-700-vietnamese.woff2 b/frontend/fonts/source-sans-700-vietnamese.woff2 new file mode 100644 index 0000000..86a42a2 Binary files /dev/null and b/frontend/fonts/source-sans-700-vietnamese.woff2 differ diff --git a/frontend/gulpfile.js b/frontend/gulpfile.js index f6bbb4c..0273491 100644 --- a/frontend/gulpfile.js +++ b/frontend/gulpfile.js @@ -14,6 +14,8 @@ const develPath = "build/devel/"; const prodPath = "build/prod/"; const scssSrc = "./sass/*.scss"; const cssDir = "css/"; +const fontsDir = "fonts/"; +const fontsGlob = fontsDir + "**/*"; const imagesDir = "images/"; const imagesGlob = imagesDir + "**/*"; const jsDir = "js/"; @@ -107,6 +109,14 @@ gulp.task("html-prod", function () { .pipe(gulp.dest(prodPath)) }); +gulp.task("fonts-devel", function () { + gulp.src([fontsGlob]).pipe(gulp.dest(develPath + fontsDir)); +}); + +gulp.task("fonts-prod", function () { + gulp.src([fontsGlob]).pipe(gulp.dest(prodPath + fontsDir)); +}); + gulp.task("images-devel", function () { gulp.src([imagesGlob]).pipe(gulp.dest(develPath + imagesDir)); }); @@ -142,5 +152,5 @@ gulp.task("lint", function () { .pipe(eslint.failAfterError()) }); -gulp.task("devel", ["scss-devel", "html-devel", "images-devel", "lint", "js-devel"]); -gulp.task("prod", ["scss-prod", "html-prod", "images-prod", "lint", "js-prod"]); +gulp.task("devel", ["scss-devel", "html-devel", "fonts-devel", "images-devel", "lint", "js-devel"]); +gulp.task("prod", ["scss-prod", "html-prod", "fonts-prod", "images-prod", "lint", "js-prod"]); diff --git a/frontend/sass/commento.scss b/frontend/sass/commento.scss index 3457f76..8634ec5 100644 --- a/frontend/sass/commento.scss +++ b/frontend/sass/commento.scss @@ -1,4 +1,4 @@ -@import url('https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,700'); +@import "source-sans.scss"; .commento-root-min-height { min-height: 350px; diff --git a/frontend/sass/source-sans.scss b/frontend/sass/source-sans.scss new file mode 100644 index 0000000..078c446 --- /dev/null +++ b/frontend/sass/source-sans.scss @@ -0,0 +1,112 @@ +/* cyrillic-ext */ +@font-face { + font-family: 'Source Sans Pro'; + font-style: normal; + font-weight: 400; + src: local('Source Sans Pro Regular'), local('SourceSansPro-Regular'), url([[[.CdnPrefix]]]/fonts/source-sans-400-cryllic-ext.woff2) format('woff2'); + unicode-range: U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; +} +/* cyrillic */ +@font-face { + font-family: 'Source Sans Pro'; + font-style: normal; + font-weight: 400; + src: local('Source Sans Pro Regular'), local('SourceSansPro-Regular'), url([[[.CdnPrefix]]]/fonts/source-sans-400-cryllic.woff2) format('woff2'); + unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; +} +/* greek-ext */ +@font-face { + font-family: 'Source Sans Pro'; + font-style: normal; + font-weight: 400; + src: local('Source Sans Pro Regular'), local('SourceSansPro-Regular'), url([[[.CdnPrefix]]]/fonts/source-sans-400-greek-ext.woff2) format('woff2'); + unicode-range: U+1F00-1FFF; +} +/* greek */ +@font-face { + font-family: 'Source Sans Pro'; + font-style: normal; + font-weight: 400; + src: local('Source Sans Pro Regular'), local('SourceSansPro-Regular'), url([[[.CdnPrefix]]]/fonts/source-sans-400-greek.woff2) format('woff2'); + unicode-range: U+0370-03FF; +} +/* vietnamese */ +@font-face { + font-family: 'Source Sans Pro'; + font-style: normal; + font-weight: 400; + src: local('Source Sans Pro Regular'), local('SourceSansPro-Regular'), url([[[.CdnPrefix]]]/fonts/source-sans-400-vietnamese.woff2) format('woff2'); + unicode-range: U+0102-0103, U+0110-0111, U+1EA0-1EF9, U+20AB; +} +/* latin-ext */ +@font-face { + font-family: 'Source Sans Pro'; + font-style: normal; + font-weight: 400; + src: local('Source Sans Pro Regular'), local('SourceSansPro-Regular'), url([[[.CdnPrefix]]]/fonts/source-sans-400-latin-ext.woff2) format('woff2'); + unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF; +} +/* latin */ +@font-face { + font-family: 'Source Sans Pro'; + font-style: normal; + font-weight: 400; + src: local('Source Sans Pro Regular'), local('SourceSansPro-Regular'), url([[[.CdnPrefix]]]/fonts/source-sans-400-latin.woff2) format('woff2'); + unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; +} +/* cyrillic-ext */ +@font-face { + font-family: 'Source Sans Pro'; + font-style: normal; + font-weight: 700; + src: local('Source Sans Pro Bold'), local('SourceSansPro-Bold'), url([[[.CdnPrefix]]]/fonts/source-sans-700-cryllic-ext.woff2) format('woff2'); + unicode-range: U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; +} +/* cyrillic */ +@font-face { + font-family: 'Source Sans Pro'; + font-style: normal; + font-weight: 700; + src: local('Source Sans Pro Bold'), local('SourceSansPro-Bold'), url([[[.CdnPrefix]]]/fonts/source-sans-700-cryllic.woff2) format('woff2'); + unicode-range: U+0700-045F, U+0490-0491, U+04B0-04B1, U+2116; +} +/* greek-ext */ +@font-face { + font-family: 'Source Sans Pro'; + font-style: normal; + font-weight: 700; + src: local('Source Sans Pro Bold'), local('SourceSansPro-Bold'), url([[[.CdnPrefix]]]/fonts/source-sans-700-greek-ext.woff2) format('woff2'); + unicode-range: U+1F00-1FFF; +} +/* greek */ +@font-face { + font-family: 'Source Sans Pro'; + font-style: normal; + font-weight: 700; + src: local('Source Sans Pro Bold'), local('SourceSansPro-Bold'), url([[[.CdnPrefix]]]/fonts/source-sans-700-greek.woff2) format('woff2'); + unicode-range: U+0370-03FF; +} +/* vietnamese */ +@font-face { + font-family: 'Source Sans Pro'; + font-style: normal; + font-weight: 700; + src: local('Source Sans Pro Bold'), local('SourceSansPro-Bold'), url([[[.CdnPrefix]]]/fonts/source-sans-700-vietnamese.woff2) format('woff2'); + unicode-range: U+0102-0103, U+0110-0111, U+1EA0-1EF9, U+20AB; +} +/* latin-ext */ +@font-face { + font-family: 'Source Sans Pro'; + font-style: normal; + font-weight: 700; + src: local('Source Sans Pro Bold'), local('SourceSansPro-Bold'), url([[[.CdnPrefix]]]/fonts/source-sans-700-latin-ext.woff2) format('woff2'); + unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF; +} +/* latin */ +@font-face { + font-family: 'Source Sans Pro'; + font-style: normal; + font-weight: 700; + src: local('Source Sans Pro Bold'), local('SourceSansPro-Bold'), url([[[.CdnPrefix]]]/fonts/source-sans-700-latin.woff2) format('woff2'); + unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; +}