最小深色皮肤可以在 github 页面上使用吗?

问题描述 投票:0回答:4

我正在尝试通过 Jekyll 和 GitHub Pages 建立一个博客。然而,部署它并不是什么大问题,在尝试遵循here描述的步骤时,我只设法让它在本地显示深色皮肤。有没有办法也将其部署到 GithubPages 上? 我通过

安装了它
gem "minima", git: "https://github.com/jekyll/minima"

然后在

_config.yml

中添加以下两行
minima:
  skin: dark

是保存 ruby 代码的存储库。

jekyll github-pages
4个回答
9
投票

我也遇到这个问题了。我了解到 github 页面使用的软件不经常更新,希望是出于稳定性原因。您可以在https://pages.github.com/versions/查看他们使用的版本。新版本的 minima 有替代的“皮肤”sass/css 功能,但当前 github 页面上的功能没有——哎呀,github 页面还没有将 Jekyll 更新到 v4!!...你应该能够通过单击 github 存储库上的

Actions
查看构建错误,然后单击最后一个“工作流程”,然后单击红色的
build
。它会在
skin: dark
行上说配置文件中的密钥不存在或类似的内容。

无论如何,在配置文件中添加

remote_theme: jekyll/minima
以在重建时强制从 github 存储库下载最新版本。不要使用〜
jekyll-theme: minima
(或任何名称)。事实上,目前,所有预装在 github 页面上的主题都已经很老了......

但实际上,请使用 jekyll 讨论网站 https://talk.jekyllrb.com/.


1
投票

您可以更进一步,让您的 jekyll/minima 驱动的网站尊重用户的主题偏好 https://alexander-taran.github.io/2022/06/08/adopting-dark-theme-in-jekyll-blog.html


0
投票

我使用的是 Chrome,显然最后一小时内的

Clear browsing data
Cookies and other site data
Cached images and files
已检查,使本地更新显示为实时状态。


0
投票

我对这个问题的回答中的最少有用信息:https://stackoverflow.com/a/78095155/5874274

您可以将Minima主题设置为深色皮肤(或适应系统设置的皮肤)。目前 github-pages 上使用的 minima 主题 (2.5.1) 版本不支持此功能,但在(截至 2024 年)未发布的 minima 3 中可用。

# In _config.yml
# theme: minima
remote_theme: jekyll/minima
plugins:
  - jekyll-remote-theme
minima:
  skin: dark # or auto if you want it to switch with your system settings.

<!-- in 404.html -->
---
permalink: /404.html
layout: base 
---
<!-- Rest of the file here -->
© www.soinside.com 2019 - 2024. All rights reserved.