Way To Make Rich Results
You can generate Rich Results using two straightforward methods:
- CLI (Command Line Interface)
- API (Application Programming Interface)
👨🏻💻 CLI
#make rich result
npx rjs make
Set Destination
We can set destination folder using -d
or --destDir
flag in rjs make
.
By default outputs are stored in dist
folder.
Value: Relative path.
Type: String without quote.
#store output in different directories
npx rjs make -d destFolder
# or
npx rjs make --destDir destFolder
Omit folders to skip lookup
We can omit folder from lookup list using --no
or --omitPatterns
.
Value: Relative path or glob pattern.
Type: String without quote.
#omit files and folders
npx rjs make --no relativePath/subpath
# or
npx rjs make --omitPatterns relativePath/**
Preserve Previous Files
By default Richie JS removes previous outputs / emptying destination directory.
If you want to disable this? use preserve flags --norm or -p
npx rjs make -p
# or
npx rjs make --norm
Unsupported in CLI
Below rich result types are currently not supported using the CLI method. However, you can create them using the API method:
- Site Search Box
- Bread Crumb
🤖 API
Richie JS supports ECMAS and CommonJS syntax for Working with API
import { richie } from "@cresteem/richie-js";
import { mkdirSync } from "fs";
import { basename, join, relative, dirname } from "path";
const type = "breadcrumb";
const inputFile = "pages/breadcrumb/sub-breadcrumb/notindex.html";
const outputFile = join(
"./dist",
relative(process.cwd(), dirname(inputFile)),
basename(inputFile)
);
//making dest folder
mkdirSync(dirname(outputFile), { recursive: true });
richie(type, inputFile, outputFile);
That's all! 😊 We hope you found this useful. We are open to feedback, so feel free to share your thoughts with us via email - [email protected], our Telegram channel (opens in a new tab), or by creating an issue in repository. (opens in a new tab)
We prefer telegram channel (opens in a new tab) for answer to your questions and troubleshooting.
Thank you for your valuable time! and hope in us. Wishing you success!
Keywords:
- Richie JS
- API
- CLI (Command Line Interface)
- Application Programming Interface
- SEO Tool
- Search Engine Visibility
- User Experience