Giter Club home page Giter Club logo

Comments (9)

RomanBogachev avatar RomanBogachev commented on August 18, 2024 1

For someone in future.
Add css code of new fonts to style.styl

@font-face
  font-family: 'Titillium Web'
  font-style: normal
  font-weight: 300
  src: local('Titillium WebLight'), local('TitilliumWeb-Light'), url(fonts/TitilliumWeb-Light-Latin-ext.woff2) format('woff2')
  "unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF"


@font-face
  font-family: 'Titillium Web'
  font-style: normal
  font-weight: 300
  src: local('Titillium WebLight'), local('TitilliumWeb-Light'), url(fonts/TitilliumWeb-Light-Latin.woff2) format('woff2')
  "unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000"

@font-face
  font-family: 'Titillium Web'
  font-style: normal
  font-weight: 400
  src: local('Titillium Web'), local('TitilliumWeb-Regular'), url(fonts/TitilliumWeb-Regular-latin-ext.woff2) format('woff2')
  "unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF"

@font-face
  font-family: 'Titillium Web'
  font-style: normal
  font-weight: 400
  src: local('Titillium Web'), local('TitilliumWeb-Regular'), url(fonts/TitilliumWeb-Regular-latin.woff2) format('woff2')
  "unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000"

@font-face
  font-family: 'Titillium Web'
  font-style: normal
  font-weight: 600
  src: local('Titillium WebSemiBold'), local('TitilliumWeb-SemiBold'), url(fonts/TitilliumWeb-SemiBold-latin-ext.woff2) format('woff2')
  "unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF"

@font-face
  font-family: 'Titillium Web'
  font-style: normal
  font-weight: 600
  src: local('Titillium WebSemiBold'), local('TitilliumWeb-SemiBold'), url(fonts/TitilliumWeb-SemiBold-latin.woff2) format('woff2')
  "unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000"

@font-face
  font-family: 'Source Code Pro'
  font-style: normal
  font-weight: 400
  src: local('Source Code Pro'), local('SourceCodePro-Regular'), url(fonts/SourceCodePro-Regular-latin-ext.woff2) format('woff2')
  "unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF"

@font-face
  font-family: 'Source Code Pro'
  font-style: normal
  font-weight: 400
  src: local('Source Code Pro'), local('SourceCodePro-Regular'), url(fonts/SourceCodePro-Regular-latin.woff2) format('woff2')
  "unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000"

Comment or delete next lines in head.ejs

  <link href='//fonts.useso.com/css?family=Titillium+Web:300,400,600' rel='stylesheet' type='text/css'>
  <link href="//fonts.useso.com/css?family=Source+Code+Pro" rel="stylesheet" type="text/css">

and do some changes in after-footer.ejs

- <!-- <script src="//ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script> -->
+ <script src="//ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>
- <script src="//libs.useso.com/js/jquery/2.0.3/jquery.min.js"></script> 
+ <!-- <script src="//libs.useso.com/js/jquery/2.0.3/jquery.min.js"></script> -->

Thank you @ppoffice
And another one question ;)

How i can change search engine on my site?
e.g. at custom google.

Now, when i try to search something (for example word: centos), i redirects to google page with request like this

site:http://my-site.com

The best option will be searching on own site without any redirects )

from hexo-theme-hueman.

ppoffice avatar ppoffice commented on August 18, 2024

If you are not worrying about your website's traffic, you can simply download these fonts and place them in your theme folder. In that way, you can provide custom fonts without additional CDNs.
For example, if you want to apply "Titillium Web" to your website, you can visit http://fonts.useso.com/css?family=Titillium+Web:300,400,600 or http://fonts.googleapis.com/css?family=Titillium+Web:300,400,600. Then you will see some css text like this:

