-
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Miscellaneous improvements to
@lunariajs/core
(#18)
* Improve `tsconfig.json` config * Add `scrollbar-gutter: stable` to default styles * Ensure the dashboard is properly generated when a translation is missing * Add another locale with fake pages to `examples/vitepress` * Fix table column with multiple locales * Avoid `undefined` in replace call * Rollback `@lunariajs/core` to `0.0.0` * Add `lint` scripts to root `package.json` * Update workspace references to `@lunariajs/core` * Add `README.md`
- Loading branch information
1 parent
38bbae4
commit 100147f
Showing
16 changed files
with
176 additions
and
85 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
i18nReady: false | ||
--- | ||
|
||
# First page | ||
|
||
This is the first page for demonstration. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
--- | ||
i18nReady: true | ||
layout: home | ||
|
||
hero: | ||
name: 'VitePress Example' | ||
tagline: Example showcasing Lunaria + VitePress | ||
actions: | ||
- theme: brand | ||
text: First page | ||
link: /first-page | ||
- theme: alt | ||
text: Second page | ||
link: /second-page | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Second page | ||
|
||
This is the second page for demonstration. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
# `@lunariajs/core` | ||
|
||
The `@lunariajs/core` package contains the base tracking and dashboard generation systems used across its related packages. You should use this package if: | ||
|
||
- You need fine-grained control over your dashboard | ||
- You want to build a package over it | ||
- There isn't a framework-specific `@lunariajs` package for your use-case | ||
|
||
## Installation | ||
|
||
You can install `@lunariajs/core` using your preferred package manager: | ||
|
||
```bash | ||
# npm | ||
npm install @lunariajs/core | ||
|
||
# pnpm | ||
pnpm add @lunariajs/core | ||
|
||
# yarn | ||
yarn add @lunariajs/core | ||
``` | ||
|
||
## Basic Usage | ||
|
||
Start using `@lunariajs/core` by setting up a script to generate your translation dashboard status. | ||
|
||
The example below contains all of the **required** options to generate a dashboard tracking the status of both the Portuguese and Spanish translations of a site: | ||
|
||
```js | ||
// scripts/translation-status.js | ||
import { createTracker } from '@lunariajs/core'; | ||
|
||
const tracker = await createTracker({ | ||
// Current repository of this script and content | ||
repository: 'https://github.com/me/cool-docs', | ||
dashboard: { | ||
// Generated dashboard URL used in meta tags | ||
url: 'https://tracker.cool-docs.com', | ||
}, | ||
// Information about the source locale of your content | ||
defaultLocale: { | ||
// User-friendly label/name of the language | ||
label: 'English', | ||
// BCP-47 tag of the language | ||
lang: 'en', | ||
content: { | ||
// Glob pattern of where your content is | ||
location: 'content/en/**/*.md', | ||
}, | ||
}, | ||
// Array of objects of your translated locales. | ||
locales: [ | ||
{ | ||
label: 'Português', | ||
lang: 'pt', | ||
content: { | ||
location: 'content/pt/**/*.md', | ||
}, | ||
}, | ||
{ | ||
label: 'Spanish', | ||
lang: 'es', | ||
content: { | ||
location: 'content/es/**/*.md', | ||
}, | ||
}, | ||
], | ||
/** Property containing a boolean value used in files that support frontmatter to mark that the content should be translated */ | ||
translatableProperty: 'i18nReady', | ||
}); | ||
|
||
tracker.run(); | ||
``` | ||
|
||
Want other usage examples? Head over to the [`examples/` directory](https://github.com/Yan-Thomas/lunaria/tree/main/examples/) and inspect the source code for tips & tricks about using `@lunariajs/core` with other frameworks and environments. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.