Search code examples
htmlcssfont-facegithub-pages

github page font and index.html not working


i created a repo on github fr my blog alireza.one and now i want to create a Persian blog and i have two problems:

First: font face doesn't load. i put an import line on my css but it doesn't load.

@import url('https://alireza.one/farsi/assets/type.css');

My Farsi (Persian) blog loads my main css but the font isn't loaded. My repository: alirezahy/farsi. My webpage: alireza.one/farsi

Second: My index.html (both in Farsi repo and alirezahy.github.io) is like this:

---
layout: default
title: Index
---


<div class="listing">
    {% for post in paginator.posts %}
    <div class="post other link">
      <h2></span> <a href="{{site.url}}{{post.url}}">{{ post.title }}</a></h2>
      <p class="post-date">{{ post.date | date_to_string }}</p>
    </div>
    {% endfor %}
</div>

How can i make it to a normal index.html so my front page appears like a normal weblog not as a site page.


Solution

  • If you want to add a font, you would need to add it like this in your css file:

    @font-face {
    font-family: "myFont";
    src: url(fontofallknowledge.woff);
    }
    

    And then you can use the font by using it like this

    body{
    font-family: "myFont";
    }
    

    You would use the @import to import stylesheets.

    To answer your second question, you seem to be using php in your .html file. You cannot do this.