Jekyll 导入语法突出显示颜色方案

发布于 2025-01-20 02:11:48 字数 946 浏览 0 评论 0原文

Jekyll Minima 主题的语法突出显示在文件 _sass/_syntax-highlighting.scss 中定义。

从该文件复制的代码片段是:

  .c     { color: #998; font-style: italic } // Comment
  .err   { color: #a61717; background-color: #e3d2d2 } // Error
  .k     { font-weight: bold } // Keyword
  .o     { font-weight: bold } // Operator
  .cm    { color: #998; font-style: italic } // Comment.Multiline
  .cp    { color: #999; font-weight: bold } // Comment.Preproc
  .c1    { color: #998; font-style: italic } // Comment.Single
  .cs    { color: #999; font-weight: bold; font-style: italic } // Comment.Special
  .gd    { color: #000; background-color: #fdd } // Generic.Deleted
  .gd .x { color: #000; background-color: #faa } // Generic.Deleted.Specific
  .ge    { font-style: italic } // Generic.Emph

我想更改配色方案,例如更改为 Palenight 主题。一种方法是将代码从 _syntax-highlighting.scss 复制到我的站点存储库并手动更改颜色。

在 Jekyll 中执行此操作的常规方法是什么?有更有效的方法吗?

The syntax highlighting for Jekyll Minima theme is defined in the file _sass/_syntax-highlighting.scss.

A snippet of code copied from that file is:

  .c     { color: #998; font-style: italic } // Comment
  .err   { color: #a61717; background-color: #e3d2d2 } // Error
  .k     { font-weight: bold } // Keyword
  .o     { font-weight: bold } // Operator
  .cm    { color: #998; font-style: italic } // Comment.Multiline
  .cp    { color: #999; font-weight: bold } // Comment.Preproc
  .c1    { color: #998; font-style: italic } // Comment.Single
  .cs    { color: #999; font-weight: bold; font-style: italic } // Comment.Special
  .gd    { color: #000; background-color: #fdd } // Generic.Deleted
  .gd .x { color: #000; background-color: #faa } // Generic.Deleted.Specific
  .ge    { font-style: italic } // Generic.Emph

I want to change the colour scheme, for example, to the Palenight theme. One way to do this is to copy the code from _syntax-highlighting.scss to my site repository and change the colours manually.

What is the conventional way to do this in Jekyll? Is there a more efficient way?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

嗫嚅 2025-01-27 02:11:48

我认为这是常规方式。您从主题复制文件并在本地覆盖

I think this is the conventional way. You copy the file from the theme and override it locally

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文