github 页面字体和 index.html 不工作

github page font and index.html not working

我在我的博客 github 上创建了一个存储库 alireza.one,现在我想创建一个波斯语博客,但我有两个问题:

首先:字体不加载。我在我的 css 上放了一个导入行,但它没有加载。

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

我的波斯语(波斯语)博客加载了我的主 css 但字体未加载。我的存储库:alirezahy/farsi. My webpage: alireza.one/farsi

第二:我的 index.html(在波斯语回购和 alirezahy.github.io 中)是这样的:

---
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>

我怎样才能使它成为一个正常的 index.html 以便我的首页看起来像一个正常的博客而不是网站页面。

如果你想添加字体,你需要像这样在你的 css 文件中添加它:

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

然后就可以像这样使用字体了

body{
font-family: "myFont";
}

您将使用@import 导入样式表。

为了回答您的第二个问题,您似乎在 .html 文件中使用了 php。你不能这样做。