Convert a simple .md file to a gitlab page

拈花ヽ惹草 提交于 2019-12-11 16:57:57

问题


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.


回答1:


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


来源:https://stackoverflow.com/questions/54023038/convert-a-simple-md-file-to-a-gitlab-page

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!