Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Bootstrap
bootstrap
Commits
c06a1f30
Commit
c06a1f30
authored
4 years ago
by
XhmikosR
Browse files
Options
Download
Email Patches
Plain Diff
Backport #30130
Add a script to zip the built examples
parent
1b16736a
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
_config.yml
+1
-0
_config.yml
build/zip-examples.js
+55
-0
build/zip-examples.js
package.json
+2
-1
package.json
site/_layouts/simple.html
+1
-0
site/_layouts/simple.html
site/docs/4.4/getting-started/download.md
+6
-0
site/docs/4.4/getting-started/download.md
with
65 additions
and
1 deletion
+65
-1
_config.yml
+
1
-
0
View file @
c06a1f30
...
@@ -51,6 +51,7 @@ icons: "https://icons.getbootstrap.com"
...
@@ -51,6 +51,7 @@ icons: "https://icons.getbootstrap.com"
download
:
download
:
source
:
"
https://github.com/twbs/bootstrap/archive/v4.4.1.zip"
source
:
"
https://github.com/twbs/bootstrap/archive/v4.4.1.zip"
dist
:
"
https://github.com/twbs/bootstrap/releases/download/v4.4.1/bootstrap-4.4.1-dist.zip"
dist
:
"
https://github.com/twbs/bootstrap/releases/download/v4.4.1/bootstrap-4.4.1-dist.zip"
dist_examples
:
"
https://github.com/twbs/bootstrap/releases/download/v4.4.1/bootstrap-4.4.1-examples.zip"
cdn
:
cdn
:
# See https://www.srihash.org for info on how to generate the hashes
# See https://www.srihash.org for info on how to generate the hashes
...
...
This diff is collapsed.
Click to expand it.
build/zip-examples.js
0 → 100644
+
55
-
0
View file @
c06a1f30
#!/usr/bin/env node
/*!
* Script to create the built examples zip archive;
* requires the `zip` command to be present!
* Copyright 2020 The Bootstrap Authors
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
*/
'
use strict
'
const
path
=
require
(
'
path
'
)
const
sh
=
require
(
'
shelljs
'
)
const
{
version
,
version_short
:
versionShort
}
=
require
(
'
../package.json
'
)
const
folderName
=
`bootstrap-
${
version
}
-examples`
sh
.
config
.
fatal
=
true
if
(
!
sh
.
test
(
'
-d
'
,
'
_gh_pages
'
))
{
throw
new
Error
(
'
The _gh_pages folder does not exist, did you forget building the docs?
'
)
}
// switch to the root dir
sh
.
cd
(
path
.
join
(
__dirname
,
'
..
'
))
// remove any previously created folder with the same name
sh
.
rm
(
'
-rf
'
,
folderName
)
sh
.
mkdir
(
'
-p
'
,
folderName
)
// copy the examples and dist folders; for the examples we use `*`
// so that its content are copied to the root dist dir
sh
.
cp
(
'
-Rf
'
,
[
`_gh_pages/docs/
${
versionShort
}
/examples/*`
,
`_gh_pages/docs/
${
versionShort
}
/dist/`
],
folderName
)
sh
.
rm
(
`
${
folderName
}
/index.html`
)
// sed-fu
sh
.
find
(
`
${
folderName
}
/**/*.html`
).
forEach
((
file
)
=>
{
sh
.
sed
(
'
-i
'
,
new
RegExp
(
`"/docs/
${
versionShort
}
/`
,
'
g
'
),
'
"../
'
,
file
)
sh
.
sed
(
'
-i
'
,
/
(
<link href="
\.\.\/
.*
)
integrity=".*>/g
,
'
$1>
'
,
file
)
sh
.
sed
(
'
-i
'
,
/
(
<script src="
\.\.\/
.*
)
integrity=".*>/g
,
'
$1></script>
'
,
file
)
})
// create the zip file
sh
.
exec
(
`zip -r9 "
${
folderName
}
.zip" "
${
folderName
}
"`
,
{
fatal
:
true
})
// remove the folder we created
sh
.
rm
(
'
-rf
'
,
folderName
)
This diff is collapsed.
Click to expand it.
package.json
+
2
-
1
View file @
c06a1f30
...
@@ -73,10 +73,11 @@
...
@@ -73,10 +73,11 @@
"docs-serve-only"
:
"npm run docs-serve -- --skip-initial-build --no-watch"
,
"docs-serve-only"
:
"npm run docs-serve -- --skip-initial-build --no-watch"
,
"lockfile-lint"
:
"lockfile-lint --allowed-hosts npm --allowed-schemes https: --empty-hostname false --type npm --path package-lock.json"
,
"lockfile-lint"
:
"lockfile-lint --allowed-hosts npm --allowed-schemes https: --empty-hostname false --type npm --path package-lock.json"
,
"update-deps"
:
"ncu -u -x
\"
jquery,karma-browserstack-launcher,popper.js,qunit,sinon
\"
&& npm update && bundle update && cross-env-shell echo Manually update
\\\"
site/docs/$npm_package_version_short/assets/js/vendor/
\\\"
"
,
"update-deps"
:
"ncu -u -x
\"
jquery,karma-browserstack-launcher,popper.js,qunit,sinon
\"
&& npm update && bundle update && cross-env-shell echo Manually update
\\\"
site/docs/$npm_package_version_short/assets/js/vendor/
\\\"
"
,
"release"
:
"npm-run-all dist release-sri
release-zip docs-production
"
,
"release"
:
"npm-run-all dist release-sri
docs-build release-zip*
"
,
"release-sri"
:
"node build/generate-sri.js"
,
"release-sri"
:
"node build/generate-sri.js"
,
"release-version"
:
"node build/change-version.js"
,
"release-version"
:
"node build/change-version.js"
,
"release-zip"
:
"cross-env-shell
\"
shx rm -rf bootstrap-$npm_package_version-dist && shx cp -r dist/ bootstrap-$npm_package_version-dist && zip -r9 bootstrap-$npm_package_version-dist.zip bootstrap-$npm_package_version-dist && shx rm -rf bootstrap-$npm_package_version-dist
\"
"
,
"release-zip"
:
"cross-env-shell
\"
shx rm -rf bootstrap-$npm_package_version-dist && shx cp -r dist/ bootstrap-$npm_package_version-dist && zip -r9 bootstrap-$npm_package_version-dist.zip bootstrap-$npm_package_version-dist && shx rm -rf bootstrap-$npm_package_version-dist
\"
"
,
"release-zip-examples"
:
"node build/zip-examples.js"
,
"dist"
:
"npm-run-all --parallel css js"
,
"dist"
:
"npm-run-all --parallel css js"
,
"test"
:
"npm-run-all lint dist js-test docs-compile docs-lint"
,
"test"
:
"npm-run-all lint dist js-test docs-compile docs-lint"
,
"netlify"
:
"npm-run-all dist release-sri docs-netlify"
,
"netlify"
:
"npm-run-all dist release-sri docs-netlify"
,
...
...
This diff is collapsed.
Click to expand it.
site/_layouts/simple.html
+
1
-
0
View file @
c06a1f30
...
@@ -8,6 +8,7 @@ layout: default
...
@@ -8,6 +8,7 @@ layout: default
<p
class=
"bd-lead"
>
{{ page.description | smartify }}
</p>
<p
class=
"bd-lead"
>
{{ page.description | smartify }}
</p>
{%- if page.title == "Examples" -%}
{%- if page.title == "Examples" -%}
<a
href=
"{{ site.download.source }}"
class=
"btn btn-lg btn-bd-primary"
onclick=
"ga('send', 'event', 'Examples', 'Hero', 'Download');"
>
Download source code
</a>
<a
href=
"{{ site.download.source }}"
class=
"btn btn-lg btn-bd-primary"
onclick=
"ga('send', 'event', 'Examples', 'Hero', 'Download');"
>
Download source code
</a>
<a
href=
"{{ site.download.dist_examples }}"
class=
"btn btn-lg btn-bd-primary mt-3 mt-sm-0 ml-sm-3 ml-md-5"
onclick=
"ga('send', 'event', 'Examples', 'Hero', 'Download Examples');"
>
Download Examples
</a>
{%- endif -%}
{%- endif -%}
</div>
</div>
{% include ads.html %}
{% include ads.html %}
...
...
This diff is collapsed.
Click to expand it.
site/docs/4.4/getting-started/download.md
+
6
-
0
View file @
c06a1f30
...
@@ -28,6 +28,12 @@ Should you require [build tools]({{ site.baseurl }}/docs/{{ site.docs_version }}
...
@@ -28,6 +28,12 @@ Should you require [build tools]({{ site.baseurl }}/docs/{{ site.docs_version }}
<a
href=
"{{ site.download.source }}"
class=
"btn btn-bd-primary"
onclick=
"ga('send', 'event', 'Getting started', 'Download', 'Download source');"
>
Download source
</a>
<a
href=
"{{ site.download.source }}"
class=
"btn btn-bd-primary"
onclick=
"ga('send', 'event', 'Getting started', 'Download', 'Download source');"
>
Download source
</a>
## Examples
If you want to download and examine our
[
examples
](
{{
site.baseurl }}/docs/{{ site.docs_version }}/examples/), you can grab the already built examples:
<a
href=
"{{ site.download.dist_examples }}"
class=
"btn btn-bd-primary"
onclick=
"ga('send', 'event', 'Getting started', 'Download', 'Download Examples');"
>
Download Examples
</a>
## BootstrapCDN
## BootstrapCDN
Skip the download with
[
BootstrapCDN
](
https://www.bootstrapcdn.com/
)
to deliver cached version of Bootstrap's compiled CSS and JS to your project.
Skip the download with
[
BootstrapCDN
](
https://www.bootstrapcdn.com/
)
to deliver cached version of Bootstrap's compiled CSS and JS to your project.
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment