Skip to content

thianda91/jekyll-xda-theme

Repository files navigation

X.Da 的博客

修改内容

variables.yml

_data/variables.yml,sources 下面新增 local

  local:
  # 如果使用本地静态文件,需要手动添加 site.baseurl 前缀
    font_awesome: '/assets/font_awesome/all.css'
    jquery: '/assets/jquery.min.js'

favicon.ico

根据 F12 修改对应路径下的 .ico.png

/asset/ 目录下

打开 _includes/svg/logo.svg,修改颜色:

.st0{fill:#00ce00;}

header

_includes\header.html line 17 增加sub-title显示site.description

<div class="site-sub-title">{{ site.description }}</div>

_sass\components\_header.scss line 83 增加样式

& > .site-sub-title {
      padding-left: 20px;
      display: inline-block;
      font-size: map-get($base, font-size-h4-xs);
      line-height: 1.5;
}

主题风格

_sass\skins\_default.scss中改成绿色:

$main-color-1:#50cf4d;

_sass\common\_variables.scss中:

content-max-width: 1050px;

_includes\tags.html line 22, Show All 改成 全部

_include\scripts\article.js里添加:

  document.querySelectorAll('a').forEach(link => {
    if (link.hostname !== window.location.hostname) {
      link.setAttribute('target', '_blank');
    }
  });

footer

模板_inclides\atticle-footer.html

<footer>中的<span> dateModified(page.modify_date)复制到

模版_layouts\article.html<div class="layout--article">里面。需要包含 {%- include -%}{%- if -%} 标签。并给 <span>标签 添加 class="dateModified"

模板_inclides\atticle-footer.html<footer class="article__footer">前面新增:

<hr style="background-color:#50cf4d;height:1px;width:40%;border:none;">

_sass\components\_main.scss

新增:.dateModified {color: $main-color-1;}

.full-widthwidth改为95%

主页摘要的下边框:

_includes\article-list.html中,在 line 81 </article>后面添加:

<div class="xda__border"></div>

_sass\layout\_home.scss最底部添加:

.xda__border {
    margin-top: 5px;
    height: 3px;
    background: linear-gradient(to right, #00cf4d 0%, #004c83 50%, #00cf4d 100%);
}

_sass/common/classes/_split-line.scss里,

删除 line 11( border: 0 solid $color;

路由

archive.html 移动到 archive\index.md

about.md 移动到 about\index.md

_data\navigation.yml里:

# 添加 
  - titles:
      zh      : &ZH_HANS  主页
    url: /
# ---------
/archive.html 改成 /archive
/about.html 改成 /about

修改 _config.yml

text_skin: dark

permalink: /:categories/:title/index.html

Gemfile

添加

gem 'wdm', '>= 0.1.0' if Gem.win_platform?

三方css本地化

放在 asserts 目录下:

# assets/font_awesome/all.css
https://cdn.bootcdn.net/ajax/libs/font-awesome/5.15.1/css/all.css

# assets/webfonts/fa-regular-400.woff2
https://cdn.bootcdn.net/ajax/libs/font-awesome/5.15.1/webfonts/fa-regular-400.woff2

# assets/webfonts/fa-solid-900.woff2
https://cdn.bootcdn.net/ajax/libs/font-awesome/5.15.1/webfonts/fa-solid-900.woff2

# /assets/jquery.min.js
https://cdn.bootcss.com/jquery/3.1.1/jquery.min.js

# 其他待补充

permalink 的效果

关于_config.yml 的配置 permalink,

about 页面 和 archive 页面

和文章地址一样随permalink的设置变化。<a> 链接会根据 _data\navigation.yml 配置生成。实际访问时自动根据 permalink 的配置跳转。

404页面

/:categories/:title/index.html

/:categories/:title

不一样。 虽然在 url 访问上都一样,但是 404 页面生成的结果不一样。 前者生成 /404.html。 显示正常。 后者生成 /404/index.html。 显示不正常。

/:categories/:title.html

/:categories/:title

效果一样。

无用文件

.editorconfig
.eslintrc
.stylelintignore
.stylelintrc
.travis.yml
HOW_TO_RELEASE.md

About

jekyll blog theme for myself

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors