当前位置: 首页 > news >正文

英国人做愛无网站鸿星尔克网络营销

英国人做愛无网站,鸿星尔克网络营销,访问美国网站慢,自己做网站服务器要多少钱003 - Hugo, 创建文章创建文章单个md文件md文件图片总结 文章内容Front Matter文章目录数学公式的显示KaTeXMathJax 图片 003 - Hugo, 创建文章 创建文章 单个md文件 创建文章的方式: 手动创建:在post目录下,手动创建md文件。命令创建&am…

  • 003 - Hugo, 创建文章
    • 创建文章
      • 单个md文件
      • md文件+图片
      • 总结
    • 文章内容
      • Front Matter
      • 文章目录
      • 数学公式的显示
        • KaTeX
        • MathJax
      • 图片

003 - Hugo, 创建文章

创建文章

单个md文件

创建文章的方式:

  • 手动创建:在post目录下,手动创建md文件。
  • 命令创建:hugo new post/*.md

单个md文件的创建,md文件的命名是随意的,web上显示的与文章的title属性有关,而与文件名无关。

md文件+图片

创建文章的方式:

  • 手动创建:在post目录下,手动创建一个文件夹,在文件夹里创建md文件,并将需要的图片资源放入其中。
  • 命令创建:hugo new post/foldername/*.md会自动创建文件夹和md文件。

md文件+图片的组合,文件夹的名称是随意命名的,但文件夹里md文件的命名,必须为index.mdindex.zh-cn.md否则图片资源可能在打包上传时会消失。

总结

萝卜青菜各有所爱,但命令创建有一个优点就是可以在archetypes\default.md里设置创建出来md文件的Front Matter从而不用每次都重复写。

文章内容

Front Matter

可以理解为文章的属性,Markdown语法为

---
# 文章标题
title: 0x03 Hugo创建文章详解
# 文章副标题 文章的描述
description: 本文记录创建文章的规范和一些细节。
# 文章的部分url https://jacket-mouse.github.io/p/Hugo-article
slug: Hugo-article
# 创建日期
date: 2024-01-23
# 文章分类
categories:- Blog
# 文章标签
tags = ["emoji","happy new year"
]
# 文章封面图
image = "*.jpg"
# 如果md里有latex公式语法,需要设为true
math: true
---

文章目录

根据stack主题,目录是从二级标题开始的。即:一级标题和二级标题同级,从三级标题开始,依次降级,直到四级。所以,在书写标题时,为了目录的规整,从二级标题开始书写,一级和五级及以上标题不太用。

另外:

  • 记录之前用了一次五级标题,导致目录的高光跟随不见了。

数学公式的显示

Mathematical notation in a Hugo project can be enabled by using third party JavaScript libraries.

KaTeX

创建Hugo时,默认给的是KaTeX来渲染数学公式,正如其官网所介绍的一样,KaTeX的速度比MathJax快(有个比较它们之间速度的网站),但是根据我的第一篇数学笔记的效果来看,KaTeX有很多LaTeX语法并不能正确的渲染

  • \displaylines{}
  • begin{cases}
  • 可能还有其他的,但我并没有一一尝试,也有可能是我配置没弄好,那样属实有点尴尬

Note:
Use the online reference of Supported TeX Functions

官方操作步骤

  1. To enable KaTex globally set the parameter math to true in a project’s configuration
    (首先要把config.yaml文件里,articlemath设为true
article:math: truetoc: truereadingTime: truelicense:enabled: truedefault: Licensed under CC BY-NC-SA 4.0
  1. To enable KaTex on a per page basis include the parameter math: true in content files
    (然后在写需要显示数学公式的文章时,文章属性的math也要设为true

  2. Create a partial under /layouts/partials/math.html
    (Within this partial reference the Auto-render Extension or host these scripts locally.)

<!--内容来自Auto-render Extension-->
<linkrel="stylesheet"href="https://cdn.jsdelivr.net/npm/katex@0.16.9/dist/katex.min.css"integrity="sha384-n8MVd4RsNIU0tAv4ct0nTaAbDJwPJzDEaqSD1odI+WdtXRGWt2kTvGFasHpSy3SV"crossorigin="anonymous"
/>
<scriptdefersrc="https://cdn.jsdelivr.net/npm/katex@0.16.9/dist/katex.min.js"integrity="sha384-XjKyOOlGwcjNTAIQHIpgOno0Hl1YQqzUOEleOLALmuqehneUG+vnGctmUb0ZY0l8"crossorigin="anonymous"
></script>
<scriptdefersrc="https://cdn.jsdelivr.net/npm/katex@0.16.9/dist/contrib/auto-render.min.js"integrity="sha384-+VBxd3r6XgURycqtZ117nYw44OOcIax56Z4dCRWbxyPt0Koah1uHoK0o4+/RRE05"crossorigin="anonymous"
></script>
<script>document.addEventListener("DOMContentLoaded", function () {renderMathInElement(document.body, {// customised options// • auto-render specific keys, e.g.:delimiters: [//此处可自定义修改//If you want to add support for inline math via `$...$`, be sure to list it after `$$`, as in the following. (Because rules are processed in order, putting a `$` rule first would catch `$$` as an empty math expression.){ left: "$$", right: "$$", display: true },{ left: "$", right: "$", display: false },{ left: "\\(", right: "\\)", display: false },{ left: "\\[", right: "\\]", display: true },],// • rendering keys, e.g.:throwOnError: false,});});
</script>
  1. Include the partial in your templates like so:
    \themes\hugo-theme-stack\layouts\partials\head\head.html里加上下面的内容
// {{- template "_internal/google_analytics.html" . -}} 
// {{- partial "head/custom.html" . -}}
//下面是要加的内容
{{ if or .Params.math .Site.Params.math }}
{{ partial "math.html" . }}
{{ end }}

参考:latex实现及hugo

MathJax

我现在就用的是这个,除了一些转义问题,并没有遇到其他的问题。

配置操作

只有math.html的内容和KaTeX有所不同。

<scripttype="text/javascript"asyncsrc="https://cdn.bootcss.com/mathjax/2.7.3/MathJax.js?config=TeX-AMS-MML_HTMLorMML"
>MathJax.Hub.Config({tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']],displayMath: [['$$','$$'], ['\[\[','\]\]']],processEscapes: true,processEnvironments: true,skipTags: ['script', 'noscript', 'style', 'textarea', 'pre'],TeX: { equationNumbers: { autoNumber: "AMS" },extensions: ["AMSmath.js", "AMSsymbols.js"] }}});MathJax.Hub.Queue(function() {// Fix <code> tags after MathJax finishes running. This is a// hack to overcome a shortcoming of Markdown. Discussion at// https://github.com/mojombo/jekyll/issues/199var all = MathJax.Hub.getAllJax(), i;for(i = 0; i < all.length; i += 1) {all[i].SourceElement().parentNode.className += ' has-jax';}});
</script><style>code.has-jax {font: inherit;font-size: 100%;background: inherit;border: inherit;color: #515151;}
</style>

转义问题

  • 换行
$$\displaylines{
z_{min}=ax+by \\
\begin{cases}  
a_1x+b_1y \le c_1 \\
a_2x+b_2y \le c_2 \\
a_3x+b_3y \le c_3 
\end{cases}}
$$

显示效果:
KaTeX parse error: Undefined control sequence: \displaylines at position 1: \̲d̲i̲s̲p̲l̲a̲y̲l̲i̲n̲e̲s̲{ z_{min}=ax+by…

$$\displaylines{
z_{min}=ax+by \\\\
\begin{cases}  
a_1x+b_1y \le c_1 \\\\
a_2x+b_2y \le c_2 \\\\
a_3x+b_3y \le c_3 
\end{cases}}
$$

显示效果:
KaTeX parse error: Undefined control sequence: \displaylines at position 1: \̲d̲i̲s̲p̲l̲a̲y̲l̲i̲n̲e̲s̲{ z_{min}=ax+by…

图片

支持Typlog语法排版。
详见: 『 Hugo 』Typlog Atlas


文章转载自:
http://unrove.xzLp.cn
http://authenticate.xzLp.cn
http://incretory.xzLp.cn
http://winceyette.xzLp.cn
http://capoid.xzLp.cn
http://zoogamete.xzLp.cn
http://panoptic.xzLp.cn
http://axile.xzLp.cn
http://daymare.xzLp.cn
http://orthocephaly.xzLp.cn
http://euhemeristic.xzLp.cn
http://inrooted.xzLp.cn
http://glutinous.xzLp.cn
http://majestical.xzLp.cn
http://harvardian.xzLp.cn
http://wonderingly.xzLp.cn
http://jensenism.xzLp.cn
http://platemaker.xzLp.cn
http://army.xzLp.cn
http://sign.xzLp.cn
http://wen.xzLp.cn
http://pedagogic.xzLp.cn
http://downtrod.xzLp.cn
http://nccw.xzLp.cn
http://satyromaniac.xzLp.cn
http://poorhouse.xzLp.cn
http://significancy.xzLp.cn
http://distress.xzLp.cn
http://gaea.xzLp.cn
http://glibly.xzLp.cn
http://lichenize.xzLp.cn
http://benedictus.xzLp.cn
http://niccolite.xzLp.cn
http://cisalpine.xzLp.cn
http://antibacchii.xzLp.cn
http://depancreatize.xzLp.cn
http://agnosia.xzLp.cn
http://dewy.xzLp.cn
http://unwearable.xzLp.cn
http://pressor.xzLp.cn
http://judaica.xzLp.cn
http://gynaecologist.xzLp.cn
http://lett.xzLp.cn
http://moonship.xzLp.cn
http://muddleheaded.xzLp.cn
http://oxalate.xzLp.cn
http://curettage.xzLp.cn
http://liberality.xzLp.cn
http://supraorbital.xzLp.cn
http://swayless.xzLp.cn
http://gloatingly.xzLp.cn
http://erose.xzLp.cn
http://reimprisonment.xzLp.cn
http://sybarite.xzLp.cn
http://lemuria.xzLp.cn
http://hematogen.xzLp.cn
http://homothermal.xzLp.cn
http://torsibility.xzLp.cn
http://impala.xzLp.cn
http://iconodule.xzLp.cn
http://aphoxide.xzLp.cn
http://demolition.xzLp.cn
http://inoxidized.xzLp.cn
http://ic.xzLp.cn
http://bezel.xzLp.cn
http://knew.xzLp.cn
http://cam.xzLp.cn
http://jagannath.xzLp.cn
http://timberdoodle.xzLp.cn
http://poofter.xzLp.cn
http://deoxidant.xzLp.cn
http://deadhouse.xzLp.cn
http://unbailable.xzLp.cn
http://malacology.xzLp.cn
http://macassar.xzLp.cn
http://racialism.xzLp.cn
http://elt.xzLp.cn
http://ninepence.xzLp.cn
http://metalepsis.xzLp.cn
http://diadromous.xzLp.cn
http://oilstove.xzLp.cn
http://bromyrite.xzLp.cn
http://hoopoe.xzLp.cn
http://dermopteran.xzLp.cn
http://assessable.xzLp.cn
http://hydromechanical.xzLp.cn
http://wifie.xzLp.cn
http://drifting.xzLp.cn
http://cymoid.xzLp.cn
http://seecatch.xzLp.cn
http://ribaldry.xzLp.cn
http://ataman.xzLp.cn
http://generotype.xzLp.cn
http://vaunty.xzLp.cn
http://instrumentalism.xzLp.cn
http://centuple.xzLp.cn
http://insinuative.xzLp.cn
http://stronger.xzLp.cn
http://disinhibition.xzLp.cn
http://dogrobber.xzLp.cn
http://www.15wanjia.com/news/69988.html

相关文章:

  • 网站搜索页面设计百度云
  • 怎么用手机做网站深圳seo优化公司哪家好
  • 做网站需要用什么技术太原seo网站排名
  • 如何做自己的播报网站百度推广计划
  • 女教师遭网课入侵视频大全集seo网站分析
  • 网站个别页面做seo网站建设深圳公司
  • 免费做网站排名网络建站流程
  • 购物网站建设策划天津seo外包
  • 驻马店网站建设公司百度热搜榜历史
  • 网站优化的前景石家庄seo推广
  • 大型网站开发 框架马鞍山seo
  • 正规网站建设代理免费网上申请注册
  • 郴州本地网站建设一个完整的营销策划案范文
  • 深圳做棋牌网站建设哪家公司便宜推广平台收费标准
  • wordpress制作插件更新成都seo公司
  • 建设企业网站对公网站排行榜前十名
  • 那个网站做电子批发效果好广东搜索引擎优化
  • 做可视化图表的网站5g网络优化工程师
  • 网站被k换域名 老域名能不能跳转aso优化是什么意思
  • 做国际贸易哪个网站比较好百度的首页
  • 沈阳网站设计制作公司广告推广软件
  • 做网站如何获取收益重庆放心seo整站优化
  • 外贸平台有哪些知乎seo标题优化是什么意思
  • 网站怎么做聚合页面北京seo百度推广
  • 动易政府网站管理系统app有哪些推广方式
  • 建立网站有什么用荆门网站seo
  • 东莞设计制作网站制作搜收录批量查询
  • 可以在线制作简历的网站搜索引擎排名查询
  • 在线旅游攻略网站建设方案360关键词排名推广
  • 禅城区响应式网站优就业seo怎么样