Jekyll降价显示不像原始和一般风格问题

时间:2017-08-20 13:01:17

标签: html css format markdown jekyll

我们有一个用markdown编写的博客文章,我们希望在GithubPages上托管的Jekyll页面上实现。

这里是帖子的降价代码摘录:

```python
import keras
```

**TensorFlow:**

```python
import tensorflow as tf
```

## Building the Model

**Keras:**

We can easily create linear to complex models through the [`sequential`](https://keras.io/models/sequential/) API, which stacks up layers in a linear fashion. For linear regression, we can write this as follow:

```python
from keras.models import Sequential
from keras.layers.core import Dense

model = Sequential()
model.add(Dense(units=1, activation="linear", input_dim=1))
```

* Keras includes many commonly used layers:
    - Regular `dense` layers for feed-forward neural networks
    - `Dropout`, `normalization` and `noise` layers to prevent overfitting and improve learning
    - Common `convolutional` and `pooling layers` (max and average) for CNNs
    - `Flatten` layers to add fully connected layers after convolutional nets
    - `Embedding` layers for Word2Vec problems
    - `Recurrent` layers (simpleRNN, GRU and LSTM) for RNNs
    - `Merge` layers to combine more than one neural net
    - Many more… you can also [write your own Keras layers](https://keras.io/layers/writing-your-own-keras-layers/)
* Many common activation functions are available like `relu`, `tanh` and `sigmoid` depending on the problem that you like to solve (read [“Yes you should understand backprop” by Andrej Karpathy](https://medium.com/@karpathy/yes-you-should-understand-backprop-e2f06eab496b) if you want to understand the effect of backpropagation on some activation functions)
* The activation function can also be passed through an `Activation` layer instead of the `activation` argument

Alternatively if you prefer one-liners, we could have also done something like this:

```python
model = Sequential([Dense(units=1, activation="linear", input_dim=1)])
```

Or we could have used [Keras’s functional API](https://keras.io/getting-started/functional-api-guide/):

```python
from keras.models import Model
from keras.layers import Dense, Input

以下是它的外观(在README.md中显示在Github上):

enter image description here

以下是我们的最终post.md在托管的Jekyll页面上的显示方式:

enter image description here

这是_config.yml:

title: BML
email:xxx@gmail.com
description: > # this means to ignore newlines until "baseurl:"
  Write an awesome description for your new site here. You can edit this
  line in _config.yml. It will appear in your document head meta (for
  Google search results) and in your feed.xml site description.
baseurl: "" # the subpath of your site, e.g. /blog
url: "" # the base hostname & protocol for your site, e.g. http://example.com
twitter_username: xyz
github_username:  xyz
future: true
# Build settings
markdown: kramdown
highlighter: rouge
theme: minima
gems:
  - jekyll-feed
exclude:
  - Gemfile
  - Gemfile.lock

我们花了几个小时来完成这项工作,到目前为止我们的结果和实现是:

  • 似乎没有合理的方法来实现用markdown写入Jekyll的帖子
  • 结果非常不愉快(列出搞砸了,代码块不太好,奇怪的间距和垂直距离)
  • 我必须实现一些syntax.css来设置代码块
  • Jekyll强迫我们使用kramdown
  • 没有很容易将markdown转换为kramdown(kramdown似乎在某些地方有不同的语法)

我也不知道,为什么,例如虽然列表在DOM中正确注册为ul li元素,但它们的呈现方式没有任何样式。 list-style: none;元素的<ul>来自呈现在网站头部的内联<style type="text/css">。真的不知道它来自哪里,主题可能是什么? enter image description here 没有这个样式标签,至少列表看起来更好......

我尝试过使用kramdown =“1”属性,玩弄缩进和其他几十个“技巧”和结构。

  1. 有没有简单的方法可以在Github上呈现真正的降价?
  2. 如何知道这个奇怪的样式标签来自哪里?如何排除它?
  3. 我目前正在处理的网站是: http://www.machinelearning.berlin

1 个答案:

答案 0 :(得分:1)

杰基尔真的很直白。不幸的是,一些聪明人(杰基尔的建筑师)决定创建主题并将它们与每个新项目捆绑在一起。这是一个很大的错误恕我直言。这导致许多人开始使用他们不理解的代码,更糟糕的是,他们不理解的结构。这句话完美地证明了这一点:

  

list-style:none;对于ul元素来自于呈现在网站头部的一些内联样式。真的不知道它的来源,主题可能是什么?

所以对于有类似问题并且知道基本HTML和CSS的人来说,这是一条消息:Jekyll非常简单。如果你从Jekyll开始,请不要使用主题。将项目空白。这种方法可以为您节省大量时间和挫折。此外,它将让您深入了解Jekyll是什么以及它是如何工作的。你以后会感谢我。

PS。回答你的问题:我可以向你保证,你的神秘代码属于你所选择的主题(不是)。