mirror of
https://github.com/harttle/liquidjs.git
synced 2026-10-02 16:45:14 -07:00
docs: add version info in playground.html
This commit is contained in:
@@ -3,7 +3,6 @@
|
|||||||
[](https://www.npmjs.org/package/liquidjs)
|
[](https://www.npmjs.org/package/liquidjs)
|
||||||
[](https://coveralls.io/github/harttle/liquidjs?branch=master)
|
[](https://coveralls.io/github/harttle/liquidjs?branch=master)
|
||||||
[](https://github.com/harttle/liquidjs/actions/workflows/check.yml?query=branch%3Amaster)
|
[](https://github.com/harttle/liquidjs/actions/workflows/check.yml?query=branch%3Amaster)
|
||||||
[](https://david-dm.org/harttle/liquidjs)
|
|
||||||
[](https://github.com/harttle/liquidjs/blob/master/LICENSE)
|
[](https://github.com/harttle/liquidjs/blob/master/LICENSE)
|
||||||
[](https://github.com/harttle/liquidjs)
|
[](https://github.com/harttle/liquidjs)
|
||||||
|
|
||||||
|
|||||||
Executable
+15
@@ -0,0 +1,15 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
cd docs
|
||||||
|
cp ../CHANGELOG.md source/tutorials/changelog.md
|
||||||
|
sed -i \
|
||||||
|
-e 's/{%/{% raw %}{%{% endraw %}/g' \
|
||||||
|
-e 's/{{/{% raw %}{{{% endraw %}/g' \
|
||||||
|
-e '1 s/"/\"/g' \
|
||||||
|
-e '1 s/</\</g' \
|
||||||
|
-e '1 s/>/\>/g' \
|
||||||
|
source/tutorials/changelog.md
|
||||||
|
cp source/tutorials/changelog.md source/zh-cn/tutorials/changelog.md
|
||||||
|
|
||||||
|
sed -i '1i ---\ntitle: Changelog\nauto: true\n---\n' source/tutorials/changelog.md
|
||||||
|
sed -i '1i ---\ntitle: 更新日志\nauto: true\n---\n' source/zh-cn/tutorials/changelog.md
|
||||||
+1
-13
@@ -2,25 +2,13 @@
|
|||||||
|
|
||||||
./bin/build-contributors.sh
|
./bin/build-contributors.sh
|
||||||
./bin/build-apidoc.sh
|
./bin/build-apidoc.sh
|
||||||
|
./bin/build-changelog.sh
|
||||||
|
|
||||||
cd docs
|
cd docs
|
||||||
npm ci
|
npm ci
|
||||||
npm run build
|
npm run build
|
||||||
cp CNAME public/
|
cp CNAME public/
|
||||||
|
|
||||||
cp ../CHANGELOG.md source/tutorials/changelog.md
|
|
||||||
sed -i \
|
|
||||||
-e 's/{%/{% raw %}{%{% endraw %}/g' \
|
|
||||||
-e 's/{{/{% raw %}{{{% endraw %}/g' \
|
|
||||||
-e '1 s/"/\"/g' \
|
|
||||||
-e '1 s/</\</g' \
|
|
||||||
-e '1 s/>/\>/g' \
|
|
||||||
source/tutorials/changelog.md
|
|
||||||
cp source/tutorials/changelog.md source/zh-cn/tutorials/changelog.md
|
|
||||||
|
|
||||||
sed -i '1i ---\ntitle: Changelog\nauto: true\n---\n' source/tutorials/changelog.md
|
|
||||||
sed -i '1i ---\ntitle: 更新日志\nauto: true\n---\n' source/zh-cn/tutorials/changelog.md
|
|
||||||
|
|
||||||
if [ "$HEXO_ALGOLIA_INDEXING_KEY" != "" ]; then
|
if [ "$HEXO_ALGOLIA_INDEXING_KEY" != "" ]; then
|
||||||
npm run index
|
npm run index
|
||||||
fi
|
fi
|
||||||
|
|||||||
+1
@@ -8,5 +8,6 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="col" id="previewEl">{{__('playground.loading')}}</div>
|
<div class="col" id="previewEl">{{__('playground.loading')}}</div>
|
||||||
</div>
|
</div>
|
||||||
|
<p class="inner version"></p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
+3
-2
@@ -1,6 +1,8 @@
|
|||||||
#playground
|
#playground
|
||||||
background: white
|
background: white
|
||||||
overflow: hidden
|
overflow: hidden
|
||||||
|
.wrapper
|
||||||
|
margin-bottom: 40px
|
||||||
h1
|
h1
|
||||||
font-size: 36px
|
font-size: 36px
|
||||||
font-weight: 300
|
font-weight: 300
|
||||||
@@ -10,11 +12,10 @@
|
|||||||
display: flex
|
display: flex
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
justify-content: space-between
|
justify-content: space-between
|
||||||
margin-bottom: 30px
|
|
||||||
font-size: 1em
|
font-size: 1em
|
||||||
.col
|
.col
|
||||||
flex: 1 1 100%
|
flex: 1 1 100%
|
||||||
margin-bottom: 30px
|
margin-bottom: 10px
|
||||||
|
|
||||||
@media mq-normal
|
@media mq-normal
|
||||||
.row
|
.row
|
||||||
|
|||||||
Vendored
+7
@@ -59,6 +59,7 @@
|
|||||||
// playground
|
// playground
|
||||||
/* global liquidjs, ace */
|
/* global liquidjs, ace */
|
||||||
if (!location.pathname.match(/playground.html$/)) return;
|
if (!location.pathname.match(/playground.html$/)) return;
|
||||||
|
updateVersion(liquidjs.version);
|
||||||
const engine = new liquidjs.Liquid();
|
const engine = new liquidjs.Liquid();
|
||||||
const editor = createEditor('editorEl', 'liquid');
|
const editor = createEditor('editorEl', 'liquid');
|
||||||
const dataEditor = createEditor('dataEl', 'json');
|
const dataEditor = createEditor('dataEl', 'json');
|
||||||
@@ -121,6 +122,12 @@
|
|||||||
function utoa(str) {
|
function utoa(str) {
|
||||||
return btoa(unescape(encodeURIComponent(str)));
|
return btoa(unescape(encodeURIComponent(str)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function updateVersion(version) {
|
||||||
|
document.querySelector('.version').innerHTML = `
|
||||||
|
liquidjs@<a target="_blank" href="https://www.npmjs.com/package/liquidjs/v/${version}">${version}</a>
|
||||||
|
`
|
||||||
|
}
|
||||||
}());
|
}());
|
||||||
|
|
||||||
if ('serviceWorker' in navigator) {
|
if ('serviceWorker' in navigator) {
|
||||||
|
|||||||
Generated
+154
-22644
File diff suppressed because it is too large
Load Diff
@@ -98,6 +98,7 @@
|
|||||||
"rollup-plugin-replace": "^2.1.0",
|
"rollup-plugin-replace": "^2.1.0",
|
||||||
"rollup-plugin-typescript2": "^0.21.1",
|
"rollup-plugin-typescript2": "^0.21.1",
|
||||||
"rollup-plugin-uglify": "^5.0.2",
|
"rollup-plugin-uglify": "^5.0.2",
|
||||||
|
"rollup-plugin-version-injector": "^1.3.3",
|
||||||
"semantic-release": "^17.2.3",
|
"semantic-release": "^17.2.3",
|
||||||
"sinon": "^7.5.0",
|
"sinon": "^7.5.0",
|
||||||
"sinon-chai": "^3.3.0",
|
"sinon-chai": "^3.3.0",
|
||||||
|
|||||||
+31
-50
@@ -2,6 +2,7 @@ import { uglify } from 'rollup-plugin-uglify'
|
|||||||
import pkg from './package.json'
|
import pkg from './package.json'
|
||||||
import typescript from 'rollup-plugin-typescript2'
|
import typescript from 'rollup-plugin-typescript2'
|
||||||
import replace from 'rollup-plugin-replace'
|
import replace from 'rollup-plugin-replace'
|
||||||
|
import versionInjector from 'rollup-plugin-version-injector'
|
||||||
|
|
||||||
const version = process.env.VERSION || pkg.version
|
const version = process.env.VERSION || pkg.version
|
||||||
const sourcemap = true
|
const sourcemap = true
|
||||||
@@ -13,6 +14,28 @@ const banner = `/*
|
|||||||
const treeshake = {
|
const treeshake = {
|
||||||
propertyReadSideEffects: false
|
propertyReadSideEffects: false
|
||||||
}
|
}
|
||||||
|
const tsconfig = {
|
||||||
|
tsconfigOverride: {
|
||||||
|
include: [ 'src' ],
|
||||||
|
exclude: [ 'test', 'benchmark' ],
|
||||||
|
compilerOptions: {
|
||||||
|
target: 'es5',
|
||||||
|
module: 'ES2015'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
const versionInjection = versionInjector({
|
||||||
|
injectInComments: false,
|
||||||
|
injectInTags: {
|
||||||
|
fileRegexp: /\.(ts|js|html|css)$/,
|
||||||
|
tagId: 'VI',
|
||||||
|
dateFormat: 'mmmm d, yyyy HH:MM:ss'
|
||||||
|
},
|
||||||
|
packageJson: './package.json',
|
||||||
|
logLevel: 'info',
|
||||||
|
logger: console,
|
||||||
|
exclude: []
|
||||||
|
})
|
||||||
const input = './src/liquid.ts'
|
const input = './src/liquid.ts'
|
||||||
const replaceFS = {
|
const replaceFS = {
|
||||||
include: './src/liquid-options.ts',
|
include: './src/liquid-options.ts',
|
||||||
@@ -32,16 +55,7 @@ const nodeCjs = {
|
|||||||
banner
|
banner
|
||||||
}],
|
}],
|
||||||
external: ['path', 'fs'],
|
external: ['path', 'fs'],
|
||||||
plugins: [typescript({
|
plugins: [versionInjection, typescript(tsconfig)],
|
||||||
tsconfigOverride: {
|
|
||||||
include: [ 'src' ],
|
|
||||||
exclude: [ 'test', 'benchmark' ],
|
|
||||||
compilerOptions: {
|
|
||||||
target: 'ES2017',
|
|
||||||
module: 'ES2015'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})],
|
|
||||||
treeshake,
|
treeshake,
|
||||||
input
|
input
|
||||||
}
|
}
|
||||||
@@ -53,16 +67,7 @@ const nodeEsm = {
|
|||||||
banner
|
banner
|
||||||
}],
|
}],
|
||||||
external: ['path', 'fs'],
|
external: ['path', 'fs'],
|
||||||
plugins: [typescript({
|
plugins: [versionInjection, typescript(tsconfig)],
|
||||||
tsconfigOverride: {
|
|
||||||
include: [ 'src' ],
|
|
||||||
exclude: [ 'test', 'benchmark' ],
|
|
||||||
compilerOptions: {
|
|
||||||
target: 'ES2017',
|
|
||||||
module: 'ES2015'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})],
|
|
||||||
treeshake,
|
treeshake,
|
||||||
input
|
input
|
||||||
}
|
}
|
||||||
@@ -75,18 +80,10 @@ const browserEsm = {
|
|||||||
}],
|
}],
|
||||||
external: ['path', 'fs'],
|
external: ['path', 'fs'],
|
||||||
plugins: [
|
plugins: [
|
||||||
|
versionInjection,
|
||||||
replace(replaceFS),
|
replace(replaceFS),
|
||||||
replace(replaceStream),
|
replace(replaceStream),
|
||||||
typescript({
|
typescript(tsconfig)
|
||||||
tsconfigOverride: {
|
|
||||||
include: [ 'src' ],
|
|
||||||
exclude: [ 'test', 'benchmark' ],
|
|
||||||
compilerOptions: {
|
|
||||||
target: 'ES2017',
|
|
||||||
module: 'ES2015'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
],
|
],
|
||||||
treeshake,
|
treeshake,
|
||||||
input
|
input
|
||||||
@@ -101,18 +98,10 @@ const browserUmd = {
|
|||||||
banner
|
banner
|
||||||
}],
|
}],
|
||||||
plugins: [
|
plugins: [
|
||||||
|
versionInjection,
|
||||||
replace(replaceFS),
|
replace(replaceFS),
|
||||||
replace(replaceStream),
|
replace(replaceStream),
|
||||||
typescript({
|
typescript(tsconfig)
|
||||||
tsconfigOverride: {
|
|
||||||
include: [ 'src' ],
|
|
||||||
exclude: [ 'test', 'benchmark' ],
|
|
||||||
compilerOptions: {
|
|
||||||
target: 'es5',
|
|
||||||
module: 'ES2015'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
],
|
],
|
||||||
treeshake,
|
treeshake,
|
||||||
input
|
input
|
||||||
@@ -126,18 +115,10 @@ const browserMin = {
|
|||||||
sourcemap
|
sourcemap
|
||||||
}],
|
}],
|
||||||
plugins: [
|
plugins: [
|
||||||
|
versionInjection,
|
||||||
replace(replaceFS),
|
replace(replaceFS),
|
||||||
replace(replaceStream),
|
replace(replaceStream),
|
||||||
typescript({
|
typescript(tsconfig),
|
||||||
tsconfigOverride: {
|
|
||||||
include: [ 'src' ],
|
|
||||||
exclude: [ 'test', 'benchmark' ],
|
|
||||||
compilerOptions: {
|
|
||||||
target: 'es5',
|
|
||||||
module: 'ES2015'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}),
|
|
||||||
uglify()
|
uglify()
|
||||||
],
|
],
|
||||||
treeshake,
|
treeshake,
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ import { toPromise, toValue } from './util/async'
|
|||||||
|
|
||||||
export * from './util/error'
|
export * from './util/error'
|
||||||
export * from './types'
|
export * from './types'
|
||||||
|
export const version = '[VI]{version}[/VI]'
|
||||||
|
|
||||||
export class Liquid {
|
export class Liquid {
|
||||||
public readonly options: NormalizedFullOptions
|
public readonly options: NormalizedFullOptions
|
||||||
|
|||||||
Reference in New Issue
Block a user