mirror of
https://github.com/harttle/liquidjs.git
synced 2026-09-17 21:40:39 -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://coveralls.io/github/harttle/liquidjs?branch=master)
|
||||
[](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)
|
||||
|
||||
|
||||
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-apidoc.sh
|
||||
./bin/build-changelog.sh
|
||||
|
||||
cd docs
|
||||
npm ci
|
||||
npm run build
|
||||
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
|
||||
npm run index
|
||||
fi
|
||||
|
||||
+1
@@ -8,5 +8,6 @@
|
||||
</div>
|
||||
<div class="col" id="previewEl">{{__('playground.loading')}}</div>
|
||||
</div>
|
||||
<p class="inner version"></p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
+3
-2
@@ -1,6 +1,8 @@
|
||||
#playground
|
||||
background: white
|
||||
overflow: hidden
|
||||
.wrapper
|
||||
margin-bottom: 40px
|
||||
h1
|
||||
font-size: 36px
|
||||
font-weight: 300
|
||||
@@ -10,11 +12,10 @@
|
||||
display: flex
|
||||
flex-wrap: wrap;
|
||||
justify-content: space-between
|
||||
margin-bottom: 30px
|
||||
font-size: 1em
|
||||
.col
|
||||
flex: 1 1 100%
|
||||
margin-bottom: 30px
|
||||
margin-bottom: 10px
|
||||
|
||||
@media mq-normal
|
||||
.row
|
||||
|
||||
Vendored
+7
@@ -59,6 +59,7 @@
|
||||
// playground
|
||||
/* global liquidjs, ace */
|
||||
if (!location.pathname.match(/playground.html$/)) return;
|
||||
updateVersion(liquidjs.version);
|
||||
const engine = new liquidjs.Liquid();
|
||||
const editor = createEditor('editorEl', 'liquid');
|
||||
const dataEditor = createEditor('dataEl', 'json');
|
||||
@@ -121,6 +122,12 @@
|
||||
function utoa(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) {
|
||||
|
||||
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-typescript2": "^0.21.1",
|
||||
"rollup-plugin-uglify": "^5.0.2",
|
||||
"rollup-plugin-version-injector": "^1.3.3",
|
||||
"semantic-release": "^17.2.3",
|
||||
"sinon": "^7.5.0",
|
||||
"sinon-chai": "^3.3.0",
|
||||
|
||||
+31
-50
@@ -2,6 +2,7 @@ import { uglify } from 'rollup-plugin-uglify'
|
||||
import pkg from './package.json'
|
||||
import typescript from 'rollup-plugin-typescript2'
|
||||
import replace from 'rollup-plugin-replace'
|
||||
import versionInjector from 'rollup-plugin-version-injector'
|
||||
|
||||
const version = process.env.VERSION || pkg.version
|
||||
const sourcemap = true
|
||||
@@ -13,6 +14,28 @@ const banner = `/*
|
||||
const treeshake = {
|
||||
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 replaceFS = {
|
||||
include: './src/liquid-options.ts',
|
||||
@@ -32,16 +55,7 @@ const nodeCjs = {
|
||||
banner
|
||||
}],
|
||||
external: ['path', 'fs'],
|
||||
plugins: [typescript({
|
||||
tsconfigOverride: {
|
||||
include: [ 'src' ],
|
||||
exclude: [ 'test', 'benchmark' ],
|
||||
compilerOptions: {
|
||||
target: 'ES2017',
|
||||
module: 'ES2015'
|
||||
}
|
||||
}
|
||||
})],
|
||||
plugins: [versionInjection, typescript(tsconfig)],
|
||||
treeshake,
|
||||
input
|
||||
}
|
||||
@@ -53,16 +67,7 @@ const nodeEsm = {
|
||||
banner
|
||||
}],
|
||||
external: ['path', 'fs'],
|
||||
plugins: [typescript({
|
||||
tsconfigOverride: {
|
||||
include: [ 'src' ],
|
||||
exclude: [ 'test', 'benchmark' ],
|
||||
compilerOptions: {
|
||||
target: 'ES2017',
|
||||
module: 'ES2015'
|
||||
}
|
||||
}
|
||||
})],
|
||||
plugins: [versionInjection, typescript(tsconfig)],
|
||||
treeshake,
|
||||
input
|
||||
}
|
||||
@@ -75,18 +80,10 @@ const browserEsm = {
|
||||
}],
|
||||
external: ['path', 'fs'],
|
||||
plugins: [
|
||||
versionInjection,
|
||||
replace(replaceFS),
|
||||
replace(replaceStream),
|
||||
typescript({
|
||||
tsconfigOverride: {
|
||||
include: [ 'src' ],
|
||||
exclude: [ 'test', 'benchmark' ],
|
||||
compilerOptions: {
|
||||
target: 'ES2017',
|
||||
module: 'ES2015'
|
||||
}
|
||||
}
|
||||
})
|
||||
typescript(tsconfig)
|
||||
],
|
||||
treeshake,
|
||||
input
|
||||
@@ -101,18 +98,10 @@ const browserUmd = {
|
||||
banner
|
||||
}],
|
||||
plugins: [
|
||||
versionInjection,
|
||||
replace(replaceFS),
|
||||
replace(replaceStream),
|
||||
typescript({
|
||||
tsconfigOverride: {
|
||||
include: [ 'src' ],
|
||||
exclude: [ 'test', 'benchmark' ],
|
||||
compilerOptions: {
|
||||
target: 'es5',
|
||||
module: 'ES2015'
|
||||
}
|
||||
}
|
||||
})
|
||||
typescript(tsconfig)
|
||||
],
|
||||
treeshake,
|
||||
input
|
||||
@@ -126,18 +115,10 @@ const browserMin = {
|
||||
sourcemap
|
||||
}],
|
||||
plugins: [
|
||||
versionInjection,
|
||||
replace(replaceFS),
|
||||
replace(replaceStream),
|
||||
typescript({
|
||||
tsconfigOverride: {
|
||||
include: [ 'src' ],
|
||||
exclude: [ 'test', 'benchmark' ],
|
||||
compilerOptions: {
|
||||
target: 'es5',
|
||||
module: 'ES2015'
|
||||
}
|
||||
}
|
||||
}),
|
||||
typescript(tsconfig),
|
||||
uglify()
|
||||
],
|
||||
treeshake,
|
||||
|
||||
@@ -16,6 +16,7 @@ import { toPromise, toValue } from './util/async'
|
||||
|
||||
export * from './util/error'
|
||||
export * from './types'
|
||||
export const version = '[VI]{version}[/VI]'
|
||||
|
||||
export class Liquid {
|
||||
public readonly options: NormalizedFullOptions
|
||||
|
||||
Reference in New Issue
Block a user