You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucenenet.apache.org by pa...@apache.org on 2026/06/16 19:43:26 UTC

(lucenenet) 09/23: fix: Self-host all external website dependencies (#1197)

This is an automated email from the ASF dual-hosted git repository.

paulirwin pushed a commit to branch release/4.8.0-beta00018
in repository https://gitbox.apache.org/repos/asf/lucenenet.git

commit 792acdfa54645f2a87080b0a13bdf70e6cc69e41
Author: Afrar Malakooth <mm...@gmail.com>
AuthorDate: Fri Oct 10 22:32:00 2025 +0800

    fix: Self-host all external website dependencies (#1197)
    
    * fix: Self-host all external website dependencies
    
    * fix: Resolve CSP violations by self-hosting fonts
    
    * fix: Revert images and update fonts to refer lucenenet-site
---
 .../partials/head-content.tmpl.partial             |  6 +--
 .../site/lucenetemplate/partials/head.tmpl.partial |  2 +-
 .../styles/academicons-1.8.0.min.css               |  1 +
 .../styles/font-awesome-4.7.0.min.css              |  4 ++
 websites/site/lucenetemplate/styles/fonts.css      | 46 ++++++++++++++++++++++
 5 files changed, 55 insertions(+), 4 deletions(-)

diff --git a/websites/site/lucenetemplate/partials/head-content.tmpl.partial b/websites/site/lucenetemplate/partials/head-content.tmpl.partial
index e63c0b481..0facbf62d 100644
--- a/websites/site/lucenetemplate/partials/head-content.tmpl.partial
+++ b/websites/site/lucenetemplate/partials/head-content.tmpl.partial
@@ -18,10 +18,10 @@
   {{#_enableSearch}}<meta property="docfx:rel" content="{{_rel}}">{{/_enableSearch}}
   {{#_enableNewTab}}<meta property="docfx:newtab" content="true">{{/_enableNewTab}}
 
-  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/academicons/1.8.0/css/academicons.min.css" integrity="sha512-GGGNUPDhnG8LEAEDsjqYIQns+Gu8RBs4j5XGlxl7UfRaZBhCCm5jenJkeJL8uPuOXGqgl8/H1gjlWQDRjd3cUQ==" crossorigin="anonymous">
-  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" integrity="sha512-SfTiTlX6kk+qitfevl/7LibUOeJWlt9rbyDn92a1DqWOw9vWG2MFoays0sgObmWazO5BQPiFucnnEAjpAB+/Sw==" crossorigin="anonymous">
+  <link rel="stylesheet" href="{{_rel}}styles/academicons-1.8.0.min.css">
+  <link rel="stylesheet" href="{{_rel}}styles/font-awesome-4.7.0.min.css">
 
-  <link rel="stylesheet" href="//fonts.googleapis.com/css?family=Lato:400,700%7CMerriweather%7CRoboto+Mono">
+  <link rel="stylesheet" href="/styles/fonts.css">
   <link rel="stylesheet" href="/styles/site.css">
 
 </head>
diff --git a/websites/site/lucenetemplate/partials/head.tmpl.partial b/websites/site/lucenetemplate/partials/head.tmpl.partial
index dfe3e4e72..0e96adfa6 100644
--- a/websites/site/lucenetemplate/partials/head.tmpl.partial
+++ b/websites/site/lucenetemplate/partials/head.tmpl.partial
@@ -18,7 +18,7 @@
   {{#_enableSearch}}<meta property="docfx:rel" content="{{_rel}}">{{/_enableSearch}}
   {{#_enableNewTab}}<meta property="docfx:newtab" content="true">{{/_enableNewTab}}
 
-  <link rel="stylesheet" href="//fonts.googleapis.com/css?family=Lato:400,700%7CMerriweather%7CRoboto+Mono">
+  <link rel="stylesheet" href="/styles/fonts.css">
   <link rel="stylesheet" href="/styles/site.css">
 
 </head>
diff --git a/websites/site/lucenetemplate/styles/academicons-1.8.0.min.css b/websites/site/lucenetemplate/styles/academicons-1.8.0.min.css
new file mode 100644
index 000000000..9ce3ead6c
--- /dev/null
+++ b/websites/site/lucenetemplate/styles/academicons-1.8.0.min.css
@@ -0,0 +1 @@
+@font-face{font-family:'Academicons';src:url('../fonts/academicons.eot?v=1.7.0');src:url('../fonts/academicons.eot?v=1.7.0') format('embedded-opentype'), url('../fonts/academicons.ttf?v=1.7.0') format('truetype'), url('../fonts/academicons.woff?v=1.7.0') format('woff'), url('../fonts/academicons.svg?v=1.7.0#academicons') format('svg');font-weight:normal;font-style:normal}.ai{display:inline-block;font:normal normal normal 14px/1 Academicons;font-size:inherit;text-rendering:auto;-webkit-fo [...]
\ No newline at end of file
diff --git a/websites/site/lucenetemplate/styles/font-awesome-4.7.0.min.css b/websites/site/lucenetemplate/styles/font-awesome-4.7.0.min.css
new file mode 100644
index 000000000..540440ce8
--- /dev/null
+++ b/websites/site/lucenetemplate/styles/font-awesome-4.7.0.min.css
@@ -0,0 +1,4 @@
+/*!
+ *  Font Awesome 4.7.0 by @davegandy - http://fontawesome.io - @fontawesome
+ *  License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License)
+ */@font-face{font-family:'FontAwesome';src:url('../fonts/fontawesome-webfont.eot?v=4.7.0');src:url('../fonts/fontawesome-webfont.eot?#iefix&v=4.7.0') format('embedded-opentype'),url('../fonts/fontawesome-webfont.woff2?v=4.7.0') format('woff2'),url('../fonts/fontawesome-webfont.woff?v=4.7.0') format('woff'),url('../fonts/fontawesome-webfont.ttf?v=4.7.0') format('truetype'),url('../fonts/fontawesome-webfont.svg?v=4.7.0#fontawesomeregular') format('svg');font-weight:normal;font-style:norma [...]
diff --git a/websites/site/lucenetemplate/styles/fonts.css b/websites/site/lucenetemplate/styles/fonts.css
new file mode 100644
index 000000000..933fadf65
--- /dev/null
+++ b/websites/site/lucenetemplate/styles/fonts.css
@@ -0,0 +1,46 @@
+@font-face {
+  font-family: 'Lato';
+  font-style: normal;
+  font-weight: 400;
+  src: url('https://lucenenet.apache.org/fonts/lato-v25-latin-regular.woff2') format('woff2');
+}
+
+@font-face {
+  font-family: 'Lato';
+  font-style: normal;
+  font-weight: 700;
+  src: url('https://lucenenet.apache.org/fonts/lato-v25-latin-bold.woff2') format('woff2');
+}
+
+@font-face {
+  font-family: 'Merriweather';
+  font-style: normal;
+  font-weight: 400;
+  src: url('https://lucenenet.apache.org/fonts/merriweather-v33-latin-regular.woff2') format('woff2');
+}
+
+@font-face {
+  font-family: 'Roboto Mono';
+  font-style: normal;
+  font-weight: 400;
+  src: url('https://lucenenet.apache.org/fonts/roboto-mono-v31-latin-regular.woff2') format('woff2');
+}
+
+@font-face {
+  font-family: 'Academicons';
+  src: url('https://lucenenet.apache.org/fonts/academicons.eot?v=1.8.0');
+  src: url('https://lucenenet.apache.org/fonts/academicons.woff?v=1.8.0') format('woff'),
+       url('https://lucenenet.apache.org/fonts/academicons.ttf?v=1.8.0') format('truetype'),
+       url('https://lucenenet.apache.org/fonts/academicons.svg?v=1.8.0#academicons') format('svg'),
+       url('https://lucenenet.apache.org/fonts/academicons.eot?v=1.8.0') format('embedded-opentype');
+}
+
+@font-face {
+  font-family: 'FontAwesome';
+  src: url('https://lucenenet.apache.org/fonts/fontawesome-webfont.eot?v=4.7.0');
+  src: url('https://lucenenet.apache.org/fonts/fontawesome-webfont.woff?v=4.7.0') format('woff'),
+       url('https://lucenenet.apache.org/fonts/fontawesome-webfont.woff2?v=4.7.0') format('woff2'),
+       url('https://lucenenet.apache.org/fonts/fontawesome-webfont.ttf?v=4.7.0') format('truetype'),
+       url('https://lucenenet.apache.org/fonts/fontawesome-webfont.svg?v=4.7.0#fontawesomeregular') format('svg'),
+       url('https://lucenenet.apache.org/fonts/fontawesome-webfont.eot?#iefix&v=4.7.0') format('embedded-opentype');
+}