mel*_*mel 7 hosting web-hosting reveal.js
我是所有这些Web开发的新手(我只知道在本地做事).我使用reveal.js进行了演示,我希望能够在线看到它(例如我的手机上).我知道我应该主持它,但我真的不知道该怎么做.我尝试使用幻灯片(reveal.js的在线编辑器)来做,但我不能添加脚本和这种东西(我在演示文稿中使用高级图表).如果你能给我一些建议,程序会很好.
Bru*_*ino 15
在GitHub上创建一个新的存储库
我们称之为reveal_HelloWorld
在本地计算机上克隆它:
git clone git@github.com:yourusername/reveal_HelloWorld.git
在本地计算机上克隆reveal.js:
git clone git@github.com:hakimel/reveal.js.git
在reveal_HelloWorld文件夹中移动reveal.js的内容
修改index.html文件
创建并切换到新分支
git checkout -b 'gh-pages'
推
git push
来自GitHub网站的repo设置:
你完成了.
幻灯片发布于reveal_HelloWorld.
截屏视频:https://vimeo.com/241196662
图片来源:Angelo Basile
作为一次性解决方案,Bruno的回答非常好。但是,如果用户想在GitHub Pages上托管多个演示文稿,则他们每次都需要重复该过程。另一种方法是将一个GitHub存储库用于多个演示。
步骤如下:
presentations在Linux中初始化git repo并链接到GitHub
mkdir presentations
cd presentations
git init
git remote add origin git@github.com:username/presentations.git
添加reveal.js为“远程”并拉出存储库
git remote add upstream git@github.com:hakimel/reveal.js.git
git pull upstream master
为您的演示文稿创建一个空分支并清理工作目录
git checkout --orphan my-fancy-presentation
git reset --hard
将演示文稿复制到当前文件夹并提交更改
cp path/to/my_fancy_presentation.html .
git add .
git commit -m 'Initial commit'
切换到此处并合并您的演示文稿
git checkout master
git merge my-fancy-presentation
将所有分支推送到GitHub
git push --all origin
设置GitHub Pages进行分支master并在以下位置欣赏您的演示https://username.github.io/presentations/my_fancy_presentation.html
现在,每当您要添加其他演示文稿时,只需重复步骤4-7。此外,只要您想更新reveal.js,就可以轻松进行git pull upstream master。
作为此方法的示例,请参见https://github.com/dougmvieira/presentations。