/* latin-ext */
@font-face {
  font-family: 'Titillium Web';
  font-style: normal;
  font-weight: 300;
  src: local('Titillium WebLight'), local('TitilliumWeb-Light'), url(http://fonts.gstatic.com/s/titilliumweb/v4/anMUvcNT0H1YN4FII8wpr9INifKjd1RJ3NxxEi9Cy2w.woff2) format('woff2');
  unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Titillium Web';
  font-style: normal;
  font-weight: 300;
  src: local('Titillium WebLight'), local('TitilliumWeb-Light'), url(http://fonts.gstatic.com/s/titilliumweb/v4/anMUvcNT0H1YN4FII8wpr4-67659ICLY8bMrYhtePPA.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000;
}
/* latin-ext */
@font-face {
  font-family: 'Titillium Web';
  font-style: normal;
  font-weight: 400;
  src: local('Titillium Web'), local('TitilliumWeb-Regular'), url(http://fonts.gstatic.com/s/titilliumweb/v4/7XUFZ5tgS-tD6QamInJTcSo_WB_cotcEMUw1LsIE8mM.woff2) format('woff2');
  unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Titillium Web';
  font-style: normal;
  font-weight: 400;
  src: local('Titillium Web'), local('TitilliumWeb-Regular'), url(http://fonts.gstatic.com/s/titilliumweb/v4/7XUFZ5tgS-tD6QamInJTcZSnX671uNZIV63UdXh3Mg0.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000;
}
/* latin-ext */
@font-face {
  font-family: 'Titillium Web';
  font-style: normal;
  font-weight: 600;
  src: local('Titillium WebSemiBold'), local('TitilliumWeb-SemiBold'), url(http://fonts.gstatic.com/s/titilliumweb/v4/anMUvcNT0H1YN4FII8wpr_SNRT0fZ5CX-AqRkMYgJJo.woff2) format('woff2');
  unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Titillium Web';
  font-style: normal;
  font-weight: 600;
  src: local('Titillium WebSemiBold'), local('TitilliumWeb-SemiBold'), url(http://fonts.gstatic.com/s/titilliumweb/v4/anMUvcNT0H1YN4FII8wpr46gJz9aNFrmnwBdd69aqzY.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000;
}

Notice that each @font-face has a url attribute and you can download the font file from that url. After downloading font files, you can place them in a fonts folder inside your theme's css folder, and add the css text above to your theme's style.styl, with url replaced with your local fonts' relative path. After you have done that, the @font-face should be like this:

/* latin-ext */
@font-face {
  font-family: 'Titillium Web';
  font-style: normal;
  font-weight: 300;
  src: local('Titillium WebLight'), local('TitilliumWeb-Light'), url(fonts/Titillium+Web.woff2) format('woff2');
  unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF;
}
......

It should work when you finish all that. Good luck.

from hexo-theme-hueman.

RomanBogachev avatar RomanBogachev commented on August 18, 2024

I already trying to do it, but have some errors when generated.

[error] HexoError: Render failed: css/style.css
CoercionError: /srv/www/my-site/themes/hueman/source/css/style.styl:30
   26|   font-family: 'Titillium Web';
   27|   font-style: normal;
   28|   font-weight: 300;
   29|   src: local('Titillium WebLight'), local('TitilliumWeb-Light'), url(fonts/TitilliumWeb-Light-Latin-ext.woff2) format('woff2');
 > 30|   unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF;
   31| }
   32| /* latin */
   33| @font-face {

cannot coerce 100 to ident

from hexo-theme-hueman.

ppoffice avatar ppoffice commented on August 18, 2024

You may try to add quotation mark to the unicode range or just delete that line.

from hexo-theme-hueman.

ppoffice avatar ppoffice commented on August 18, 2024

You can edit <%- search_form() %> in layout\_partial\header.ejs, and you may want to have a look at Swiftype.

from hexo-theme-hueman.

huberylee avatar huberylee commented on August 18, 2024

Greetings!
Could anyone tell me how to define subcategories and post an article to the subcategory? It is helpful a lot if you can show me an example.
Thank you!

from hexo-theme-hueman.

ppoffice avatar ppoffice commented on August 18, 2024

In the head of your post Markdown files, add

categories:
- cat
- child-cat

And then your subcategories should be created.

from hexo-theme-hueman.

huberylee avatar huberylee commented on August 18, 2024

I am so sorry for this very late reply. It works fine, thank you very much!

from hexo-theme-hueman.

bejondshao avatar bejondshao commented on August 18, 2024

Hi Guys,

In order to speed up the site, I disable the google fonts and useso fonts completely. I didn't add any fonts to local server and

  • set
use_google_apis: false  
google_analytics: false

in _config.yml

  • comment jquery in after-footer.ejs
<!--
  <script src="http://code.jquery.com/jquery-2.1.3.min.js"></script>
  -->
  • comment useso in themes/hueman/layout/_partial/head.ejs
<!--
    <link href='//fonts.useso.com/css?family=Titillium+Web:300,400,600' rel='stylesheet' type='text/css'>
    <link href="//fonts.useso.com/css?family=Source+Code+Pro" rel="stylesheet" type="text/css">
    -->

Then the site is faster than before. As I don't use any fonts and jquery, so the site is just for simple post. Be careful to do this action.

Bejond

from hexo-theme-hueman.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.