如何将 image/figure 与 Hugo 居中对齐(转到静态站点生成器)?

How to align-center an image/figure with Hugo (go static site generator)?

我正在寻找适用于 hugo server 命令的解决方案。我知道我可以在 static/css 目录中创建一个额外的 .css 文件,并使用 hugo 命令将其合并到 public 目录中,但这不适用于 hugo server 不幸的是。

提前致谢。

Hugo Pipes, you have an example with "Hugo Pipes Revolution -- A Hugo built-in asset pipeline" from Regis Philibert上举一些例子。

From now on, Hugo will take care of bundling, minifying, fingerprinting our assets and even compiling our sass files! All of this without any external build tools.

所以它适用于 hugo server
您可以在 assets:

中定义您的方法

These methods will only be available on files living in the assets directory: think of it as a static directory except the files will not be published by default.

Much like its static counterpart:

  • Its location is configurable with the assetDir key of your config.yaml. (will default to assets)
  • It follows the Hugo’s file unison logic.
    Meaning, anything in your project/assets will override homonymous files of your theme/assets.

从那里,您可以调整 sass centering techniques 之一以使用管道自动将其应用到您的图像上。
参见“Centering With Sass”。