Explorar el Código

initial commit!

master
Cian Butler hace 4 años
commit
2e11f743d8
Se han modificado 6 ficheros con 85 adiciones y 0 borrados
  1. +3
    -0
      .gitignore
  2. +26
    -0
      README.md
  3. +17
    -0
      index.js
  4. +17
    -0
      package.json
  5. +15
    -0
      render.ejs
  6. +7
    -0
      yarn.lock

+ 3
- 0
.gitignore Ver fichero

@@ -0,0 +1,3 @@
.DS_Store
node_modules/
npm-debug.log

+ 26
- 0
README.md Ver fichero

@@ -0,0 +1,26 @@
# hexo-reveal
![MIT](https://img.shields.io/npm/l/express.svg)
![VERSION](https://img.shields.io/badge/version-1.0.3-green.svg)

Hexo tag for embeded reveal

## Install

```
$ npm install --save hexo-reveal
```
or
```
$ yarn add hexo-reveal
```

## Usage

```
{% reveal url [width] [height] %}
```

### Example
```
{% reveal https://redbrick.github.io/admin-training/docker/ 800 600 %}
```

+ 17
- 0
index.js Ver fichero

@@ -0,0 +1,17 @@
const ejs = require('ejs');
const path = require('path');
const fs = require('fs');

hexo.extend.tag.register('reveal', function(args){
const htmlTmlSrc = path.join(__dirname, 'render.ejs');
const htmlTml = ejs.compile(fs.readFileSync(htmlTmlSrc, 'utf-8'));

const width = args[1] || 800;
const height = args[2] || 600;

return htmlTml({
'src': args[0],
'width': width,
'height': height
});
})

+ 17
- 0
package.json Ver fichero

@@ -0,0 +1,17 @@
{
"name": "hexo-reveal",
"version": "1.0.3",
"main": "index.js",
"author": "butlerx",
"license": "MIT",
"dependencies": {
"ejs": "^2.5.6"
},
"description": "A Hexo tag extension which allows you to embed reveal.js slides on your posts",
"repository": "github.com/butlerx/hexo-reveal",
"keywords": [
"hexo",
"reveal.js",
"tag"
]
}

+ 15
- 0
render.ejs Ver fichero

@@ -0,0 +1,15 @@
<div class="slides" style="
position: relative;
padding-bottom: 56.25%;
padding-top: 35px;
height: 0;
overflow: hidden;
">
<iframe src="<%= src %>" width="<%= width %>" height="<%= height %>" frameborder="0" allowfullscreen="" style="
position: absolute;
top:0;
left: 0;
width: 100%;
height: 100%;
"></iframe>
</div>

+ 7
- 0
yarn.lock Ver fichero

@@ -0,0 +1,7 @@
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1


ejs@^2.5.6:
version "2.5.6"
resolved "https://registry.yarnpkg.com/ejs/-/ejs-2.5.6.tgz#479636bfa3fe3b1debd52087f0acb204b4f19c88"

Cargando…
Cancelar
Guardar