diff --git a/_config.theme.yml b/_config.theme.yml index dddf8fa..bf17e33 100644 --- a/_config.theme.yml +++ b/_config.theme.yml @@ -3,21 +3,21 @@ version: 2.0.0 # Path or URL to the website's icon favicon: /images/favicon.svg # Path or URL to RSS atom.xml -rss: +rss: # Path or URL to the website's logo to be shown on the left of the navigation bar or footer logo: /images/logo.svg # Open Graph metadata (https://hexo.io/docs/helpers.html#open-graph) open_graph: # Facebook App ID - fb_app_id: + fb_app_id: # Facebook Admin ID - fb_admins: + fb_admins: # Twitter ID - twitter_id: + twitter_id: # Twitter site - twitter_site: + twitter_site: # Google+ profile link - google_plus: + google_plus: # Navigation bar link settings navbar: # Navigation bar menu links @@ -75,8 +75,8 @@ widgets: author: PPOffice author_title: Web Developer location: Earth, Solar System - avatar: - gravatar: + avatar: + gravatar: follow_link: 'http://github.com/ppoffice' social_links: Github: @@ -136,9 +136,10 @@ plugins: # Baidu Analytics plugin settings (http://ppoffice.github.io/hexo-theme-icarus/2018/01/01/plugin/Analytics/#Baidu-Analytics) baidu-analytics: # Baidu Analytics tracking id - tracking_id: + tracking_id: hotjar: site_id: 1067642 + progressbar: true # CDN provider settings providers: # Name or URL of the JavaScript and/or stylesheet CDN provider @@ -147,4 +148,3 @@ providers: fontcdn: google # Name or URL of the webfont Icon CDN provider iconcdn: fontawesome - \ No newline at end of file diff --git a/source/_posts/theme/Custom-CDN.md b/source/_posts/theme/Custom-CDN.md new file mode 100644 index 0000000..05ad45f --- /dev/null +++ b/source/_posts/theme/Custom-CDN.md @@ -0,0 +1,95 @@ +title: Speed up Your Site with Custom CDN +date: 2018-10-16 +toc: true +categories: +- Configuration +- Theme +tags: +- Advanced Topics +--- + +Using a right CDN provider can speed up page loading process of your viewers. Icarus allows you to specify the CDN provider of third-party static libraries you want to use. + +### Built-in CDN providers +Currently, you can choose between these built-in providers: + +- **General CDNs** + - CDN.js (cdnjs) + - jsDelivr (jsdelivr) + - Unpkg (unpkg) +- **Font CDNs** + - Google Fonts (google) +- **Icon Font CDNs** + - Font Awesome (fontawesome) + + + +The default CDN settings are: + +```yml +providers: + cdn: jsdelivr + fontcdn: google + iconcdn: fontawesome +``` + +### Custom CDN providers +Additionally, you can also use custom CDN providers by putting their URLs in the configuration file. For **general CDNs**, you should provide a URL format string with the following format: + +``` +https://some.cdn.domain.name/${package}/${version}/${filename} +``` + +You need to replace the actual package name, version of the package and relative file path with `${package}`, `${version}`, and `${filename}` placeholders. For example, a JavaScript library with the following URL + +``` +https://unpkg.com/d3@5.7.0/dist/d3.min.js +``` + +can be generalized to this + +``` +https://unpkg.com/${package}@${version}/${filename} +``` + +You should know that CDN providers may adopt different URL schemes where the package name and file path for a library are not exactly the same. For example, the `moment.js` library has the URL like this on CDN.js: + +``` +https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.22.2/moment.js +``` + +while has the following URL on Unpkg: + +``` +https://unpkg.com/moment@2.22.2/min/moment.min.js +``` + +Therefore, you should be aware of the URL format of your custom CDN provider. By default, Icarus will try to pass in the parameter just like they would be for an npm repository (e.g., `moment@2.22.2/min/moment.min.js`). This npm scheme is used by jsDelivr and Unpkg. Otherwise, if you are using a CDN.js like provider, please prepend `[cdnjs]` to its format string: + +``` +[cdnjs]https://some.cdn.domain.name/${package}/${version}/${filename} +``` + +For **font CDN**, you can pass in the URL of a Google Font mirror or compatible webfont CDN. Icarus depends on the `Ubuntu` and `Source Code Pro` fonts, so make sure your CDN provides those. The URL should have two placeholders for font type (`icon` or `font`) and font name: + +``` +https://some.google.font.mirror/${type}?family=${fontname} +``` + +For **icon CDN**, you can pass in the URL to a custom Font Awesome CDN. No placeholders are required. The provided custom CDN should at lease have Font Awesome 5 icons as some of them are used in this theme. + +``` +https://custom.fontawesome.mirror/some.stylesheet.css +``` + +All of the above should be put in the `provider` section of theme configuration file: + +```yml +providers: + cdn: 'https://some.cdn.domain.name/${package}/${version}/${filename}' + fontcdn: 'https://some.google.font.mirror/${type}?family=${fontname}' + iconcdn: 'https://custom.fontawesome.mirror/some.stylesheet.css' +``` + +### CDN helper functions +Three helper functions have been defined to help developers include third-party libraries easily with custom CDN support. You can check them out in `includes/helpers/cdn.js` under the Icarus theme folder. diff --git a/source/_posts/translation/Arabic.md b/source/_posts/translation/Arabic.md index 9fb646c..35bdbd9 100644 --- a/source/_posts/translation/Arabic.md +++ b/source/_posts/translation/Arabic.md @@ -3,7 +3,7 @@ date: 2017-01-30 10:15:01 categories: - Translations comments: false -thumbnail: /gallery/thumbnails/arabic-pyramid.jpg +thumbnail: /gallery/thumbnails/mosque.jpg meta: - name="robots";content="noindex, follow" direction: rtl @@ -27,3 +27,5 @@ direction: rtl كل فمرّ وانتهاءً حين. شاسعة مهمّات ايطاليا، قد قبل, وتم هو أعلنت بلديهما, أي فقامت التنازلي اليابان، دار. ثم ضمنها الإمتعاض بريطانيا-فرنسا على, قد حول وقرى استدعى. أوروبا ألمانيا ٣٠ يبق. عرض إذ احداث الصين. في بين ببعض ويكيبيديا،, وصل بسبب تحرير النفط بـ. التي ضمنها به، إذ, دارت مشروط أي حول, فقد عن فقامت الأرضية ماليزيا،. تنفّس انتهت يونيو شيء إذ, أي عدم لليابان الدولارات. وإقامة الخاطفة والمانيا عن حول. بل جُل أكثر والإتحاد, تم ضرب انتباه والإتحاد. من قامت انتهت دنو. + +unsplash-logoDan Freeman diff --git a/source/gallery/thumbnails/arabic-pyramid.jpg b/source/gallery/thumbnails/arabic-pyramid.jpg deleted file mode 100644 index b2db028..0000000 Binary files a/source/gallery/thumbnails/arabic-pyramid.jpg and /dev/null differ diff --git a/source/gallery/thumbnails/mosque.jpg b/source/gallery/thumbnails/mosque.jpg new file mode 100644 index 0000000..ecea686 Binary files /dev/null and b/source/gallery/thumbnails/mosque.jpg differ diff --git a/themes/icarus b/themes/icarus index 37c0d69..78f0eb9 160000 --- a/themes/icarus +++ b/themes/icarus @@ -1 +1 @@ -Subproject commit 37c0d69f08fc14c17325d815ef3f1b14ab533cc8 +Subproject commit 78f0eb9305128873c60532d6b034c3c63a1e9796