【问题标题】:using custom css from bootstrap 2 for pelican-bootstrap 3使用来自 bootstrap 2 的自定义 css 用于 pelican-bootstrap 3
【发布时间】:2023-03-13 22:40:02
【问题描述】:

我对 CSS 和 pelican 都很陌生! 基本上,我想有一个使用 pelican 的静态网站,它看起来像基于 Bootstrap 2 制作的网站 X。我已经安装并现在使用 pelican-bootstrap 3(同样,我使用的是 bootstrap 3)。我检查了网站 X,我可以看到“style.css”。

我认为我需要在我的 pelican 博客中以某种方式使用此文件。因此,我在内容文件夹中创建了一个名为“css”的文件夹,并将 style.css 放在那里。

在pelicanconfig.py中,我做了这些改动,

THEME = '/home/mysite/pelican-bootstrap3'
BOOTSTRAP_THEME = 'simplex' 
PYGMENTS_STYLE = 'simplex'

CUSTOM_CSS = 'css/style.css' ##
STATIC_PATHS = ['images', 'css/style.css'] ##if I am not mistaken I am specifying the address inside my content folder.

但是,我没有看到任何变化,当我检查我的博客元素时,style.css 有所不同(可能是基于单工编写的)

我的问题在这里 1) 配置参数是否正确设置? 2) 将 bootstrap2 中的其他 css 文件复制并粘贴到这个主题中听起来合理吗? (我知道我需要稍微调整一下)。 3)我感谢任何评论

【问题讨论】:

    标签: css twitter-bootstrap-3 pelican


    【解决方案1】:

    免责声明:我是 Pelican 的 pelican-bootstrap3 主题的作者。

    如果我理解正确,您希望基于 Pelican 的网站看起来像 Bootstrap 2 网站。如果确实如此,那么使用 pelican-bootstrap3 是没有意义的,因为顾名思义,它基于 Bootstrap 3,看起来与 Bootstrap 2 不同。此外,为了CUSTOM_CSS 变量要在主题中完全起作用,您还必须告诉 Pelican 将 css 文件复制到哪里,如下所示:

    EXTRA_PATH_METADATA = {
        'extra/custom.css': {'path': 'css/custom.css'}
    }
    

    即使你这样做了,你仍然不会得到你所说的“网站 X”的外观,因为 Bootstrap 3(主题所基于)中的 HTML 与 Bootstrap 中的 HTML 的结构不同2.

    我的建议:使用 pelican-themes 存储库中为数不多的基于 Bootstra 2 的主题之一。

    【讨论】:

      猜你喜欢
      • 2020-12-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-12-10
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多