mirror of
https://github.com/modernweb-dev/rocket.git
synced 2026-03-22 15:54:02 +00:00
Compare commits
5 Commits
@mdjs/mdjs
...
@rocket/cl
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d08692c7f3 | ||
|
|
2b7f1ee719 | ||
|
|
3802778be4 | ||
|
|
26f4a1ebff | ||
|
|
81edf45fe2 |
@@ -5,7 +5,7 @@ For that reason Rocket creates those automatically with the title, parent title,
|
|||||||
|
|
||||||
It will look like this but with your logo:
|
It will look like this but with your logo:
|
||||||
|
|
||||||
<img src="{{ socialMediaImage }}" width="1200" height="630" alt="Social Media Image of this page" style="border: 1px solid #000" />
|
<img src="{{ socialMediaImage | url }}" width="1200" height="630" alt="Social Media Image of this page" style="border: 1px solid #000" />
|
||||||
|
|
||||||
There are multiple ways you can modify it.
|
There are multiple ways you can modify it.
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,13 @@
|
|||||||
# @rocket/cli
|
# @rocket/cli
|
||||||
|
|
||||||
|
## 0.6.3
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- 2b7f1ee: Add support for pathprefix
|
||||||
|
- Updated dependencies [2b7f1ee]
|
||||||
|
- @rocket/eleventy-plugin-mdjs-unified@0.4.1
|
||||||
|
|
||||||
## 0.6.2
|
## 0.6.2
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@rocket/cli",
|
"name": "@rocket/cli",
|
||||||
"version": "0.6.2",
|
"version": "0.6.3",
|
||||||
"publishConfig": {
|
"publishConfig": {
|
||||||
"access": "public"
|
"access": "public"
|
||||||
},
|
},
|
||||||
@@ -59,7 +59,7 @@
|
|||||||
"@11ty/eleventy-img": "^0.7.4",
|
"@11ty/eleventy-img": "^0.7.4",
|
||||||
"@rocket/building-rollup": "^0.2.0",
|
"@rocket/building-rollup": "^0.2.0",
|
||||||
"@rocket/core": "^0.1.2",
|
"@rocket/core": "^0.1.2",
|
||||||
"@rocket/eleventy-plugin-mdjs-unified": "^0.4.0",
|
"@rocket/eleventy-plugin-mdjs-unified": "^0.4.1",
|
||||||
"@rocket/eleventy-rocket-nav": "^0.3.0",
|
"@rocket/eleventy-rocket-nav": "^0.3.0",
|
||||||
"@rollup/plugin-babel": "^5.2.2",
|
"@rollup/plugin-babel": "^5.2.2",
|
||||||
"@rollup/plugin-node-resolve": "^11.0.1",
|
"@rollup/plugin-node-resolve": "^11.0.1",
|
||||||
@@ -67,7 +67,7 @@
|
|||||||
"@web/dev-server": "^0.1.4",
|
"@web/dev-server": "^0.1.4",
|
||||||
"@web/dev-server-rollup": "^0.3.2",
|
"@web/dev-server-rollup": "^0.3.2",
|
||||||
"@web/rollup-plugin-copy": "^0.2.0",
|
"@web/rollup-plugin-copy": "^0.2.0",
|
||||||
"check-html-links": "^0.2.1",
|
"check-html-links": "^0.2.2",
|
||||||
"command-line-args": "^5.1.1",
|
"command-line-args": "^5.1.1",
|
||||||
"command-line-usage": "^6.1.1",
|
"command-line-usage": "^6.1.1",
|
||||||
"fs-extra": "^9.0.1",
|
"fs-extra": "^9.0.1",
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<meta property="og:site_name" content="{{ site.name }}"/>
|
<meta property="og:site_name" content="{{ site.name }}"/>
|
||||||
<meta property="og:type" content="website"/>
|
<meta property="og:type" content="website"/>
|
||||||
|
|
||||||
<meta property="og:image" content="{{ socialMediaImage }}"/>
|
<meta property="og:image" content="{{ socialMediaImage | url }}"/>
|
||||||
<meta property="og:url" content="{{ page.url }}"/>
|
<meta property="og:url" content="{{ page.url | url }}"/>
|
||||||
|
|
||||||
<meta name="twitter:card" content="summary_large_image"/>
|
<meta name="twitter:card" content="summary_large_image"/>
|
||||||
|
|||||||
@@ -1,5 +1,13 @@
|
|||||||
# @rocket/eleventy-plugin-mdjs-unified
|
# @rocket/eleventy-plugin-mdjs-unified
|
||||||
|
|
||||||
|
## 0.4.1
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- 2b7f1ee: Add support for pathprefix
|
||||||
|
- Updated dependencies [2b7f1ee]
|
||||||
|
- @mdjs/core@0.7.1
|
||||||
|
|
||||||
## 0.4.0
|
## 0.4.0
|
||||||
|
|
||||||
### Minor Changes
|
### Minor Changes
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@rocket/eleventy-plugin-mdjs-unified",
|
"name": "@rocket/eleventy-plugin-mdjs-unified",
|
||||||
"version": "0.4.0",
|
"version": "0.4.1",
|
||||||
"publishConfig": {
|
"publishConfig": {
|
||||||
"access": "public"
|
"access": "public"
|
||||||
},
|
},
|
||||||
@@ -31,7 +31,7 @@
|
|||||||
"mdjs"
|
"mdjs"
|
||||||
],
|
],
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@mdjs/core": "^0.7.0",
|
"@mdjs/core": "^0.7.1",
|
||||||
"es-module-lexer": "^0.3.26",
|
"es-module-lexer": "^0.3.26",
|
||||||
"unist-util-visit": "^2.0.3"
|
"unist-util-visit": "^2.0.3"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
/* eslint-disable @typescript-eslint/ban-ts-comment */
|
/* eslint-disable @typescript-eslint/ban-ts-comment */
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
|
const slash = require('slash');
|
||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
const { mdjsProcess } = require('@mdjs/core');
|
const { mdjsProcess } = require('@mdjs/core');
|
||||||
const visit = require('unist-util-visit');
|
const visit = require('unist-util-visit');
|
||||||
@@ -121,8 +122,12 @@ function eleventyUnified(pluginOptions) {
|
|||||||
return plugins.map(plugin => {
|
return plugins.map(plugin => {
|
||||||
if (plugin.options) {
|
if (plugin.options) {
|
||||||
plugin.options.page = eleventySettings.page;
|
plugin.options.page = eleventySettings.page;
|
||||||
|
plugin.options.rocketConfig = eleventySettings.rocketConfig;
|
||||||
} else {
|
} else {
|
||||||
plugin.options = { page: eleventySettings.page };
|
plugin.options = {
|
||||||
|
page: eleventySettings.page,
|
||||||
|
rocketConfig: eleventySettings.rocketConfig,
|
||||||
|
};
|
||||||
}
|
}
|
||||||
return plugin;
|
return plugin;
|
||||||
});
|
});
|
||||||
@@ -145,8 +150,19 @@ function eleventyUnified(pluginOptions) {
|
|||||||
const newName = path.join(newFolder, '__mdjs-stories.js');
|
const newName = path.join(newFolder, '__mdjs-stories.js');
|
||||||
await fs.promises.mkdir(newFolder, { recursive: true });
|
await fs.promises.mkdir(newFolder, { recursive: true });
|
||||||
await fs.promises.writeFile(newName, result.jsCode, 'utf8');
|
await fs.promises.writeFile(newName, result.jsCode, 'utf8');
|
||||||
|
|
||||||
|
let scriptUrl = eleventySettings.page.url;
|
||||||
|
if (
|
||||||
|
eleventySettings.rocketConfig &&
|
||||||
|
eleventySettings.rocketConfig.command === 'build' &&
|
||||||
|
eleventySettings.rocketConfig.pathPrefix
|
||||||
|
) {
|
||||||
|
scriptUrl = slash(
|
||||||
|
path.join(eleventySettings.rocketConfig.pathPrefix, eleventySettings.page.url),
|
||||||
|
);
|
||||||
|
}
|
||||||
code += `
|
code += `
|
||||||
<script type="module" src="${eleventySettings.page.url}__mdjs-stories.js" mdjs-setup></script>
|
<script type="module" src="${scriptUrl}__mdjs-stories.js" mdjs-setup></script>
|
||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
return code;
|
return code;
|
||||||
|
|||||||
@@ -1,5 +1,17 @@
|
|||||||
# @rocket/launch
|
# @rocket/launch
|
||||||
|
|
||||||
|
## 0.4.2
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- 2b7f1ee: Add support for pathprefix
|
||||||
|
|
||||||
|
## 0.4.1
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- 81edf45: Reduce the amount of js files in the build by avoiding inline script tags
|
||||||
|
|
||||||
## 0.4.0
|
## 0.4.0
|
||||||
|
|
||||||
### Minor Changes
|
### Minor Changes
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@rocket/launch",
|
"name": "@rocket/launch",
|
||||||
"version": "0.4.0",
|
"version": "0.4.2",
|
||||||
"publishConfig": {
|
"publishConfig": {
|
||||||
"access": "public"
|
"access": "public"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,17 +1 @@
|
|||||||
{#
|
<script type="module" src="{{ '/_assets/scripts/init-navigation.js' | asset | url }}"></script>
|
||||||
src leads to the file not being included/executed? bug in rollup-plugin-html?
|
|
||||||
<script type="module" src="{{ '/_assets/scripts/init-navigation.js' | asset }}"></script>
|
|
||||||
#}
|
|
||||||
<script type="module">
|
|
||||||
import '@rocket/navigation/rocket-navigation.js';
|
|
||||||
import '@rocket/drawer/rocket-drawer.js';
|
|
||||||
const drawer = document.querySelector('#sidebar');
|
|
||||||
|
|
||||||
// Toggle button
|
|
||||||
const triggers = document.querySelectorAll('[data-action="trigger-mobile-menu"]');
|
|
||||||
for (const trigger of [...triggers]) {
|
|
||||||
trigger.addEventListener('click', function () {
|
|
||||||
drawer.opened = true;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<meta property="og:site_name" content="{{ site.name }}"/>
|
<meta property="og:site_name" content="{{ site.name }}"/>
|
||||||
<meta property="og:type" content="website"/>
|
<meta property="og:type" content="website"/>
|
||||||
|
|
||||||
<meta property="og:image" content="{{ socialMediaImage }}"/>
|
<meta property="og:image" content="{{ socialMediaImage | url }}"/>
|
||||||
<meta property="og:url" content="{{ page.url }}"/>
|
<meta property="og:url" content="{{ page.url | url }}"/>
|
||||||
|
|
||||||
<meta name="twitter:card" content="summary_large_image"/>
|
<meta name="twitter:card" content="summary_large_image"/>
|
||||||
|
|||||||
@@ -208,19 +208,7 @@ describe('RocketLaunch preset', () => {
|
|||||||
' </div>',
|
' </div>',
|
||||||
' </footer>',
|
' </footer>',
|
||||||
'',
|
'',
|
||||||
' <script type="module">',
|
' <script type="module" src="/_merged_assets/scripts/init-navigation.js"></script>',
|
||||||
' import "@rocket/navigation/rocket-navigation.js";',
|
|
||||||
' import "@rocket/drawer/rocket-drawer.js";',
|
|
||||||
' const drawer = document.querySelector("#sidebar");',
|
|
||||||
'',
|
|
||||||
' // Toggle button',
|
|
||||||
` const triggers = document.querySelectorAll('[data-action="trigger-mobile-menu"]');`,
|
|
||||||
' for (const trigger of [...triggers]) {',
|
|
||||||
' trigger.addEventListener("click", function () {',
|
|
||||||
' drawer.opened = true;',
|
|
||||||
' });',
|
|
||||||
' }',
|
|
||||||
' </script>',
|
|
||||||
' </body>',
|
' </body>',
|
||||||
'</html>',
|
'</html>',
|
||||||
].join('\n'),
|
].join('\n'),
|
||||||
@@ -443,19 +431,7 @@ describe('RocketLaunch preset', () => {
|
|||||||
' </div>',
|
' </div>',
|
||||||
' </footer>',
|
' </footer>',
|
||||||
'',
|
'',
|
||||||
' <script type="module">',
|
' <script type="module" src="/_merged_assets/scripts/init-navigation.js"></script>',
|
||||||
' import "@rocket/navigation/rocket-navigation.js";',
|
|
||||||
' import "@rocket/drawer/rocket-drawer.js";',
|
|
||||||
' const drawer = document.querySelector("#sidebar");',
|
|
||||||
'',
|
|
||||||
' // Toggle button',
|
|
||||||
` const triggers = document.querySelectorAll('[data-action="trigger-mobile-menu"]');`,
|
|
||||||
' for (const trigger of [...triggers]) {',
|
|
||||||
' trigger.addEventListener("click", function () {',
|
|
||||||
' drawer.opened = true;',
|
|
||||||
' });',
|
|
||||||
' }',
|
|
||||||
' </script>',
|
|
||||||
' </body>',
|
' </body>',
|
||||||
'</html>',
|
'</html>',
|
||||||
].join('\n'),
|
].join('\n'),
|
||||||
|
|||||||
@@ -1,5 +1,11 @@
|
|||||||
# Change Log
|
# Change Log
|
||||||
|
|
||||||
|
## 0.7.1
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- 2b7f1ee: Add support for pathprefix
|
||||||
|
|
||||||
## 0.7.0
|
## 0.7.0
|
||||||
|
|
||||||
### Minor Changes
|
### Minor Changes
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@mdjs/core",
|
"name": "@mdjs/core",
|
||||||
"version": "0.7.0",
|
"version": "0.7.1",
|
||||||
"publishConfig": {
|
"publishConfig": {
|
||||||
"access": "public"
|
"access": "public"
|
||||||
},
|
},
|
||||||
@@ -43,7 +43,7 @@
|
|||||||
"remark"
|
"remark"
|
||||||
],
|
],
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@mdjs/mdjs-preview": "^0.4.1",
|
"@mdjs/mdjs-preview": "^0.4.2",
|
||||||
"@mdjs/mdjs-story": "^0.2.0",
|
"@mdjs/mdjs-story": "^0.2.0",
|
||||||
"@types/unist": "^2.0.3",
|
"@types/unist": "^2.0.3",
|
||||||
"es-module-lexer": "^0.3.26",
|
"es-module-lexer": "^0.3.26",
|
||||||
|
|||||||
@@ -1,8 +1,43 @@
|
|||||||
|
const path = require('path');
|
||||||
|
const slash = require('slash');
|
||||||
|
|
||||||
/** @typedef {import('vfile').VFileOptions} VFileOptions */
|
/** @typedef {import('vfile').VFileOptions} VFileOptions */
|
||||||
/** @typedef {import('unist').Node} Node */
|
/** @typedef {import('unist').Node} Node */
|
||||||
/** @typedef {import('@mdjs/core/types/code').Story} Story */
|
/** @typedef {import('@mdjs/core/types/code').Story} Story */
|
||||||
|
|
||||||
function mdjsSetupCode({ rootNodeQueryCode = 'document', simulationSettings = {} } = {}) {
|
/**
|
||||||
|
* @typedef {Object} simulationSettings
|
||||||
|
* @property {string} [simulatorUrl]
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @typedef {Object} rocketConfig
|
||||||
|
* @property {string} [pathPrefix]
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param {object} options
|
||||||
|
* @param {string} [options.rootNodeQueryCode]
|
||||||
|
* @param {simulationSettings} [options.simulationSettings]
|
||||||
|
* @param {rocketConfig} [options.rocketConfig]
|
||||||
|
* @returns
|
||||||
|
*/
|
||||||
|
function mdjsSetupCode({
|
||||||
|
rootNodeQueryCode = 'document',
|
||||||
|
simulationSettings = {},
|
||||||
|
rocketConfig = {},
|
||||||
|
} = {}) {
|
||||||
|
if (rocketConfig && rocketConfig.pathPrefix) {
|
||||||
|
if (simulationSettings && simulationSettings.simulatorUrl) {
|
||||||
|
const { simulatorUrl } = simulationSettings;
|
||||||
|
if (simulatorUrl[0] === '/' && !simulatorUrl.startsWith(rocketConfig.pathPrefix)) {
|
||||||
|
simulationSettings.simulatorUrl = slash(
|
||||||
|
path.join(rocketConfig.pathPrefix, simulationSettings.simulatorUrl),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} tree
|
* @param {Node} tree
|
||||||
* @param {VFileOptions} file
|
* @param {VFileOptions} file
|
||||||
|
|||||||
@@ -1,5 +1,17 @@
|
|||||||
# @rocket/search
|
# @rocket/search
|
||||||
|
|
||||||
|
## 0.3.5
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- 2b7f1ee: Add support for pathprefix
|
||||||
|
|
||||||
|
## 0.3.4
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- 81edf45: Reduce the amount of js files in the build by avoiding inline script tags
|
||||||
|
|
||||||
## 0.3.3
|
## 0.3.3
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@rocket/search",
|
"name": "@rocket/search",
|
||||||
"version": "0.3.3",
|
"version": "0.3.5",
|
||||||
"publishConfig": {
|
"publishConfig": {
|
||||||
"access": "public"
|
"access": "public"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -0,0 +1 @@
|
|||||||
|
import '@rocket/search/rocket-search.js';
|
||||||
@@ -4,6 +4,4 @@
|
|||||||
</svg>
|
</svg>
|
||||||
</rocket-search>
|
</rocket-search>
|
||||||
|
|
||||||
<script type="module">
|
<script type="module" src="{{ '/_assets/scripts/define-rocket-search.js' | asset | url }}"></script>
|
||||||
import '@rocket/search/rocket-search.js';
|
|
||||||
</script>
|
|
||||||
|
|||||||
Reference in New Issue
Block a user