本文介绍了将简单的.md文件转换为gitlab页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
有几个设置Gitlab页面的选项.他们中的大多数人都有很多很棒的工具.但这对我们来说并不是真正必要的.这就是为什么我们想知道是否可以将.MD
(readme.md)文件转换为单个Gitlab页面.因此我们可以用.MD
标记编写.
There are several options for setting up Gitlab pages. Most of them have a lot of awesome tools. But it is not really necessary for us. That's why we wondered if it was possible to convert a .MD
(readme.md) file to a single Gitlab page. So we can write in .MD
markup.
推荐答案
我编写了一个脚本,该脚本将md文件转换为html,然后将其上传到主机上.
I have written a script which converts the md file to html and then uploads it on a host.
image: node:4.2.2
variables:
HOST: "myhost"
USERNAME: "myusername"
PASSWORD: "mypassword"
pages:
stage: deploy
script:
- npm install -g markdown-styles -y
- generate-md --input ./ --output ./output --layout mixu-bootstrap-2col
- cd output
- pwd
- ls
- apt-get update -qq && apt-get install -y -qq lftp
- lftp -c "set ftp:ssl-allow no; open -u $USERNAME,$PASSWORD $HOST; mirror -Rnev ./ ./www -e --delete-first --parallel=10 --exclude-glob .git* --exclude .sh --exclude .gitlab-ci.yml --exclude /node_modules/*"
only:
- master
这篇关于将简单的.md文件转换为gitlab页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!