diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml index ae47f8b..064dcca 100644 --- a/.github/workflows/pages.yml +++ b/.github/workflows/pages.yml @@ -25,14 +25,28 @@ jobs: - name: Checkout uses: actions/checkout@v7 + - name: Setup pnpm + uses: pnpm/action-setup@v4 + + - name: Setup Node + uses: actions/setup-node@v4 + with: + node-version: 22 + cache: pnpm + + - name: Install dependencies + run: pnpm install --frozen-lockfile --ignore-scripts + + - name: Build static demo + run: pnpm build + - name: Configure Pages uses: actions/configure-pages@v6 - name: Upload artifact uses: actions/upload-pages-artifact@v5 with: - # Publish the repo root: demo/configurator + progress.js + progress.css + progress.min.js - path: '.' + path: 'out' - name: Deploy to GitHub Pages id: deployment diff --git a/.gitignore b/.gitignore index c7bcb7a..5297aa6 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,7 @@ node_modules .DS_Store *.zip +.next +out +public/progress.js +public/progress.css diff --git a/.nojekyll b/.nojekyll deleted file mode 100644 index e69de29..0000000 diff --git a/app/[locale]/layout.jsx b/app/[locale]/layout.jsx new file mode 100644 index 0000000..f58ec5e --- /dev/null +++ b/app/[locale]/layout.jsx @@ -0,0 +1,66 @@ +import { NextIntlClientProvider } from 'next-intl'; +import { getMessages, setRequestLocale, getTranslations } from 'next-intl/server'; +import { jsonLdScriptProps } from 'react-schemaorg'; +import { ORIGIN, LOCALES, OG_LOCALES, FAVICON, jsonLd } from '../../lib/site'; +import Providers from '../_components/Providers'; +import '../demo.css'; + +export function generateStaticParams() { + return LOCALES.map((locale) => ({ locale })); +} + +export const viewport = { themeColor: '#1a73e8' }; + +export async function generateMetadata({ params }) { + const { locale } = await params; + const t = await getTranslations({ locale }); + const url = `${ORIGIN}/${locale}/`; + const languages = {}; + LOCALES.forEach((l) => { languages[l] = `${ORIGIN}/${l}/`; }); + languages['x-default'] = `${ORIGIN}/`; + const title = t('title'); + const description = t('description'); + return { + metadataBase: new URL(ORIGIN), + title, + description, + authors: [{ name: 'GreedyLabs' }], + robots: { index: true, follow: true }, + alternates: { canonical: url, languages }, + icons: { icon: FAVICON }, + openGraph: { + type: 'website', siteName: 'ghost-progress-plugin', title, description, url, + images: [{ url: `${ORIGIN}/og-image.png`, width: 1200, height: 630 }], + locale: OG_LOCALES[locale] + }, + twitter: { + card: 'summary_large_image', title, description, + images: [`${ORIGIN}/og-image.png`] + } + }; +} + +export default async function LocaleLayout({ children, params }) { + const { locale } = await params; + setRequestLocale(locale); + const messages = await getMessages(); + const t = await getTranslations({ locale }); + const ld = jsonLd(locale, t, `${ORIGIN}/${locale}/`); + return ( + + + `; +} + +function copyText(text) { + if (navigator.clipboard && navigator.clipboard.writeText) { + return navigator.clipboard.writeText(text).catch(() => legacyCopy(text)); + } + return legacyCopy(text); +} +function legacyCopy(text) { + return new Promise((resolve, reject) => { + const ta = document.createElement('textarea'); + ta.value = text; ta.setAttribute('readonly', ''); + ta.style.cssText = 'position:fixed;top:0;left:0;opacity:0'; + document.body.appendChild(ta); ta.select(); + let ok = false; + try { ok = document.execCommand('copy'); } catch (e) {} + document.body.removeChild(ta); + ok ? resolve() : reject(); + }); +} diff --git a/app/_components/Providers.jsx b/app/_components/Providers.jsx new file mode 100644 index 0000000..fc5da42 --- /dev/null +++ b/app/_components/Providers.jsx @@ -0,0 +1,10 @@ +'use client'; +import { ThemeProvider } from 'next-themes'; + +export default function Providers({ children }) { + return ( + + {children} + + ); +} diff --git a/demo.css b/app/demo.css similarity index 79% rename from demo.css rename to app/demo.css index 5fa1a2f..e56f870 100644 --- a/demo.css +++ b/app/demo.css @@ -1,12 +1,3 @@ -/* Styles for the ghost-progress-plugin demo / configurator page only. - (The distributed widget styles live in progress.css.) */ - -/* Light palette (default). JS sets data-theme="light"|"dark" on ; "system" - resolves to one of those and reacts to OS changes. We also define the widget's - own --greedylabs-ghost-progress-* variables here so the TOC matches the chosen theme - even when it differs from the OS (otherwise progress.css's prefers-color-scheme - media query would fight a forced theme). - --ghost-accent-color simulates a Ghost site so "auto accent" previews a color. */ :root { --page-bg: #ffffff; --ui-bg: #ffffff; @@ -46,7 +37,6 @@ body { margin: 0; color: var(--ui-fg); background: var(--page-bg); line-height: transition: background-color .2s ease, color .2s ease; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Apple SD Gothic Neo", "Noto Sans KR", sans-serif; } -/* control panel floats over a margin; it moves to the side OPPOSITE the TOC */ .panel { position: fixed; left: 16px; top: 16px; width: 300px; max-height: calc(100vh - 32px); overflow: auto; z-index: 1000; @@ -57,8 +47,6 @@ body { margin: 0; color: var(--ui-fg); background: var(--page-bg); line-height: .panel h1 { font-size: 15px; margin: 0 0 12px; } .panel .sub { color: var(--ui-muted); font-size: 12px; margin: 0 0 14px; } -/* language + theme — not widget options, so grouped at the top (labelled like the - other fields) with a divider below to separate them from the configurator */ .panel-meta { margin: 0 0 14px; padding-bottom: 14px; border-bottom: 1px solid var(--ui-border); } .panel-meta .field.row { margin-bottom: 0; } @@ -69,7 +57,7 @@ body { margin: 0; color: var(--ui-fg); background: var(--page-bg); line-height: border-radius: 7px; font: inherit; font-size: 13px; background: var(--ui-bg); color: var(--ui-fg); } -/* one-click presets that fill the content selector for a given platform */ + .presets { display: flex; gap: 6px; margin-top: 6px; } .preset { font: inherit; font-size: 11px; padding: 3px 8px; cursor: pointer; border: 1px solid var(--ui-border); border-radius: 6px; @@ -96,25 +84,20 @@ pre { margin: 0; background: #0f172a; color: #e2e8f0; padding: 12px; border-radi overflow-x: auto; white-space: pre; } .hint { color: var(--ui-muted); font-size: 11.5px; margin-top: 8px; } -/* Support / donation call-to-action at the bottom of the control panel, with a - divider above to separate it from the configurator. The Buy Me a Coffee script - injects its own button after the script tag. */ .panel-support { margin-top: 16px; padding-top: 16px; text-align: center; border-top: 1px solid var(--ui-border); } -/* same family/size/color as the panel's other secondary text (.hint, .sub) */ + .panel-support p { margin: 0 0 10px; font-size: 11.5px; line-height: 1.5; color: var(--ui-muted); white-space: nowrap; } .panel-support a, .panel-support img { max-width: 100%; vertical-align: middle; } -/* Demo-only: a faint track so the reading bar is visible even at 0% */ .greedylabs-ghost-progress { --greedylabs-ghost-progress-track: rgba(0,0,0,.08); } :root[data-theme="dark"] .greedylabs-ghost-progress { --greedylabs-ghost-progress-track: rgba(255,255,255,.14); } .demo-hero { max-width: 1080px; margin: 24px auto 0; height: 340px; border-radius: 14px; background: var(--hero-bg); color: var(--hero-fg); border: 1px solid var(--ui-border); display: flex; align-items: center; justify-content: center; font-weight: 500; letter-spacing: .02em; } -/* The real Ghost Source grid, copied from the site's screen.css, so the demo - article lays out just like a live post. */ + .gh-canvas { --content-width: 720px; --container-width: 1200px; --container-gap: 4vmin; --main: min(var(--content-width), 100% - var(--container-gap) * 2); @@ -134,7 +117,7 @@ pre { margin: 0; background: #0f172a; color: #e2e8f0; padding: 12px; border-radi .demo-article h3 { margin-top: 1.6em; font-size: 1.25rem; } .demo-article p { margin: 1em 0; color: var(--art-fg); } .demo-article pre { margin: 1.2em 0; } -/* Inline code in prose, rendered in monospace so options stand out. */ + .demo-article p code, .demo-article li code { font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace; font-size: .86em; color: var(--ui-fg); @@ -142,7 +125,6 @@ pre { margin: 0; background: #0f172a; color: #e2e8f0; padding: 12px; border-radi border-radius: 5px; padding: 1px 5px; word-break: break-word; } -/* Comments live in the same gh-canvas grid so they align with the article. */ .demo-comments { margin: 8px 0 0; padding-bottom: 120px; } .demo-comments-title { font-size: 1.4rem; margin: 0 0 16px; } .demo-comments .giscus, diff --git a/app/sitemap.js b/app/sitemap.js new file mode 100644 index 0000000..0ba3cf1 --- /dev/null +++ b/app/sitemap.js @@ -0,0 +1,10 @@ +import { LOCALES, ORIGIN } from '../lib/site'; + +export const dynamic = 'force-static'; + +export default function sitemap() { + return [ + { url: `${ORIGIN}/`, changeFrequency: 'monthly', priority: 1.0 }, + ...LOCALES.map((l) => ({ url: `${ORIGIN}/${l}/`, changeFrequency: 'monthly', priority: 0.8 })) + ]; +} diff --git a/de/index.html b/de/index.html deleted file mode 100644 index 373ef80..0000000 --- a/de/index.html +++ /dev/null @@ -1,253 +0,0 @@ - - - - - - - ghost-progress-plugin: Lesefortschrittsbalken für Ghost · Konfigurator & Demo - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Beitragsbild
- -
-

ghost-progress-plugin Vorschau

-

Scrolle und sieh zu, wie sich der Balken oben von 0% auf 100% füllt. Ändere Optionen im linken Panel, der Einbettungscode aktualisiert sich mit.

- -

Einführung

-

ghost-progress-plugin ist ein winziger, abhängigkeitsfreier Lesefortschrittsbalken für Ghost. Es begann als Widget für Ghost, funktioniert aber auch in Notion-basierten Blogs und überall, wo du ein Skript einbinden kannst. Beim Lesen füllt sich ein dünner Balken und zeigt, wie weit du im Artikel bist. Diese Seite ist ein Live-Beispiel: Der Balken oben ist das echte Widget.

- -

Installation

-

Einmal mit diesem Snippet einbinden, ohne Build-Schritt und ohne Theme-Dateien zu bearbeiten:

-
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/GreedyLabs/ghost-progress-plugin@1/progress.css">
-<script src="https://cdn.jsdelivr.net/gh/GreedyLabs/ghost-progress-plugin@1/progress.min.js"
-        data-content=".gh-content"
-        data-position="top"></script>
-

Code-Injection

-

Füge es in Ghost unter Settings → Code injection → Site Footer ein. Auf Notion-basiertem Hosting fügst du es im Feld für eigenen Code ein: oopy hat ein head/footer-Codefeld, super.so hat einen Custom-Code-Bereich, und dort setzt du data-content auf .notion-page-content. Auf jeder anderen Seite platzierst du es direkt vor dem schließenden </body>-Tag.

-

Optionen

-

Alles wird über data-*-Attribute am Script-Tag konfiguriert: der Inhalts-Selektor, die Position, die Dicke und der Z-Index:

-
data-content=".gh-content"
-data-position="top"
-data-height="4"
-data-z-index="100"
- -

Anpassung

-

Farbe und Dicke des Balkens sind anpassbar. Jede Klasse und CSS-Variable ist unter greedylabs-ghost-progress benannt, sodass er nie mit deinem Theme kollidiert.

-

Farben

-

Die Füllung folgt standardmäßig der Akzentfarbe deines Ghost-Themes (--ghost-accent-color); setze data-color oder überschreibe die CSS-Variablen, um sie zu ändern. Die ungelesene Spur ist standardmäßig transparent, gib ihr also eine Farbe, damit der Balken auch bei 0% sichtbar ist:

-
.greedylabs-ghost-progress {
-  --greedylabs-ghost-progress-track: rgba(0,0,0,.08);
-}
-@media (prefers-color-scheme: dark) {
-  .greedylabs-ghost-progress {
-    --greedylabs-ghost-progress-track: rgba(255,255,255,.14);
-  }
-}
-

Position

-

Nutze data-position für oben oder unten und data-height für die Dicke in Pixeln. Der Balken erreicht 0%, wenn der obere Rand des Artikels den oberen Rand des Viewports erreicht, und 100%, wenn sein unterer Rand den unteren erreicht.

- -

Häufige Fragen

- -

Misst es die ganze Seite oder nur den Artikel?

-

Nur den Artikel, auf den data-content zeigt. Header, Beitragsbild und Footer zählen nicht zum Fortschritt.

-

Warum ist der Balken oben unsichtbar?

-

Bei 0% hat die Füllung keine Breite und die Spur ist standardmäßig transparent. Gib der Spur eine Farbe (siehe Farben), damit der Balken auch leer sichtbar ist.

-

Funktioniert es außerhalb von Ghost?

-

Ja. Überall, wo du ein Skript einbinden kannst, zeige mit data-content auf deinen Artikel-Container. Bei Notion ist das .notion-page-content.

- -

Fazit

-

ghost-progress-plugin ist Open Source unter der MIT-Lizenz; Code und Issues findest du auf GitHub. Probiere die Optionen im linken Panel aus und kopiere das Snippet, wenn es passt. Wenn es dir geholfen hat, freue ich mich über einen Kaffee ☕.

-
- -
- -
- - - - - - diff --git a/demo.js b/demo.js deleted file mode 100644 index 21709b7..0000000 --- a/demo.js +++ /dev/null @@ -1,172 +0,0 @@ -/* Configurator logic for the ghost-progress-plugin demo page. - Drives the widget (loaded from ./progress.js with data-auto="false") via its - create()/destroy() API, regenerates the embed snippet, and reports usage to - Umami. None of this ships with the distributed widget. */ -(function () { - // jsDelivr serves our GitHub repo; @1 tracks the latest v1.x release and is - // auto-minified (the .min file). If jsDelivr has a hiccup, Statically mirrors - // the same paths at cdn.statically.io/gh/GreedyLabs/ghost-progress-plugin@main. - var CDN = 'https://cdn.jsdelivr.net/gh/GreedyLabs/ghost-progress-plugin@1'; - var DEF = window.GreedyLabsGhostProgress.defaults; - // per-page localized strings (set by each generated //index.html) - var I = window.GPROG_I18N || { copy: '복사', copyDone: '복사됨' }; - var instance = null; - var $ = function (id) { return document.getElementById(id); }; - - // Safe Umami event tracker (no-op if the script is blocked/unloaded) - function track(name, data) { - try { if (window.umami && window.umami.track) { window.umami.track(name, data); } } catch (e) {} - } - - // Parse an integer field, falling back to the default only when it's empty/ - // invalid, NOT when it's a legitimate 0 (a `|| DEF` would swallow zero). - function intField(id, def) { - var v = parseInt($(id).value, 10); - return isNaN(v) ? def : v; - } - - function read() { - return { - content: $('f-content').value.trim() || '.gh-content', - position: $('f-position').value, - height: intField('f-height', DEF.height), - useThemeColor: $('f-useThemeColor').checked, - color: $('f-color').value, - zIndex: intField('f-zindex', DEF.zIndex) - }; - } - - function render() { - var o = read(); - $('f-color').disabled = o.useThemeColor; - - if (instance) { instance.destroy(); instance = null; } - instance = window.GreedyLabsGhostProgress.create({ - content: '.demo-article', - position: o.position, - height: o.height, - color: o.useThemeColor ? undefined : o.color, - zIndex: o.zIndex - }); - updateSnippet(o); - } - - function esc(s) { return String(s).replace(/&/g, '&').replace(//g, '>'); } - - function updateSnippet(o) { - var a = []; - a.push('data-content="' + esc(o.content) + '"'); - a.push('data-position="' + esc(o.position) + '"'); - if (o.height !== DEF.height) { a.push('data-height="' + o.height + '"'); } - if (!o.useThemeColor) { a.push('data-color="' + esc(o.color) + '"'); } - if (o.zIndex !== DEF.zIndex) { a.push('data-z-index="' + o.zIndex + '"'); } - - var code = - '\n' + - ' - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Feature image
- -
-

ghost-progress-plugin preview

-

Scroll and watch the bar at the top fill from 0% to 100%. Change options in the left panel and the embed code updates with them.

- -

Getting started

-

ghost-progress-plugin is a tiny, dependency-free reading progress bar for Ghost. It started as a Ghost widget, but it also works on Notion-based blogs, and anywhere you can add a script. As you read, a thin bar fills to show how far through the article you are. This page is a live example: the bar at the top is the real widget.

- -

Installation

-

Add it once with this snippet, no build step, no theme files to edit:

-
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/GreedyLabs/ghost-progress-plugin@1/progress.css">
-<script src="https://cdn.jsdelivr.net/gh/GreedyLabs/ghost-progress-plugin@1/progress.min.js"
-        data-content=".gh-content"
-        data-position="top"></script>
-

Code injection

-

In Ghost, paste it into Settings → Code injection → Site Footer. On Notion-based hosting, add it in the custom-code field: oopy has a head/footer code box in its site settings, super.so has a Custom Code area, and there you set data-content to .notion-page-content. On any other site, put it just before the closing </body> tag.

-

Options

-

Everything is configured with data-* attributes on the script tag: the content selector, the position, the height, and the z-index:

-
data-content=".gh-content"
-data-position="top"
-data-height="4"
-data-z-index="100"
- -

Customize

-

The bar color and thickness are adjustable. Every class and CSS variable is namespaced under greedylabs-ghost-progress, so it never clashes with your theme.

-

Colors

-

The fill follows your Ghost theme accent (--ghost-accent-color) by default; set data-color or override the CSS variables to change it. The unread track is transparent by default, so give it a color to make the bar visible even at 0%:

-
.greedylabs-ghost-progress {
-  --greedylabs-ghost-progress-track: rgba(0,0,0,.08);
-}
-@media (prefers-color-scheme: dark) {
-  .greedylabs-ghost-progress {
-    --greedylabs-ghost-progress-track: rgba(255,255,255,.14);
-  }
-}
-

Position

-

Use data-position for top or bottom, and data-height for the thickness in pixels. The bar reaches 0% when the article top meets the top of the viewport, and 100% when its bottom meets the bottom.

- -

FAQ

- -

Does it track the whole page or just the article?

-

Just the article you point data-content at. The header, feature image, and footer do not count toward the progress.

-

Why is the bar invisible at the top?

-

At 0% the fill has no width and the track is transparent by default. Give the track a color (see Colors) to show the bar even when empty.

-

Does it work outside Ghost?

-

Yes. Anywhere you can inject a script, point data-content at your article container. For Notion that is .notion-page-content.

- -

Wrapping up

-

ghost-progress-plugin is open source under the MIT license; the code and issues live on GitHub. Try the options in the left panel and copy the embed snippet when you are happy. If it helped you, a coffee is always appreciated ☕.

-
- -
- -
- - - - - - diff --git a/es/index.html b/es/index.html deleted file mode 100644 index 9a97723..0000000 --- a/es/index.html +++ /dev/null @@ -1,253 +0,0 @@ - - - - - - - ghost-progress-plugin: Barra de progreso de lectura para Ghost · configurador y demo - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Imagen destacada
- -
-

Vista previa de ghost-progress-plugin

-

Desplázate y mira la barra superior llenarse de 0% a 100%. Cambia las opciones en el panel izquierdo y el código de inserción se actualiza.

- -

Introducción

-

ghost-progress-plugin es una barra de progreso de lectura diminuta y sin dependencias para Ghost. Empezó como un widget para Ghost, pero también funciona en blogs basados en Notion y en cualquier sitio donde puedas añadir un script. Mientras lees, una barra fina se llena para mostrar por dónde vas del artículo. Esta página es un ejemplo en vivo: la barra de arriba es el widget real.

- -

Instalación

-

Añádelo una sola vez con este fragmento, sin paso de compilación ni archivos del tema que editar:

-
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/GreedyLabs/ghost-progress-plugin@1/progress.css">
-<script src="https://cdn.jsdelivr.net/gh/GreedyLabs/ghost-progress-plugin@1/progress.min.js"
-        data-content=".gh-content"
-        data-position="top"></script>
-

Inyección de código

-

En Ghost, pégalo en Settings → Code injection → Site Footer. En hosting basado en Notion, añádelo en el campo de código personalizado: oopy tiene una caja de código head/footer, super.so tiene un área Custom Code, y ahí pones data-content en .notion-page-content. En cualquier otro sitio, colócalo justo antes de la etiqueta </body>.

-

Opciones

-

Todo se configura con atributos data-* en la etiqueta del script: el selector de contenido, la posición, el grosor y el z-index:

-
data-content=".gh-content"
-data-position="top"
-data-height="4"
-data-z-index="100"
- -

Personalización

-

El color y el grosor de la barra son ajustables. Cada clase y variable CSS está en el espacio de nombres greedylabs-ghost-progress, así que nunca choca con tu tema.

-

Colores

-

El relleno sigue por defecto el color de acento de tu tema Ghost (--ghost-accent-color); usa data-color o sobrescribe las variables CSS para cambiarlo. La pista no leída es transparente por defecto, así que dale un color para que la barra se vea incluso al 0%:

-
.greedylabs-ghost-progress {
-  --greedylabs-ghost-progress-track: rgba(0,0,0,.08);
-}
-@media (prefers-color-scheme: dark) {
-  .greedylabs-ghost-progress {
-    --greedylabs-ghost-progress-track: rgba(255,255,255,.14);
-  }
-}
-

Posición

-

Usa data-position para arriba o abajo, y data-height para el grosor en píxeles. La barra llega a 0% cuando la parte superior del artículo toca la parte superior de la ventana, y a 100% cuando su parte inferior toca la inferior.

- -

Preguntas frecuentes

- -

¿Mide toda la página o solo el artículo?

-

Solo el artículo al que apuntas con data-content. El encabezado, la imagen destacada y el pie no cuentan.

-

¿Por qué la barra no se ve arriba?

-

Al 0% el relleno no tiene ancho y la pista es transparente por defecto. Dale color a la pista (ver Colores) para que la barra se vea aun vacía.

-

¿Funciona fuera de Ghost?

-

Sí. Donde puedas inyectar un script, apunta data-content a tu contenedor de artículo. En Notion es .notion-page-content.

- -

Conclusión

-

ghost-progress-plugin es de código abierto bajo licencia MIT; el código y las incidencias están en GitHub. Prueba las opciones en el panel izquierdo y copia el fragmento cuando te guste. Si te ha servido, siempre se agradece un café ☕.

-
- -
- -
- - - - - - diff --git a/fr/index.html b/fr/index.html deleted file mode 100644 index caf1f60..0000000 --- a/fr/index.html +++ /dev/null @@ -1,253 +0,0 @@ - - - - - - - ghost-progress-plugin: Barre de progression de lecture pour Ghost · configurateur & démo - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Image à la une
- -
-

Aperçu de ghost-progress-plugin

-

Faites défiler et regardez la barre du haut se remplir de 0% à 100%. Modifiez les options dans le panneau de gauche, le code d'intégration se met à jour.

- -

Pour commencer

-

ghost-progress-plugin est une barre de progression de lecture minuscule et sans dépendance pour Ghost. Il a commencé comme un widget pour Ghost, mais il fonctionne aussi sur les blogs basés sur Notion, et partout où vous pouvez ajouter un script. Pendant la lecture, une fine barre se remplit pour indiquer où vous en êtes dans l'article. Cette page est un exemple en direct : la barre en haut est le vrai widget.

- -

Installation

-

Ajoutez-le en une fois avec cet extrait, sans étape de build ni fichiers de thème à modifier :

-
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/GreedyLabs/ghost-progress-plugin@1/progress.css">
-<script src="https://cdn.jsdelivr.net/gh/GreedyLabs/ghost-progress-plugin@1/progress.min.js"
-        data-content=".gh-content"
-        data-position="top"></script>
-

Injection de code

-

Dans Ghost, collez-le dans Settings → Code injection → Site Footer. Sur un hébergement basé sur Notion, ajoutez-le dans le champ de code personnalisé : oopy propose une zone de code head/footer, super.so a une zone Custom Code, et là vous réglez data-content sur .notion-page-content. Sur tout autre site, placez-le juste avant la balise </body>.

-

Options

-

Tout se configure avec des attributs data-* sur la balise script : le sélecteur de contenu, la position, l'épaisseur et le z-index :

-
data-content=".gh-content"
-data-position="top"
-data-height="4"
-data-z-index="100"
- -

Personnalisation

-

La couleur et l'épaisseur de la barre sont réglables. Chaque classe et variable CSS est dans l'espace de noms greedylabs-ghost-progress, donc elle n'entre jamais en conflit avec votre thème.

-

Couleurs

-

Le remplissage suit par défaut la couleur d'accent de votre thème Ghost (--ghost-accent-color) ; utilisez data-color ou redéfinissez les variables CSS pour la changer. La piste non lue est transparente par défaut, donnez-lui donc une couleur pour que la barre soit visible même à 0% :

-
.greedylabs-ghost-progress {
-  --greedylabs-ghost-progress-track: rgba(0,0,0,.08);
-}
-@media (prefers-color-scheme: dark) {
-  .greedylabs-ghost-progress {
-    --greedylabs-ghost-progress-track: rgba(255,255,255,.14);
-  }
-}
-

Position

-

Utilisez data-position pour haut ou bas, et data-height pour l'épaisseur en pixels. La barre atteint 0% quand le haut de l'article rejoint le haut de la fenêtre, et 100% quand son bas rejoint le bas.

- -

Questions fréquentes

- -

Mesure-t-il toute la page ou seulement l'article ?

-

Seulement l'article visé par data-content. L'en-tête, l'image à la une et le pied de page ne comptent pas.

-

Pourquoi la barre est-elle invisible en haut ?

-

À 0% le remplissage n'a pas de largeur et la piste est transparente par défaut. Donnez une couleur à la piste (voir Couleurs) pour voir la barre même vide.

-

Fonctionne-t-il hors de Ghost ?

-

Oui. Partout où vous pouvez injecter un script, pointez data-content vers votre conteneur d'article. Pour Notion, c'est .notion-page-content.

- -

Conclusion

-

ghost-progress-plugin est open source sous licence MIT ; le code et les tickets sont sur GitHub. Essayez les options dans le panneau de gauche et copiez l'extrait quand cela vous convient. Si cela vous a aidé, un café est toujours apprécié ☕.

-
- -
- -
- - - - - - diff --git a/hi/index.html b/hi/index.html deleted file mode 100644 index 0d17b63..0000000 --- a/hi/index.html +++ /dev/null @@ -1,253 +0,0 @@ - - - - - - - ghost-progress-plugin: Ghost के लिए रीडिंग प्रोग्रेस बार · कॉन्फ़िगरेटर और डेमो - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
फ़ीचर छवि
- -
-

ghost-progress-plugin प्रीव्यू

-

स्क्रॉल करें और ऊपर की बार को 0% से 100% तक भरते देखें। बाएँ पैनल में विकल्प बदलें, एम्बेड कोड भी साथ में अपडेट होता है।

- -

परिचय

-

ghost-progress-plugin एक छोटा, बिना निर्भरता वाला Ghost रीडिंग प्रोग्रेस बार है। यह Ghost के लिए शुरू हुआ था, लेकिन यह Notion-आधारित ब्लॉग पर भी काम करता है, और जहाँ भी आप स्क्रिप्ट जोड़ सकते हैं वहाँ चलता है। पढ़ते समय एक पतली बार भरती है और बताती है कि आप लेख में कहाँ तक पहुँचे। यह पेज एक लाइव उदाहरण है: ऊपर की बार असली विजेट ही है।

- -

इंस्टॉलेशन

-

बिना किसी बिल्ड चरण या थीम फ़ाइल संपादन के, नीचे दिया स्निपेट एक बार चिपकाएँ:

-
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/GreedyLabs/ghost-progress-plugin@1/progress.css">
-<script src="https://cdn.jsdelivr.net/gh/GreedyLabs/ghost-progress-plugin@1/progress.min.js"
-        data-content=".gh-content"
-        data-position="top"></script>
-

कोड इंजेक्शन

-

Ghost में इसे Settings → Code injection → Site Footer में पेस्ट करें। Notion-आधारित होस्टिंग पर इसे कस्टम कोड फ़ील्ड में जोड़ें: oopy में head/footer कोड बॉक्स होता है, super.so में Custom Code क्षेत्र होता है, और वहाँ data-content को .notion-page-content पर सेट करें। किसी और साइट पर इसे बंद होते </body> टैग से ठीक पहले रखें।

-

विकल्प

-

सारा व्यवहार स्क्रिप्ट टैग पर data-* एट्रिब्यूट से सेट होता है: कंटेंट सिलेक्टर, स्थिति, मोटाई और z-index:

-
data-content=".gh-content"
-data-position="top"
-data-height="4"
-data-z-index="100"
- -

कस्टमाइज़

-

बार का रंग और मोटाई समायोज्य हैं। हर क्लास और CSS वेरिएबल greedylabs-ghost-progress नेमस्पेस में है, इसलिए यह आपकी थीम से कभी नहीं टकराता।

-

रंग

-

भराव डिफ़ॉल्ट रूप से आपकी Ghost थीम के एक्सेंट रंग (--ghost-accent-color) का अनुसरण करता है; बदलने के लिए data-color दें या CSS वेरिएबल ओवरराइड करें। बिना पढ़ा ट्रैक डिफ़ॉल्ट रूप से पारदर्शी है, इसलिए 0% पर भी बार दिखाने के लिए ट्रैक को रंग दें:

-
.greedylabs-ghost-progress {
-  --greedylabs-ghost-progress-track: rgba(0,0,0,.08);
-}
-@media (prefers-color-scheme: dark) {
-  .greedylabs-ghost-progress {
-    --greedylabs-ghost-progress-track: rgba(255,255,255,.14);
-  }
-}
-

स्थिति

-

ऊपर/नीचे के लिए data-position, और पिक्सेल में मोटाई के लिए data-height इस्तेमाल करें। जब लेख का शीर्ष व्यूपोर्ट के शीर्ष से मिलता है तो बार 0%, और जब उसका तल व्यूपोर्ट के तल से मिलता है तो 100% हो जाती है।

- -

अक्सर पूछे जाने वाले प्रश्न

- -

यह पूरे पेज को मापता है या सिर्फ़ लेख को?

-

सिर्फ़ उस लेख को जिसे आप data-content से इंगित करते हैं। हेडर, फ़ीचर इमेज और फ़ुटर प्रगति में नहीं गिने जाते।

-

ऊपर बार क्यों नहीं दिखती?

-

0% पर भराव की चौड़ाई शून्य होती है और ट्रैक डिफ़ॉल्ट रूप से पारदर्शी है। ट्रैक को रंग दें (रंग अनुभाग देखें) ताकि खाली होने पर भी बार दिखे।

-

क्या यह Ghost के बाहर काम करता है?

-

हाँ। जहाँ भी आप स्क्रिप्ट इंजेक्ट कर सकें, data-content को अपने लेख कंटेनर पर इंगित करें। Notion में यह .notion-page-content है।

- -

निष्कर्ष

-

ghost-progress-plugin MIT लाइसेंस के तहत ओपन सोर्स है; कोड और issues GitHub पर हैं। बाएँ पैनल में विकल्प आज़माएँ और पसंद आने पर एम्बेड कोड कॉपी करें। अगर यह आपके काम आया, तो एक कॉफ़ी का स्वागत है ☕।

-
- -
- -
- - - - - - diff --git a/i18n/meta.json b/i18n/meta.json new file mode 100644 index 0000000..a43954b --- /dev/null +++ b/i18n/meta.json @@ -0,0 +1,36 @@ +{ + "order": [ + "ko", + "en", + "ja", + "zh", + "es", + "fr", + "de", + "pt", + "hi" + ], + "default": "en", + "names": { + "ko": "한국어", + "en": "English", + "ja": "日本語", + "zh": "中文", + "es": "Español", + "fr": "Français", + "de": "Deutsch", + "pt": "Português", + "hi": "हिन्दी" + }, + "locales": { + "ko": "ko_KR", + "en": "en_US", + "ja": "ja_JP", + "zh": "zh_CN", + "es": "es_ES", + "fr": "fr_FR", + "de": "de_DE", + "pt": "pt_BR", + "hi": "hi_IN" + } +} diff --git a/i18n/request.js b/i18n/request.js new file mode 100644 index 0000000..2ab5770 --- /dev/null +++ b/i18n/request.js @@ -0,0 +1,9 @@ +import { getRequestConfig } from 'next-intl/server'; +import meta from './meta.json'; + +export default getRequestConfig(async ({ requestLocale }) => { + let locale = await requestLocale; + if (!locale || !meta.order.includes(locale)) locale = meta.default; + const messages = (await import(`../messages/${locale}.json`)).default; + return { locale, messages }; +}); diff --git a/i18n/translations.json b/i18n/translations.json deleted file mode 100644 index f51107d..0000000 --- a/i18n/translations.json +++ /dev/null @@ -1,475 +0,0 @@ -{ - "order": [ - "ko", - "en", - "ja", - "zh", - "es", - "fr", - "de", - "pt", - "hi" - ], - "default": "en", - "langs": { - "ko": { - "name": "한국어", - "locale": "ko_KR", - "title": "ghost-progress-plugin: Ghost용 읽기 진행 바 · 설정 & 데모", - "description": "Ghost 블로그에 코드 한 줄로 붙이는 읽기 진행 바. 옵션을 바꿔 실시간 미리보고 임베드 코드를 복사하세요. 오픈소스(MIT).", - "lblContent": "본문 선택자", - "hintContent": "(코드용 · 미리보기는 데모 본문)", - "lblPosition": "위치", - "embedLabel": "임베드 코드", - "copy": "복사", - "copyDone": "복사됨", - "heroText": "대표 이미지 (feature image)", - "demoTitle": "ghost-progress-plugin 미리보기", - "demoIntro": "스크롤하면 상단 바가 0%에서 100%로 채워집니다. 왼쪽 패널에서 옵션을 바꾸면 임베드 코드도 함께 갱신됩니다.", - "h_intro": "들어가며", - "h_install": "설치 방법", - "h_codeinjection": "코드 인젝션", - "h_options": "옵션 설정", - "h_customize": "커스터마이즈", - "h_color": "색상", - "h_position": "위치", - "h_closing": "마치며", - "commentsTitle": "댓글", - "langLabel": "언어", - "support": "도움이 되었다면 커피 한 잔 어때요? ☕", - "themeLabel": "테마", - "themeSystem": "시스템", - "themeLight": "라이트", - "themeDark": "다크", - "bodyIntro": "ghost-progress-plugin은 Ghost용의 가볍고 의존성 없는 읽기 진행 바입니다. Ghost 전용으로 시작했지만, Notion 기반 블로그에서도 동작하며 스크립트를 넣을 수 있는 곳이면 어디서나 동작합니다. 읽는 동안 얇은 바가 채워져 글의 어디쯤인지 보여줍니다. 이 페이지가 바로 그 예시로, 상단의 바가 실제로 동작하는 위젯입니다.", - "bodyInstall": "빌드 과정도, 테마 파일 수정도 없이 아래 스니펫 한 번이면 설치가 끝납니다:", - "bodyCodeInjection": "Ghost에서는 Settings → Code injection → Site Footer 에 붙여넣습니다. Notion 기반 호스팅이라면 커스텀 코드 주입란에 넣습니다. oopy는 사이트 설정의 head/footer 코드란, super.so는 Custom Code 영역이며, 이때 data-content를 .notion-page-content로 지정하세요. 그 밖의 사이트라면 닫는 태그 바로 앞에 두면 됩니다.", - "bodyOptions": "동작은 모두 스크립트 태그의 data-* 속성으로 설정합니다: 본문 선택자, 위치, 두께, z-index를 지정할 수 있습니다:", - "bodyCustomize": "바의 색과 두께는 자유롭게 조절할 수 있습니다. 모든 클래스와 CSS 변수는 greedylabs-ghost-progress로 네임스페이스가 걸려 있어 테마와 절대 충돌하지 않습니다.", - "bodyColor": "채움 색은 기본적으로 Ghost 테마 강조색(--ghost-accent-color)을 따릅니다. 바꾸려면 data-color를 주거나 CSS 변수를 덮어쓰면 됩니다. 읽지 않은 부분의 트랙은 기본이 투명이니, 0%에서도 바가 보이게 하려면 트랙에 색을 주세요:", - "bodyPosition": "data-position으로 위/아래를, data-height로 두께(px)를 정합니다. 바는 글 상단이 뷰포트 위에 닿으면 0%, 글 하단이 뷰포트 바닥에 닿으면 100%가 됩니다.", - "bodyClosing": "ghost-progress-plugin은 MIT 라이선스 오픈소스이며, 소스와 이슈는 GitHub에 있습니다. 왼쪽 패널에서 옵션을 바꿔 확인한 뒤 마음에 들면 임베드 코드를 복사하세요. 도움이 되었다면 커피 한 잔 부탁드려요 ☕.", - "h_faq": "자주 묻는 질문", - "faqQ1": "전체 페이지 기준인가요, 본문 기준인가요?", - "faqA1": "data-content로 가리킨 본문 기준입니다. 헤더, 대표 이미지, 푸터는 진행률에 포함되지 않습니다.", - "faqQ2": "맨 위에서 바가 안 보여요.", - "faqA2": "0%에서는 채움 폭이 0이고 트랙이 기본 투명이라 그렇습니다. 트랙에 색을 주면(색상 섹션 참고) 비어 있어도 바가 보입니다.", - "faqQ3": "Ghost가 아니어도 되나요?", - "faqA3": "됩니다. 스크립트를 넣을 수 있는 곳이면 data-content로 본문 컨테이너만 가리키면 됩니다. Notion은 .notion-page-content입니다.", - "optTop": "위", - "optBottom": "아래", - "lblHeight": "두께(px)", - "lblAutoColor": "Ghost 테마 강조색 자동 사용", - "lblColor": "바 색상", - "lblZindex": "z-index" - }, - "en": { - "name": "English", - "locale": "en_US", - "title": "ghost-progress-plugin: Reading progress bar for Ghost · configurator & demo", - "description": "Add a reading progress bar to your Ghost blog with one line of code. Tweak options, preview live, and copy the embed snippet. Open source (MIT).", - "lblContent": "Content selector", - "hintContent": "(for the snippet · preview uses the demo body)", - "lblPosition": "Position", - "embedLabel": "Embed code", - "copy": "Copy", - "copyDone": "Copied", - "heroText": "Feature image", - "demoTitle": "ghost-progress-plugin preview", - "demoIntro": "Scroll and watch the bar at the top fill from 0% to 100%. Change options in the left panel and the embed code updates with them.", - "h_intro": "Getting started", - "h_install": "Installation", - "h_codeinjection": "Code injection", - "h_options": "Options", - "h_customize": "Customize", - "h_color": "Colors", - "h_position": "Position", - "h_closing": "Wrapping up", - "commentsTitle": "Comments", - "langLabel": "Language", - "support": "Found it useful? Buy me a coffee ☕", - "themeLabel": "Theme", - "themeSystem": "System", - "themeLight": "Light", - "themeDark": "Dark", - "bodyIntro": "ghost-progress-plugin is a tiny, dependency-free reading progress bar for Ghost. It started as a Ghost widget, but it also works on Notion-based blogs, and anywhere you can add a script. As you read, a thin bar fills to show how far through the article you are. This page is a live example: the bar at the top is the real widget.", - "bodyInstall": "Add it once with this snippet, no build step, no theme files to edit:", - "bodyCodeInjection": "In Ghost, paste it into Settings → Code injection → Site Footer. On Notion-based hosting, add it in the custom-code field: oopy has a head/footer code box in its site settings, super.so has a Custom Code area, and there you set data-content to .notion-page-content. On any other site, put it just before the closing tag.", - "bodyOptions": "Everything is configured with data-* attributes on the script tag: the content selector, the position, the height, and the z-index:", - "bodyCustomize": "The bar color and thickness are adjustable. Every class and CSS variable is namespaced under greedylabs-ghost-progress, so it never clashes with your theme.", - "bodyColor": "The fill follows your Ghost theme accent (--ghost-accent-color) by default; set data-color or override the CSS variables to change it. The unread track is transparent by default, so give it a color to make the bar visible even at 0%:", - "bodyPosition": "Use data-position for top or bottom, and data-height for the thickness in pixels. The bar reaches 0% when the article top meets the top of the viewport, and 100% when its bottom meets the bottom.", - "bodyClosing": "ghost-progress-plugin is open source under the MIT license; the code and issues live on GitHub. Try the options in the left panel and copy the embed snippet when you are happy. If it helped you, a coffee is always appreciated ☕.", - "h_faq": "FAQ", - "faqQ1": "Does it track the whole page or just the article?", - "faqA1": "Just the article you point data-content at. The header, feature image, and footer do not count toward the progress.", - "faqQ2": "Why is the bar invisible at the top?", - "faqA2": "At 0% the fill has no width and the track is transparent by default. Give the track a color (see Colors) to show the bar even when empty.", - "faqQ3": "Does it work outside Ghost?", - "faqA3": "Yes. Anywhere you can inject a script, point data-content at your article container. For Notion that is .notion-page-content.", - "optTop": "Top", - "optBottom": "Bottom", - "lblHeight": "Height (px)", - "lblAutoColor": "Use the Ghost theme accent automatically", - "lblColor": "Bar color", - "lblZindex": "Z-index" - }, - "ja": { - "name": "日本語", - "locale": "ja_JP", - "title": "ghost-progress-plugin: Ghost 用の読書プログレスバー · 設定 & デモ", - "description": "コード1行で Ghost ブログに読書プログレスバーを追加。オプションを変えてライブプレビューし、埋め込みコードをコピー。オープンソース(MIT)。", - "lblContent": "本文セレクタ", - "hintContent": "(コード用 · プレビューはデモ本文)", - "lblPosition": "位置", - "embedLabel": "埋め込みコード", - "copy": "コピー", - "copyDone": "コピーしました", - "heroText": "アイキャッチ画像", - "demoTitle": "ghost-progress-plugin プレビュー", - "demoIntro": "スクロールすると上部のバーが0%から100%へ満ちます。左パネルでオプションを変えると、埋め込みコードも一緒に更新されます。", - "h_intro": "はじめに", - "h_install": "インストール", - "h_codeinjection": "コードインジェクション", - "h_options": "オプション設定", - "h_customize": "カスタマイズ", - "h_color": "配色", - "h_position": "位置", - "h_closing": "おわりに", - "commentsTitle": "コメント", - "langLabel": "言語", - "support": "役に立ったらコーヒーを一杯 ☕", - "themeLabel": "テーマ", - "themeSystem": "システム", - "themeLight": "ライト", - "themeDark": "ダーク", - "bodyIntro": "ghost-progress-plugin は Ghost 用の軽量で依存関係のない読書プログレスバーです。Ghost 向けとして始まりましたが、Notion ベースのブログでも動作し、スクリプトを追加できる場所ならどこでも動きます。読むにつれて細いバーが満ち、記事のどこまで読んだかを示します。このページがそのまま実例で、上部のバーが実際に動くウィジェットです。", - "bodyInstall": "ビルド工程もテーマ編集も不要。下のスニペットを一度貼り付けるだけです:", - "bodyCodeInjection": "Ghost では Settings → Code injection → Site Footer に貼り付けます。Notion ベースのホスティングなら、カスタムコード欄に追加します。oopy はサイト設定の head/footer コード欄、super.so は Custom Code 領域があり、そこで data-content を .notion-page-content にします。その他のサイトでは閉じタグ の直前に置きます。", - "bodyOptions": "動作はすべてスクリプトタグの data-* 属性で設定します:本文セレクタ、位置、太さ、z-index を指定できます:", - "bodyCustomize": "バーの色と太さは自由に調整できます。すべてのクラスと CSS 変数は greedylabs-ghost-progress で名前空間化されており、テーマと衝突しません。", - "bodyColor": "満ちる色は、既定で Ghost テーマのアクセント色(--ghost-accent-color)に従います。変更するには data-color を指定するか、CSS 変数を上書きします。未読部分のトラックは既定で透明なので、0%でもバーを見せたい場合はトラックに色を付けます:", - "bodyPosition": "data-position で上下、data-height で太さ(px)を指定します。バーは記事の上端がビューポート上端に来ると0%、下端がビューポート下端に来ると100%になります。", - "bodyClosing": "ghost-progress-plugin は MIT ライセンスのオープンソースで、コードと Issue は GitHub にあります。左パネルでオプションを変え、気に入ったら埋め込みコードをコピーしてください。お役に立てたら、コーヒーを一杯いただけると嬉しいです ☕。", - "h_faq": "よくある質問", - "faqQ1": "ページ全体ですか、それとも記事だけですか?", - "faqA1": "data-content で指定した記事だけです。ヘッダー、フィーチャー画像、フッターは進捗に含まれません。", - "faqQ2": "上部でバーが見えません。", - "faqA2": "0%では満ちる幅が0で、トラックが既定で透明だからです。トラックに色を付けると(配色セクション参照)、空でもバーが見えます。", - "faqQ3": "Ghost 以外でも使えますか?", - "faqA3": "使えます。スクリプトを追加できる場所なら、data-content で本文コンテナを指定するだけです。Notion では .notion-page-content です。", - "optTop": "上", - "optBottom": "下", - "lblHeight": "太さ(px)", - "lblAutoColor": "Ghost テーマのアクセント色を自動使用", - "lblColor": "バーの色", - "lblZindex": "z-index" - }, - "zh": { - "name": "中文", - "locale": "zh_CN", - "title": "ghost-progress-plugin: Ghost 阅读进度条 · 配置与演示", - "description": "用一行代码为你的 Ghost 博客添加阅读进度条。修改选项、实时预览并复制嵌入代码。开源(MIT)。", - "lblContent": "正文选择器", - "hintContent": "(用于代码 · 预览使用演示正文)", - "lblPosition": "位置", - "embedLabel": "嵌入代码", - "copy": "复制", - "copyDone": "已复制", - "heroText": "特色图片", - "demoTitle": "ghost-progress-plugin 预览", - "demoIntro": "滚动时顶部的进度条会从 0% 填充到 100%。在左侧面板修改选项,嵌入代码也随之更新。", - "h_intro": "开始之前", - "h_install": "安装方法", - "h_codeinjection": "代码注入", - "h_options": "选项设置", - "h_customize": "自定义", - "h_color": "颜色", - "h_position": "位置", - "h_closing": "结语", - "commentsTitle": "评论", - "langLabel": "语言", - "support": "有帮助的话,请我喝杯咖啡 ☕", - "themeLabel": "主题", - "themeSystem": "系统", - "themeLight": "浅色", - "themeDark": "深色", - "bodyIntro": "ghost-progress-plugin 是一个轻量、无依赖的 Ghost 阅读进度条。它最初是为 Ghost 而做,但同样适用于基于 Notion 的博客,以及任何能添加脚本的地方。阅读时一条细条会填充,显示你读到文章的哪个位置。本页就是实时示例,顶部的进度条正是真实运行的组件。", - "bodyInstall": "无需构建、无需修改主题文件,粘贴下面这段代码即可完成安装:", - "bodyCodeInjection": "在 Ghost 中,粘贴到 Settings → Code injection → Site Footer。基于 Notion 的托管,则放进自定义代码处:oopy 在站点设置里有 head/footer 代码框,super.so 有 Custom Code 区域,在那里把 data-content 设为 .notion-page-content。其他网站则放在结束标签 之前。", - "bodyOptions": "所有行为都通过脚本标签上的 data-* 属性配置:可设置正文选择器、位置、粗细和 z-index:", - "bodyCustomize": "进度条的颜色和粗细都可自由调整。所有类名和 CSS 变量都以 greedylabs-ghost-progress 命名空间隔离,绝不会与你的主题冲突。", - "bodyColor": "填充色默认跟随 Ghost 主题强调色(--ghost-accent-color)。要更改,可设置 data-color 或覆盖 CSS 变量。未读部分的轨道默认透明,若想在 0% 时也能看到进度条,请给轨道设置颜色:", - "bodyPosition": "用 data-position 设置顶部或底部,data-height 设置粗细(px)。当文章顶部到达视口顶部时为 0%,底部到达视口底部时为 100%。", - "bodyClosing": "ghost-progress-plugin 是 MIT 许可的开源项目,代码与问题反馈都在 GitHub 上。在左侧面板调整选项,满意后复制嵌入代码即可。如果它帮到了你,欢迎请我喝杯咖啡 ☕。", - "h_faq": "常见问题", - "faqQ1": "它以整页为准还是以文章为准?", - "faqA1": "以你用 data-content 指定的文章为准。页眉、封面图和页脚不计入进度。", - "faqQ2": "为什么顶部看不到进度条?", - "faqA2": "在 0% 时填充宽度为 0,且轨道默认透明。给轨道设置颜色(见配色一节),空的时候也能看到进度条。", - "faqQ3": "在 Ghost 之外能用吗?", - "faqA3": "能。只要能注入脚本,用 data-content 指向你的正文容器即可。Notion 是 .notion-page-content。", - "optTop": "顶部", - "optBottom": "底部", - "lblHeight": "粗细(px)", - "lblAutoColor": "自动使用 Ghost 主题强调色", - "lblColor": "进度条颜色", - "lblZindex": "z-index" - }, - "es": { - "name": "Español", - "locale": "es_ES", - "title": "ghost-progress-plugin: Barra de progreso de lectura para Ghost · configurador y demo", - "description": "Añade una barra de progreso de lectura a tu blog Ghost con una línea de código. Ajusta opciones, previsualiza en vivo y copia el fragmento. Código abierto (MIT).", - "lblContent": "Selector de contenido", - "hintContent": "(para el código · la vista previa usa el cuerpo demo)", - "lblPosition": "Posición", - "embedLabel": "Código de inserción", - "copy": "Copiar", - "copyDone": "Copiado", - "heroText": "Imagen destacada", - "demoTitle": "Vista previa de ghost-progress-plugin", - "demoIntro": "Desplázate y mira la barra superior llenarse de 0% a 100%. Cambia las opciones en el panel izquierdo y el código de inserción se actualiza.", - "h_intro": "Introducción", - "h_install": "Instalación", - "h_codeinjection": "Inyección de código", - "h_options": "Opciones", - "h_customize": "Personalización", - "h_color": "Colores", - "h_position": "Posición", - "h_closing": "Conclusión", - "commentsTitle": "Comentarios", - "langLabel": "Idioma", - "support": "¿Te ha servido? Invítame a un café ☕", - "themeLabel": "Tema", - "themeSystem": "Sistema", - "themeLight": "Claro", - "themeDark": "Oscuro", - "bodyIntro": "ghost-progress-plugin es una barra de progreso de lectura diminuta y sin dependencias para Ghost. Empezó como un widget para Ghost, pero también funciona en blogs basados en Notion y en cualquier sitio donde puedas añadir un script. Mientras lees, una barra fina se llena para mostrar por dónde vas del artículo. Esta página es un ejemplo en vivo: la barra de arriba es el widget real.", - "bodyInstall": "Añádelo una sola vez con este fragmento, sin paso de compilación ni archivos del tema que editar:", - "bodyCodeInjection": "En Ghost, pégalo en Settings → Code injection → Site Footer. En hosting basado en Notion, añádelo en el campo de código personalizado: oopy tiene una caja de código head/footer, super.so tiene un área Custom Code, y ahí pones data-content en .notion-page-content. En cualquier otro sitio, colócalo justo antes de la etiqueta .", - "bodyOptions": "Todo se configura con atributos data-* en la etiqueta del script: el selector de contenido, la posición, el grosor y el z-index:", - "bodyCustomize": "El color y el grosor de la barra son ajustables. Cada clase y variable CSS está en el espacio de nombres greedylabs-ghost-progress, así que nunca choca con tu tema.", - "bodyColor": "El relleno sigue por defecto el color de acento de tu tema Ghost (--ghost-accent-color); usa data-color o sobrescribe las variables CSS para cambiarlo. La pista no leída es transparente por defecto, así que dale un color para que la barra se vea incluso al 0%:", - "bodyPosition": "Usa data-position para arriba o abajo, y data-height para el grosor en píxeles. La barra llega a 0% cuando la parte superior del artículo toca la parte superior de la ventana, y a 100% cuando su parte inferior toca la inferior.", - "bodyClosing": "ghost-progress-plugin es de código abierto bajo licencia MIT; el código y las incidencias están en GitHub. Prueba las opciones en el panel izquierdo y copia el fragmento cuando te guste. Si te ha servido, siempre se agradece un café ☕.", - "h_faq": "Preguntas frecuentes", - "faqQ1": "¿Mide toda la página o solo el artículo?", - "faqA1": "Solo el artículo al que apuntas con data-content. El encabezado, la imagen destacada y el pie no cuentan.", - "faqQ2": "¿Por qué la barra no se ve arriba?", - "faqA2": "Al 0% el relleno no tiene ancho y la pista es transparente por defecto. Dale color a la pista (ver Colores) para que la barra se vea aun vacía.", - "faqQ3": "¿Funciona fuera de Ghost?", - "faqA3": "Sí. Donde puedas inyectar un script, apunta data-content a tu contenedor de artículo. En Notion es .notion-page-content.", - "optTop": "Arriba", - "optBottom": "Abajo", - "lblHeight": "Grosor (px)", - "lblAutoColor": "Usar el color de acento del tema Ghost automáticamente", - "lblColor": "Color de la barra", - "lblZindex": "Z-index" - }, - "fr": { - "name": "Français", - "locale": "fr_FR", - "title": "ghost-progress-plugin: Barre de progression de lecture pour Ghost · configurateur & démo", - "description": "Ajoutez une barre de progression de lecture à votre blog Ghost en une ligne de code. Réglez les options, prévisualisez en direct et copiez le code. Open source (MIT).", - "lblContent": "Sélecteur de contenu", - "hintContent": "(pour le code · l'aperçu utilise le corps démo)", - "lblPosition": "Position", - "embedLabel": "Code d'intégration", - "copy": "Copier", - "copyDone": "Copié", - "heroText": "Image à la une", - "demoTitle": "Aperçu de ghost-progress-plugin", - "demoIntro": "Faites défiler et regardez la barre du haut se remplir de 0% à 100%. Modifiez les options dans le panneau de gauche, le code d'intégration se met à jour.", - "h_intro": "Pour commencer", - "h_install": "Installation", - "h_codeinjection": "Injection de code", - "h_options": "Options", - "h_customize": "Personnalisation", - "h_color": "Couleurs", - "h_position": "Position", - "h_closing": "Conclusion", - "commentsTitle": "Commentaires", - "langLabel": "Langue", - "support": "Utile ? Offrez-moi un café ☕", - "themeLabel": "Thème", - "themeSystem": "Système", - "themeLight": "Clair", - "themeDark": "Sombre", - "bodyIntro": "ghost-progress-plugin est une barre de progression de lecture minuscule et sans dépendance pour Ghost. Il a commencé comme un widget pour Ghost, mais il fonctionne aussi sur les blogs basés sur Notion, et partout où vous pouvez ajouter un script. Pendant la lecture, une fine barre se remplit pour indiquer où vous en êtes dans l'article. Cette page est un exemple en direct : la barre en haut est le vrai widget.", - "bodyInstall": "Ajoutez-le en une fois avec cet extrait, sans étape de build ni fichiers de thème à modifier :", - "bodyCodeInjection": "Dans Ghost, collez-le dans Settings → Code injection → Site Footer. Sur un hébergement basé sur Notion, ajoutez-le dans le champ de code personnalisé : oopy propose une zone de code head/footer, super.so a une zone Custom Code, et là vous réglez data-content sur .notion-page-content. Sur tout autre site, placez-le juste avant la balise .", - "bodyOptions": "Tout se configure avec des attributs data-* sur la balise script : le sélecteur de contenu, la position, l'épaisseur et le z-index :", - "bodyCustomize": "La couleur et l'épaisseur de la barre sont réglables. Chaque classe et variable CSS est dans l'espace de noms greedylabs-ghost-progress, donc elle n'entre jamais en conflit avec votre thème.", - "bodyColor": "Le remplissage suit par défaut la couleur d'accent de votre thème Ghost (--ghost-accent-color) ; utilisez data-color ou redéfinissez les variables CSS pour la changer. La piste non lue est transparente par défaut, donnez-lui donc une couleur pour que la barre soit visible même à 0% :", - "bodyPosition": "Utilisez data-position pour haut ou bas, et data-height pour l'épaisseur en pixels. La barre atteint 0% quand le haut de l'article rejoint le haut de la fenêtre, et 100% quand son bas rejoint le bas.", - "bodyClosing": "ghost-progress-plugin est open source sous licence MIT ; le code et les tickets sont sur GitHub. Essayez les options dans le panneau de gauche et copiez l'extrait quand cela vous convient. Si cela vous a aidé, un café est toujours apprécié ☕.", - "h_faq": "Questions fréquentes", - "faqQ1": "Mesure-t-il toute la page ou seulement l'article ?", - "faqA1": "Seulement l'article visé par data-content. L'en-tête, l'image à la une et le pied de page ne comptent pas.", - "faqQ2": "Pourquoi la barre est-elle invisible en haut ?", - "faqA2": "À 0% le remplissage n'a pas de largeur et la piste est transparente par défaut. Donnez une couleur à la piste (voir Couleurs) pour voir la barre même vide.", - "faqQ3": "Fonctionne-t-il hors de Ghost ?", - "faqA3": "Oui. Partout où vous pouvez injecter un script, pointez data-content vers votre conteneur d'article. Pour Notion, c'est .notion-page-content.", - "optTop": "Haut", - "optBottom": "Bas", - "lblHeight": "Épaisseur (px)", - "lblAutoColor": "Utiliser automatiquement la couleur d'accent du thème Ghost", - "lblColor": "Couleur de la barre", - "lblZindex": "Z-index" - }, - "de": { - "name": "Deutsch", - "locale": "de_DE", - "title": "ghost-progress-plugin: Lesefortschrittsbalken für Ghost · Konfigurator & Demo", - "description": "Füge deinem Ghost-Blog mit einer Zeile Code einen Lesefortschrittsbalken hinzu. Optionen anpassen, live vorschauen, Snippet kopieren. Open Source (MIT).", - "lblContent": "Inhalts-Selektor", - "hintContent": "(für den Code · Vorschau nutzt den Demo-Inhalt)", - "lblPosition": "Position", - "embedLabel": "Einbettungscode", - "copy": "Kopieren", - "copyDone": "Kopiert", - "heroText": "Beitragsbild", - "demoTitle": "ghost-progress-plugin Vorschau", - "demoIntro": "Scrolle und sieh zu, wie sich der Balken oben von 0% auf 100% füllt. Ändere Optionen im linken Panel, der Einbettungscode aktualisiert sich mit.", - "h_intro": "Einführung", - "h_install": "Installation", - "h_codeinjection": "Code-Injection", - "h_options": "Optionen", - "h_customize": "Anpassung", - "h_color": "Farben", - "h_position": "Position", - "h_closing": "Fazit", - "commentsTitle": "Kommentare", - "langLabel": "Sprache", - "support": "Hilfreich? Spendier mir einen Kaffee ☕", - "themeLabel": "Theme", - "themeSystem": "System", - "themeLight": "Hell", - "themeDark": "Dunkel", - "bodyIntro": "ghost-progress-plugin ist ein winziger, abhängigkeitsfreier Lesefortschrittsbalken für Ghost. Es begann als Widget für Ghost, funktioniert aber auch in Notion-basierten Blogs und überall, wo du ein Skript einbinden kannst. Beim Lesen füllt sich ein dünner Balken und zeigt, wie weit du im Artikel bist. Diese Seite ist ein Live-Beispiel: Der Balken oben ist das echte Widget.", - "bodyInstall": "Einmal mit diesem Snippet einbinden, ohne Build-Schritt und ohne Theme-Dateien zu bearbeiten:", - "bodyCodeInjection": "Füge es in Ghost unter Settings → Code injection → Site Footer ein. Auf Notion-basiertem Hosting fügst du es im Feld für eigenen Code ein: oopy hat ein head/footer-Codefeld, super.so hat einen Custom-Code-Bereich, und dort setzt du data-content auf .notion-page-content. Auf jeder anderen Seite platzierst du es direkt vor dem schließenden -Tag.", - "bodyOptions": "Alles wird über data-*-Attribute am Script-Tag konfiguriert: der Inhalts-Selektor, die Position, die Dicke und der Z-Index:", - "bodyCustomize": "Farbe und Dicke des Balkens sind anpassbar. Jede Klasse und CSS-Variable ist unter greedylabs-ghost-progress benannt, sodass er nie mit deinem Theme kollidiert.", - "bodyColor": "Die Füllung folgt standardmäßig der Akzentfarbe deines Ghost-Themes (--ghost-accent-color); setze data-color oder überschreibe die CSS-Variablen, um sie zu ändern. Die ungelesene Spur ist standardmäßig transparent, gib ihr also eine Farbe, damit der Balken auch bei 0% sichtbar ist:", - "bodyPosition": "Nutze data-position für oben oder unten und data-height für die Dicke in Pixeln. Der Balken erreicht 0%, wenn der obere Rand des Artikels den oberen Rand des Viewports erreicht, und 100%, wenn sein unterer Rand den unteren erreicht.", - "bodyClosing": "ghost-progress-plugin ist Open Source unter der MIT-Lizenz; Code und Issues findest du auf GitHub. Probiere die Optionen im linken Panel aus und kopiere das Snippet, wenn es passt. Wenn es dir geholfen hat, freue ich mich über einen Kaffee ☕.", - "h_faq": "Häufige Fragen", - "faqQ1": "Misst es die ganze Seite oder nur den Artikel?", - "faqA1": "Nur den Artikel, auf den data-content zeigt. Header, Beitragsbild und Footer zählen nicht zum Fortschritt.", - "faqQ2": "Warum ist der Balken oben unsichtbar?", - "faqA2": "Bei 0% hat die Füllung keine Breite und die Spur ist standardmäßig transparent. Gib der Spur eine Farbe (siehe Farben), damit der Balken auch leer sichtbar ist.", - "faqQ3": "Funktioniert es außerhalb von Ghost?", - "faqA3": "Ja. Überall, wo du ein Skript einbinden kannst, zeige mit data-content auf deinen Artikel-Container. Bei Notion ist das .notion-page-content.", - "optTop": "Oben", - "optBottom": "Unten", - "lblHeight": "Dicke (px)", - "lblAutoColor": "Akzentfarbe des Ghost-Themes automatisch verwenden", - "lblColor": "Balkenfarbe", - "lblZindex": "Z-Index" - }, - "pt": { - "name": "Português", - "locale": "pt_BR", - "title": "ghost-progress-plugin: Barra de progresso de leitura para Ghost · configurador e demo", - "description": "Adicione uma barra de progresso de leitura ao seu blog Ghost com uma linha de código. Ajuste opções, veja a prévia ao vivo e copie o snippet. Código aberto (MIT).", - "lblContent": "Seletor de conteúdo", - "hintContent": "(para o código · a prévia usa o corpo demo)", - "lblPosition": "Posição", - "embedLabel": "Código de incorporação", - "copy": "Copiar", - "copyDone": "Copiado", - "heroText": "Imagem destacada", - "demoTitle": "Prévia do ghost-progress-plugin", - "demoIntro": "Role e veja a barra do topo encher de 0% a 100%. Altere as opções no painel à esquerda e o código de incorporação é atualizado.", - "h_intro": "Introdução", - "h_install": "Instalação", - "h_codeinjection": "Injeção de código", - "h_options": "Opções", - "h_customize": "Personalização", - "h_color": "Cores", - "h_position": "Posição", - "h_closing": "Conclusão", - "commentsTitle": "Comentários", - "langLabel": "Idioma", - "support": "Foi útil? Me paga um café ☕", - "themeLabel": "Tema", - "themeSystem": "Sistema", - "themeLight": "Claro", - "themeDark": "Escuro", - "bodyIntro": "ghost-progress-plugin é uma barra de progresso de leitura minúscula e sem dependências para o Ghost. Começou como um widget para o Ghost, mas também funciona em blogs baseados em Notion e em qualquer lugar onde você possa adicionar um script. Enquanto você lê, uma barra fina se enche para mostrar até onde você está no artigo. Esta página é um exemplo ao vivo: a barra no topo é o widget real.", - "bodyInstall": "Adicione de uma vez com este trecho, sem etapa de build nem arquivos do tema para editar:", - "bodyCodeInjection": "No Ghost, cole em Settings → Code injection → Site Footer. Em hospedagem baseada em Notion, adicione no campo de código personalizado: o oopy tem uma caixa de código head/footer, o super.so tem uma área Custom Code, e ali você define data-content como .notion-page-content. Em qualquer outro site, coloque logo antes da tag .", - "bodyOptions": "Tudo é configurado com atributos data-* na tag do script: o seletor de conteúdo, a posição, a espessura e o z-index:", - "bodyCustomize": "A cor e a espessura da barra são ajustáveis. Cada classe e variável CSS fica no namespace greedylabs-ghost-progress, então nunca conflita com o seu tema.", - "bodyColor": "O preenchimento segue, por padrão, a cor de destaque do seu tema Ghost (--ghost-accent-color); use data-color ou sobrescreva as variáveis CSS para mudá-la. A trilha não lida é transparente por padrão, então dê a ela uma cor para a barra aparecer mesmo em 0%:", - "bodyPosition": "Use data-position para topo ou base, e data-height para a espessura em pixels. A barra chega a 0% quando o topo do artigo encontra o topo da viewport, e a 100% quando a base encontra a base.", - "bodyClosing": "ghost-progress-plugin é de código aberto sob a licença MIT; o código e as issues estão no GitHub. Experimente as opções no painel à esquerda e copie o trecho quando gostar. Se ajudou você, um café é sempre bem-vindo ☕.", - "h_faq": "Perguntas frequentes", - "faqQ1": "Ele mede a página toda ou só o artigo?", - "faqA1": "Só o artigo apontado por data-content. Cabeçalho, imagem de destaque e rodapé não contam no progresso.", - "faqQ2": "Por que a barra fica invisível no topo?", - "faqA2": "Em 0% o preenchimento não tem largura e a trilha é transparente por padrão. Dê uma cor à trilha (ver Cores) para a barra aparecer mesmo vazia.", - "faqQ3": "Funciona fora do Ghost?", - "faqA3": "Sim. Onde você puder injetar um script, aponte data-content para o seu contêiner de artigo. No Notion é .notion-page-content.", - "optTop": "Topo", - "optBottom": "Base", - "lblHeight": "Espessura (px)", - "lblAutoColor": "Usar a cor de destaque do tema Ghost automaticamente", - "lblColor": "Cor da barra", - "lblZindex": "Z-index" - }, - "hi": { - "name": "हिन्दी", - "locale": "hi_IN", - "title": "ghost-progress-plugin: Ghost के लिए रीडिंग प्रोग्रेस बार · कॉन्फ़िगरेटर और डेमो", - "description": "एक लाइन कोड से अपने Ghost ब्लॉग में रीडिंग प्रोग्रेस बार जोड़ें। विकल्प बदलें, लाइव प्रीव्यू देखें और एम्बेड स्निपेट कॉपी करें। ओपन सोर्स (MIT)।", - "lblContent": "कंटेंट सिलेक्टर", - "hintContent": "(कोड के लिए · प्रीव्यू डेमो बॉडी दिखाता है)", - "lblPosition": "स्थिति", - "embedLabel": "एम्बेड कोड", - "copy": "कॉपी", - "copyDone": "कॉपी हो गया", - "heroText": "फ़ीचर छवि", - "demoTitle": "ghost-progress-plugin प्रीव्यू", - "demoIntro": "स्क्रॉल करें और ऊपर की बार को 0% से 100% तक भरते देखें। बाएँ पैनल में विकल्प बदलें, एम्बेड कोड भी साथ में अपडेट होता है।", - "h_intro": "परिचय", - "h_install": "इंस्टॉलेशन", - "h_codeinjection": "कोड इंजेक्शन", - "h_options": "विकल्प", - "h_customize": "कस्टमाइज़", - "h_color": "रंग", - "h_position": "स्थिति", - "h_closing": "निष्कर्ष", - "commentsTitle": "टिप्पणियाँ", - "langLabel": "भाषा", - "support": "पसंद आया? एक कॉफ़ी पिलाएँ ☕", - "themeLabel": "थीम", - "themeSystem": "सिस्टम", - "themeLight": "लाइट", - "themeDark": "डार्क", - "bodyIntro": "ghost-progress-plugin एक छोटा, बिना निर्भरता वाला Ghost रीडिंग प्रोग्रेस बार है। यह Ghost के लिए शुरू हुआ था, लेकिन यह Notion-आधारित ब्लॉग पर भी काम करता है, और जहाँ भी आप स्क्रिप्ट जोड़ सकते हैं वहाँ चलता है। पढ़ते समय एक पतली बार भरती है और बताती है कि आप लेख में कहाँ तक पहुँचे। यह पेज एक लाइव उदाहरण है: ऊपर की बार असली विजेट ही है।", - "bodyInstall": "बिना किसी बिल्ड चरण या थीम फ़ाइल संपादन के, नीचे दिया स्निपेट एक बार चिपकाएँ:", - "bodyCodeInjection": "Ghost में इसे Settings → Code injection → Site Footer में पेस्ट करें। Notion-आधारित होस्टिंग पर इसे कस्टम कोड फ़ील्ड में जोड़ें: oopy में head/footer कोड बॉक्स होता है, super.so में Custom Code क्षेत्र होता है, और वहाँ data-content को .notion-page-content पर सेट करें। किसी और साइट पर इसे बंद होते टैग से ठीक पहले रखें।", - "bodyOptions": "सारा व्यवहार स्क्रिप्ट टैग पर data-* एट्रिब्यूट से सेट होता है: कंटेंट सिलेक्टर, स्थिति, मोटाई और z-index:", - "bodyCustomize": "बार का रंग और मोटाई समायोज्य हैं। हर क्लास और CSS वेरिएबल greedylabs-ghost-progress नेमस्पेस में है, इसलिए यह आपकी थीम से कभी नहीं टकराता।", - "bodyColor": "भराव डिफ़ॉल्ट रूप से आपकी Ghost थीम के एक्सेंट रंग (--ghost-accent-color) का अनुसरण करता है; बदलने के लिए data-color दें या CSS वेरिएबल ओवरराइड करें। बिना पढ़ा ट्रैक डिफ़ॉल्ट रूप से पारदर्शी है, इसलिए 0% पर भी बार दिखाने के लिए ट्रैक को रंग दें:", - "bodyPosition": "ऊपर/नीचे के लिए data-position, और पिक्सेल में मोटाई के लिए data-height इस्तेमाल करें। जब लेख का शीर्ष व्यूपोर्ट के शीर्ष से मिलता है तो बार 0%, और जब उसका तल व्यूपोर्ट के तल से मिलता है तो 100% हो जाती है।", - "bodyClosing": "ghost-progress-plugin MIT लाइसेंस के तहत ओपन सोर्स है; कोड और issues GitHub पर हैं। बाएँ पैनल में विकल्प आज़माएँ और पसंद आने पर एम्बेड कोड कॉपी करें। अगर यह आपके काम आया, तो एक कॉफ़ी का स्वागत है ☕।", - "h_faq": "अक्सर पूछे जाने वाले प्रश्न", - "faqQ1": "यह पूरे पेज को मापता है या सिर्फ़ लेख को?", - "faqA1": "सिर्फ़ उस लेख को जिसे आप data-content से इंगित करते हैं। हेडर, फ़ीचर इमेज और फ़ुटर प्रगति में नहीं गिने जाते।", - "faqQ2": "ऊपर बार क्यों नहीं दिखती?", - "faqA2": "0% पर भराव की चौड़ाई शून्य होती है और ट्रैक डिफ़ॉल्ट रूप से पारदर्शी है। ट्रैक को रंग दें (रंग अनुभाग देखें) ताकि खाली होने पर भी बार दिखे।", - "faqQ3": "क्या यह Ghost के बाहर काम करता है?", - "faqA3": "हाँ। जहाँ भी आप स्क्रिप्ट इंजेक्ट कर सकें, data-content को अपने लेख कंटेनर पर इंगित करें। Notion में यह .notion-page-content है।", - "optTop": "ऊपर", - "optBottom": "नीचे", - "lblHeight": "मोटाई (px)", - "lblAutoColor": "Ghost थीम का एक्सेंट रंग स्वतः उपयोग करें", - "lblColor": "बार का रंग", - "lblZindex": "Z-index" - } - } -} diff --git a/ja/index.html b/ja/index.html deleted file mode 100644 index e6559fe..0000000 --- a/ja/index.html +++ /dev/null @@ -1,253 +0,0 @@ - - - - - - - ghost-progress-plugin: Ghost 用の読書プログレスバー · 設定 & デモ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
アイキャッチ画像
- -
-

ghost-progress-plugin プレビュー

-

スクロールすると上部のバーが0%から100%へ満ちます。左パネルでオプションを変えると、埋め込みコードも一緒に更新されます。

- -

はじめに

-

ghost-progress-plugin は Ghost 用の軽量で依存関係のない読書プログレスバーです。Ghost 向けとして始まりましたが、Notion ベースのブログでも動作し、スクリプトを追加できる場所ならどこでも動きます。読むにつれて細いバーが満ち、記事のどこまで読んだかを示します。このページがそのまま実例で、上部のバーが実際に動くウィジェットです。

- -

インストール

-

ビルド工程もテーマ編集も不要。下のスニペットを一度貼り付けるだけです:

-
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/GreedyLabs/ghost-progress-plugin@1/progress.css">
-<script src="https://cdn.jsdelivr.net/gh/GreedyLabs/ghost-progress-plugin@1/progress.min.js"
-        data-content=".gh-content"
-        data-position="top"></script>
-

コードインジェクション

-

Ghost では Settings → Code injection → Site Footer に貼り付けます。Notion ベースのホスティングなら、カスタムコード欄に追加します。oopy はサイト設定の head/footer コード欄、super.so は Custom Code 領域があり、そこで data-content.notion-page-content にします。その他のサイトでは閉じタグ </body> の直前に置きます。

-

オプション設定

-

動作はすべてスクリプトタグの data-* 属性で設定します:本文セレクタ、位置、太さ、z-index を指定できます:

-
data-content=".gh-content"
-data-position="top"
-data-height="4"
-data-z-index="100"
- -

カスタマイズ

-

バーの色と太さは自由に調整できます。すべてのクラスと CSS 変数は greedylabs-ghost-progress で名前空間化されており、テーマと衝突しません。

-

配色

-

満ちる色は、既定で Ghost テーマのアクセント色(--ghost-accent-color)に従います。変更するには data-color を指定するか、CSS 変数を上書きします。未読部分のトラックは既定で透明なので、0%でもバーを見せたい場合はトラックに色を付けます:

-
.greedylabs-ghost-progress {
-  --greedylabs-ghost-progress-track: rgba(0,0,0,.08);
-}
-@media (prefers-color-scheme: dark) {
-  .greedylabs-ghost-progress {
-    --greedylabs-ghost-progress-track: rgba(255,255,255,.14);
-  }
-}
-

位置

-

data-position で上下、data-height で太さ(px)を指定します。バーは記事の上端がビューポート上端に来ると0%、下端がビューポート下端に来ると100%になります。

- -

よくある質問

- -

ページ全体ですか、それとも記事だけですか?

-

data-content で指定した記事だけです。ヘッダー、フィーチャー画像、フッターは進捗に含まれません。

-

上部でバーが見えません。

-

0%では満ちる幅が0で、トラックが既定で透明だからです。トラックに色を付けると(配色セクション参照)、空でもバーが見えます。

-

Ghost 以外でも使えますか?

-

使えます。スクリプトを追加できる場所なら、data-content で本文コンテナを指定するだけです。Notion では .notion-page-content です。

- -

おわりに

-

ghost-progress-plugin は MIT ライセンスのオープンソースで、コードと Issue は GitHub にあります。左パネルでオプションを変え、気に入ったら埋め込みコードをコピーしてください。お役に立てたら、コーヒーを一杯いただけると嬉しいです ☕。

-
- -
- -
- - - - - - diff --git a/ko/index.html b/ko/index.html deleted file mode 100644 index 844d867..0000000 --- a/ko/index.html +++ /dev/null @@ -1,253 +0,0 @@ - - - - - - - ghost-progress-plugin: Ghost용 읽기 진행 바 · 설정 & 데모 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
대표 이미지 (feature image)
- -
-

ghost-progress-plugin 미리보기

-

스크롤하면 상단 바가 0%에서 100%로 채워집니다. 왼쪽 패널에서 옵션을 바꾸면 임베드 코드도 함께 갱신됩니다.

- -

들어가며

-

ghost-progress-plugin은 Ghost용의 가볍고 의존성 없는 읽기 진행 바입니다. Ghost 전용으로 시작했지만, Notion 기반 블로그에서도 동작하며 스크립트를 넣을 수 있는 곳이면 어디서나 동작합니다. 읽는 동안 얇은 바가 채워져 글의 어디쯤인지 보여줍니다. 이 페이지가 바로 그 예시로, 상단의 바가 실제로 동작하는 위젯입니다.

- -

설치 방법

-

빌드 과정도, 테마 파일 수정도 없이 아래 스니펫 한 번이면 설치가 끝납니다:

-
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/GreedyLabs/ghost-progress-plugin@1/progress.css">
-<script src="https://cdn.jsdelivr.net/gh/GreedyLabs/ghost-progress-plugin@1/progress.min.js"
-        data-content=".gh-content"
-        data-position="top"></script>
-

코드 인젝션

-

Ghost에서는 Settings → Code injection → Site Footer 에 붙여넣습니다. Notion 기반 호스팅이라면 커스텀 코드 주입란에 넣습니다. oopy는 사이트 설정의 head/footer 코드란, super.so는 Custom Code 영역이며, 이때 data-content.notion-page-content로 지정하세요. 그 밖의 사이트라면 닫는 </body> 태그 바로 앞에 두면 됩니다.

-

옵션 설정

-

동작은 모두 스크립트 태그의 data-* 속성으로 설정합니다: 본문 선택자, 위치, 두께, z-index를 지정할 수 있습니다:

-
data-content=".gh-content"
-data-position="top"
-data-height="4"
-data-z-index="100"
- -

커스터마이즈

-

바의 색과 두께는 자유롭게 조절할 수 있습니다. 모든 클래스와 CSS 변수는 greedylabs-ghost-progress로 네임스페이스가 걸려 있어 테마와 절대 충돌하지 않습니다.

-

색상

-

채움 색은 기본적으로 Ghost 테마 강조색(--ghost-accent-color)을 따릅니다. 바꾸려면 data-color를 주거나 CSS 변수를 덮어쓰면 됩니다. 읽지 않은 부분의 트랙은 기본이 투명이니, 0%에서도 바가 보이게 하려면 트랙에 색을 주세요:

-
.greedylabs-ghost-progress {
-  --greedylabs-ghost-progress-track: rgba(0,0,0,.08);
-}
-@media (prefers-color-scheme: dark) {
-  .greedylabs-ghost-progress {
-    --greedylabs-ghost-progress-track: rgba(255,255,255,.14);
-  }
-}
-

위치

-

data-position으로 위/아래를, data-height로 두께(px)를 정합니다. 바는 글 상단이 뷰포트 위에 닿으면 0%, 글 하단이 뷰포트 바닥에 닿으면 100%가 됩니다.

- -

자주 묻는 질문

- -

전체 페이지 기준인가요, 본문 기준인가요?

-

data-content로 가리킨 본문 기준입니다. 헤더, 대표 이미지, 푸터는 진행률에 포함되지 않습니다.

-

맨 위에서 바가 안 보여요.

-

0%에서는 채움 폭이 0이고 트랙이 기본 투명이라 그렇습니다. 트랙에 색을 주면(색상 섹션 참고) 비어 있어도 바가 보입니다.

-

Ghost가 아니어도 되나요?

-

됩니다. 스크립트를 넣을 수 있는 곳이면 data-content로 본문 컨테이너만 가리키면 됩니다. Notion은 .notion-page-content입니다.

- -

마치며

-

ghost-progress-plugin은 MIT 라이선스 오픈소스이며, 소스와 이슈는 GitHub에 있습니다. 왼쪽 패널에서 옵션을 바꿔 확인한 뒤 마음에 들면 임베드 코드를 복사하세요. 도움이 되었다면 커피 한 잔 부탁드려요 ☕.

-
- -
- -
- - - - - - diff --git a/lib/site.js b/lib/site.js new file mode 100644 index 0000000..f27a53b --- /dev/null +++ b/lib/site.js @@ -0,0 +1,76 @@ +import React from 'react'; +import meta from '../i18n/meta.json'; + +export const ORIGIN = 'https://ghost-progress-plugin.greedylabs.kr'; +export const CDN = 'https://cdn.jsdelivr.net/gh/GreedyLabs/ghost-progress-plugin@1'; +export const REPO = 'https://github.com/GreedyLabs/ghost-progress-plugin'; +export const ORG = 'https://github.com/GreedyLabs'; +export const LOCALES = meta.order; +export const DEFAULT_LOCALE = meta.default; +export const NAMES = meta.names; +export const OG_LOCALES = meta.locales; + +export const FAVICON = "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Crect width='32' height='32' rx='7' fill='%231a73e8'/%3E%3Crect x='6' y='14' width='20' height='4' rx='2' fill='rgba(255,255,255,.35)'/%3E%3Crect x='6' y='14' width='12' height='4' rx='2' fill='white'/%3E%3C/svg%3E"; + +export const GISCUS_LANG = { ko: 'ko', en: 'en', ja: 'ja', zh: 'zh-CN', es: 'es', fr: 'fr', de: 'de', pt: 'pt', hi: 'en' }; + +export const codeInstall = () => +` +`; + +export const CODE_OPTIONS = +`data-content=".gh-content" +data-position="top" +data-height="4" +data-z-index="100"`; + +export const CODE_COLOR = +`.greedylabs-ghost-progress { + --greedylabs-ghost-progress-color: #1a73e8; + --greedylabs-ghost-progress-track: rgba(0,0,0,.08); +}`; + +// Wrap code tokens (data-* attrs, selectors, class names, CSS vars) in for monospace. +const CODE_RE = /(data-[a-z]+(?:-[a-z]+)*(?:="[^"]*")?)|(\.gh-[a-z-]+)|(\.notion-page-content)|(\.giscus)(?![\w-])|(gh-comments gh-canvas)|(--[a-z-]*ghost[a-z-]*)|(greedylabs-ghost-[a-z-]+)/g; + +export function richText(s) { + const out = []; let last = 0, m; CODE_RE.lastIndex = 0; + while ((m = CODE_RE.exec(s))) { + if (m.index > last) out.push(s.slice(last, m.index)); + out.push(React.createElement('code', { key: m.index }, m[0])); + last = m.index + m[0].length; + } + if (last < s.length) out.push(s.slice(last)); + return out; +} + +export function jsonLd(locale, t, url) { + return { + '@context': 'https://schema.org', + '@graph': [ + { + '@type': 'SoftwareApplication', + name: 'ghost-progress-plugin', + description: t('description'), + applicationCategory: 'DeveloperApplication', + operatingSystem: 'Web (Ghost, Notion)', + softwareVersion: '1', + url, + codeRepository: REPO, + license: 'https://opensource.org/licenses/MIT', + author: { '@type': 'Organization', name: 'GreedyLabs', url: ORG }, + offers: { '@type': 'Offer', price: '0', priceCurrency: 'USD' }, + sameAs: [REPO] + }, + { + '@type': 'WebSite', + name: 'ghost-progress-plugin', + url: `${ORIGIN}/`, + inLanguage: locale, + publisher: { '@type': 'Organization', name: 'GreedyLabs', url: ORG } + } + ] + }; +} diff --git a/messages/de.json b/messages/de.json new file mode 100644 index 0000000..fdee406 --- /dev/null +++ b/messages/de.json @@ -0,0 +1,51 @@ +{ + "name": "Deutsch", + "locale": "de_DE", + "title": "ghost-progress-plugin: Lesefortschrittsbalken für Ghost · Konfigurator & Demo", + "description": "Füge deinem Ghost-Blog mit einer Zeile Code einen Lesefortschrittsbalken hinzu. Optionen anpassen, live vorschauen, Snippet kopieren. Open Source (MIT).", + "lblContent": "Inhalts-Selektor", + "hintContent": "(für den Code · Vorschau nutzt den Demo-Inhalt)", + "lblPosition": "Position", + "embedLabel": "Einbettungscode", + "copy": "Kopieren", + "copyDone": "Kopiert", + "heroText": "Beitragsbild", + "demoTitle": "ghost-progress-plugin Vorschau", + "demoIntro": "Scrolle und sieh zu, wie sich der Balken oben von 0% auf 100% füllt. Ändere Optionen im linken Panel, der Einbettungscode aktualisiert sich mit.", + "h_intro": "Einführung", + "h_install": "Installation", + "h_codeinjection": "Code-Injection", + "h_options": "Optionen", + "h_customize": "Anpassung", + "h_color": "Farben", + "h_position": "Position", + "h_closing": "Fazit", + "commentsTitle": "Kommentare", + "langLabel": "Sprache", + "support": "Hilfreich? Spendier mir einen Kaffee ☕", + "themeLabel": "Theme", + "themeSystem": "System", + "themeLight": "Hell", + "themeDark": "Dunkel", + "bodyIntro": "ghost-progress-plugin ist ein winziger, abhängigkeitsfreier Lesefortschrittsbalken für Ghost. Es begann als Widget für Ghost, funktioniert aber auch in Notion-basierten Blogs und überall, wo du ein Skript einbinden kannst. Beim Lesen füllt sich ein dünner Balken und zeigt, wie weit du im Artikel bist. Diese Seite ist ein Live-Beispiel: Der Balken oben ist das echte Widget.", + "bodyInstall": "Einmal mit diesem Snippet einbinden, ohne Build-Schritt und ohne Theme-Dateien zu bearbeiten:", + "bodyCodeInjection": "Füge es in Ghost unter Settings → Code injection → Site Footer ein. Auf Notion-basiertem Hosting fügst du es im Feld für eigenen Code ein: oopy hat ein head/footer-Codefeld, super.so hat einen Custom-Code-Bereich, und dort setzt du data-content auf .notion-page-content. Auf jeder anderen Seite platzierst du es direkt vor dem schließenden ''-Tag.", + "bodyOptions": "Alles wird über data-*-Attribute am Script-Tag konfiguriert: der Inhalts-Selektor, die Position, die Dicke und der Z-Index:", + "bodyCustomize": "Farbe und Dicke des Balkens sind anpassbar. Jede Klasse und CSS-Variable ist unter greedylabs-ghost-progress benannt, sodass er nie mit deinem Theme kollidiert.", + "bodyColor": "Die Füllung folgt standardmäßig der Akzentfarbe deines Ghost-Themes (--ghost-accent-color); setze data-color oder überschreibe die CSS-Variablen, um sie zu ändern. Die ungelesene Spur ist standardmäßig transparent, gib ihr also eine Farbe, damit der Balken auch bei 0% sichtbar ist:", + "bodyPosition": "Nutze data-position für oben oder unten und data-height für die Dicke in Pixeln. Der Balken erreicht 0%, wenn der obere Rand des Artikels den oberen Rand des Viewports erreicht, und 100%, wenn sein unterer Rand den unteren erreicht.", + "bodyClosing": "ghost-progress-plugin ist Open Source unter der MIT-Lizenz; Code und Issues findest du auf GitHub. Probiere die Optionen im linken Panel aus und kopiere das Snippet, wenn es passt. Wenn es dir geholfen hat, freue ich mich über einen Kaffee ☕.", + "h_faq": "Häufige Fragen", + "faqQ1": "Misst es die ganze Seite oder nur den Artikel?", + "faqA1": "Nur den Artikel, auf den data-content zeigt. Header, Beitragsbild und Footer zählen nicht zum Fortschritt.", + "faqQ2": "Warum ist der Balken oben unsichtbar?", + "faqA2": "Bei 0% hat die Füllung keine Breite und die Spur ist standardmäßig transparent. Gib der Spur eine Farbe (siehe Farben), damit der Balken auch leer sichtbar ist.", + "faqQ3": "Funktioniert es außerhalb von Ghost?", + "faqA3": "Ja. Überall, wo du ein Skript einbinden kannst, zeige mit data-content auf deinen Artikel-Container. Bei Notion ist das .notion-page-content.", + "optTop": "Oben", + "optBottom": "Unten", + "lblHeight": "Dicke (px)", + "lblAutoColor": "Akzentfarbe des Ghost-Themes automatisch verwenden", + "lblColor": "Balkenfarbe", + "lblZindex": "Z-Index" +} diff --git a/messages/en.json b/messages/en.json new file mode 100644 index 0000000..2241b1b --- /dev/null +++ b/messages/en.json @@ -0,0 +1,51 @@ +{ + "name": "English", + "locale": "en_US", + "title": "ghost-progress-plugin: Reading progress bar for Ghost · configurator & demo", + "description": "Add a reading progress bar to your Ghost blog with one line of code. Tweak options, preview live, and copy the embed snippet. Open source (MIT).", + "lblContent": "Content selector", + "hintContent": "(for the snippet · preview uses the demo body)", + "lblPosition": "Position", + "embedLabel": "Embed code", + "copy": "Copy", + "copyDone": "Copied", + "heroText": "Feature image", + "demoTitle": "ghost-progress-plugin preview", + "demoIntro": "Scroll and watch the bar at the top fill from 0% to 100%. Change options in the left panel and the embed code updates with them.", + "h_intro": "Getting started", + "h_install": "Installation", + "h_codeinjection": "Code injection", + "h_options": "Options", + "h_customize": "Customize", + "h_color": "Colors", + "h_position": "Position", + "h_closing": "Wrapping up", + "commentsTitle": "Comments", + "langLabel": "Language", + "support": "Found it useful? Buy me a coffee ☕", + "themeLabel": "Theme", + "themeSystem": "System", + "themeLight": "Light", + "themeDark": "Dark", + "bodyIntro": "ghost-progress-plugin is a tiny, dependency-free reading progress bar for Ghost. It started as a Ghost widget, but it also works on Notion-based blogs, and anywhere you can add a script. As you read, a thin bar fills to show how far through the article you are. This page is a live example: the bar at the top is the real widget.", + "bodyInstall": "Add it once with this snippet, no build step, no theme files to edit:", + "bodyCodeInjection": "In Ghost, paste it into Settings → Code injection → Site Footer. On Notion-based hosting, add it in the custom-code field: oopy has a head/footer code box in its site settings, super.so has a Custom Code area, and there you set data-content to .notion-page-content. On any other site, put it just before the closing '' tag.", + "bodyOptions": "Everything is configured with data-* attributes on the script tag: the content selector, the position, the height, and the z-index:", + "bodyCustomize": "The bar color and thickness are adjustable. Every class and CSS variable is namespaced under greedylabs-ghost-progress, so it never clashes with your theme.", + "bodyColor": "The fill follows your Ghost theme accent (--ghost-accent-color) by default; set data-color or override the CSS variables to change it. The unread track is transparent by default, so give it a color to make the bar visible even at 0%:", + "bodyPosition": "Use data-position for top or bottom, and data-height for the thickness in pixels. The bar reaches 0% when the article top meets the top of the viewport, and 100% when its bottom meets the bottom.", + "bodyClosing": "ghost-progress-plugin is open source under the MIT license; the code and issues live on GitHub. Try the options in the left panel and copy the embed snippet when you are happy. If it helped you, a coffee is always appreciated ☕.", + "h_faq": "FAQ", + "faqQ1": "Does it track the whole page or just the article?", + "faqA1": "Just the article you point data-content at. The header, feature image, and footer do not count toward the progress.", + "faqQ2": "Why is the bar invisible at the top?", + "faqA2": "At 0% the fill has no width and the track is transparent by default. Give the track a color (see Colors) to show the bar even when empty.", + "faqQ3": "Does it work outside Ghost?", + "faqA3": "Yes. Anywhere you can inject a script, point data-content at your article container. For Notion that is .notion-page-content.", + "optTop": "Top", + "optBottom": "Bottom", + "lblHeight": "Height (px)", + "lblAutoColor": "Use the Ghost theme accent automatically", + "lblColor": "Bar color", + "lblZindex": "Z-index" +} diff --git a/messages/es.json b/messages/es.json new file mode 100644 index 0000000..b025bbf --- /dev/null +++ b/messages/es.json @@ -0,0 +1,51 @@ +{ + "name": "Español", + "locale": "es_ES", + "title": "ghost-progress-plugin: Barra de progreso de lectura para Ghost · configurador y demo", + "description": "Añade una barra de progreso de lectura a tu blog Ghost con una línea de código. Ajusta opciones, previsualiza en vivo y copia el fragmento. Código abierto (MIT).", + "lblContent": "Selector de contenido", + "hintContent": "(para el código · la vista previa usa el cuerpo demo)", + "lblPosition": "Posición", + "embedLabel": "Código de inserción", + "copy": "Copiar", + "copyDone": "Copiado", + "heroText": "Imagen destacada", + "demoTitle": "Vista previa de ghost-progress-plugin", + "demoIntro": "Desplázate y mira la barra superior llenarse de 0% a 100%. Cambia las opciones en el panel izquierdo y el código de inserción se actualiza.", + "h_intro": "Introducción", + "h_install": "Instalación", + "h_codeinjection": "Inyección de código", + "h_options": "Opciones", + "h_customize": "Personalización", + "h_color": "Colores", + "h_position": "Posición", + "h_closing": "Conclusión", + "commentsTitle": "Comentarios", + "langLabel": "Idioma", + "support": "¿Te ha servido? Invítame a un café ☕", + "themeLabel": "Tema", + "themeSystem": "Sistema", + "themeLight": "Claro", + "themeDark": "Oscuro", + "bodyIntro": "ghost-progress-plugin es una barra de progreso de lectura diminuta y sin dependencias para Ghost. Empezó como un widget para Ghost, pero también funciona en blogs basados en Notion y en cualquier sitio donde puedas añadir un script. Mientras lees, una barra fina se llena para mostrar por dónde vas del artículo. Esta página es un ejemplo en vivo: la barra de arriba es el widget real.", + "bodyInstall": "Añádelo una sola vez con este fragmento, sin paso de compilación ni archivos del tema que editar:", + "bodyCodeInjection": "En Ghost, pégalo en Settings → Code injection → Site Footer. En hosting basado en Notion, añádelo en el campo de código personalizado: oopy tiene una caja de código head/footer, super.so tiene un área Custom Code, y ahí pones data-content en .notion-page-content. En cualquier otro sitio, colócalo justo antes de la etiqueta ''.", + "bodyOptions": "Todo se configura con atributos data-* en la etiqueta del script: el selector de contenido, la posición, el grosor y el z-index:", + "bodyCustomize": "El color y el grosor de la barra son ajustables. Cada clase y variable CSS está en el espacio de nombres greedylabs-ghost-progress, así que nunca choca con tu tema.", + "bodyColor": "El relleno sigue por defecto el color de acento de tu tema Ghost (--ghost-accent-color); usa data-color o sobrescribe las variables CSS para cambiarlo. La pista no leída es transparente por defecto, así que dale un color para que la barra se vea incluso al 0%:", + "bodyPosition": "Usa data-position para arriba o abajo, y data-height para el grosor en píxeles. La barra llega a 0% cuando la parte superior del artículo toca la parte superior de la ventana, y a 100% cuando su parte inferior toca la inferior.", + "bodyClosing": "ghost-progress-plugin es de código abierto bajo licencia MIT; el código y las incidencias están en GitHub. Prueba las opciones en el panel izquierdo y copia el fragmento cuando te guste. Si te ha servido, siempre se agradece un café ☕.", + "h_faq": "Preguntas frecuentes", + "faqQ1": "¿Mide toda la página o solo el artículo?", + "faqA1": "Solo el artículo al que apuntas con data-content. El encabezado, la imagen destacada y el pie no cuentan.", + "faqQ2": "¿Por qué la barra no se ve arriba?", + "faqA2": "Al 0% el relleno no tiene ancho y la pista es transparente por defecto. Dale color a la pista (ver Colores) para que la barra se vea aun vacía.", + "faqQ3": "¿Funciona fuera de Ghost?", + "faqA3": "Sí. Donde puedas inyectar un script, apunta data-content a tu contenedor de artículo. En Notion es .notion-page-content.", + "optTop": "Arriba", + "optBottom": "Abajo", + "lblHeight": "Grosor (px)", + "lblAutoColor": "Usar el color de acento del tema Ghost automáticamente", + "lblColor": "Color de la barra", + "lblZindex": "Z-index" +} diff --git a/messages/fr.json b/messages/fr.json new file mode 100644 index 0000000..30d007c --- /dev/null +++ b/messages/fr.json @@ -0,0 +1,51 @@ +{ + "name": "Français", + "locale": "fr_FR", + "title": "ghost-progress-plugin: Barre de progression de lecture pour Ghost · configurateur & démo", + "description": "Ajoutez une barre de progression de lecture à votre blog Ghost en une ligne de code. Réglez les options, prévisualisez en direct et copiez le code. Open source (MIT).", + "lblContent": "Sélecteur de contenu", + "hintContent": "(pour le code · l'aperçu utilise le corps démo)", + "lblPosition": "Position", + "embedLabel": "Code d'intégration", + "copy": "Copier", + "copyDone": "Copié", + "heroText": "Image à la une", + "demoTitle": "Aperçu de ghost-progress-plugin", + "demoIntro": "Faites défiler et regardez la barre du haut se remplir de 0% à 100%. Modifiez les options dans le panneau de gauche, le code d'intégration se met à jour.", + "h_intro": "Pour commencer", + "h_install": "Installation", + "h_codeinjection": "Injection de code", + "h_options": "Options", + "h_customize": "Personnalisation", + "h_color": "Couleurs", + "h_position": "Position", + "h_closing": "Conclusion", + "commentsTitle": "Commentaires", + "langLabel": "Langue", + "support": "Utile ? Offrez-moi un café ☕", + "themeLabel": "Thème", + "themeSystem": "Système", + "themeLight": "Clair", + "themeDark": "Sombre", + "bodyIntro": "ghost-progress-plugin est une barre de progression de lecture minuscule et sans dépendance pour Ghost. Il a commencé comme un widget pour Ghost, mais il fonctionne aussi sur les blogs basés sur Notion, et partout où vous pouvez ajouter un script. Pendant la lecture, une fine barre se remplit pour indiquer où vous en êtes dans l'article. Cette page est un exemple en direct : la barre en haut est le vrai widget.", + "bodyInstall": "Ajoutez-le en une fois avec cet extrait, sans étape de build ni fichiers de thème à modifier :", + "bodyCodeInjection": "Dans Ghost, collez-le dans Settings → Code injection → Site Footer. Sur un hébergement basé sur Notion, ajoutez-le dans le champ de code personnalisé : oopy propose une zone de code head/footer, super.so a une zone Custom Code, et là vous réglez data-content sur .notion-page-content. Sur tout autre site, placez-le juste avant la balise ''.", + "bodyOptions": "Tout se configure avec des attributs data-* sur la balise script : le sélecteur de contenu, la position, l'épaisseur et le z-index :", + "bodyCustomize": "La couleur et l'épaisseur de la barre sont réglables. Chaque classe et variable CSS est dans l'espace de noms greedylabs-ghost-progress, donc elle n'entre jamais en conflit avec votre thème.", + "bodyColor": "Le remplissage suit par défaut la couleur d'accent de votre thème Ghost (--ghost-accent-color) ; utilisez data-color ou redéfinissez les variables CSS pour la changer. La piste non lue est transparente par défaut, donnez-lui donc une couleur pour que la barre soit visible même à 0% :", + "bodyPosition": "Utilisez data-position pour haut ou bas, et data-height pour l'épaisseur en pixels. La barre atteint 0% quand le haut de l'article rejoint le haut de la fenêtre, et 100% quand son bas rejoint le bas.", + "bodyClosing": "ghost-progress-plugin est open source sous licence MIT ; le code et les tickets sont sur GitHub. Essayez les options dans le panneau de gauche et copiez l'extrait quand cela vous convient. Si cela vous a aidé, un café est toujours apprécié ☕.", + "h_faq": "Questions fréquentes", + "faqQ1": "Mesure-t-il toute la page ou seulement l'article ?", + "faqA1": "Seulement l'article visé par data-content. L'en-tête, l'image à la une et le pied de page ne comptent pas.", + "faqQ2": "Pourquoi la barre est-elle invisible en haut ?", + "faqA2": "À 0% le remplissage n'a pas de largeur et la piste est transparente par défaut. Donnez une couleur à la piste (voir Couleurs) pour voir la barre même vide.", + "faqQ3": "Fonctionne-t-il hors de Ghost ?", + "faqA3": "Oui. Partout où vous pouvez injecter un script, pointez data-content vers votre conteneur d'article. Pour Notion, c'est .notion-page-content.", + "optTop": "Haut", + "optBottom": "Bas", + "lblHeight": "Épaisseur (px)", + "lblAutoColor": "Utiliser automatiquement la couleur d'accent du thème Ghost", + "lblColor": "Couleur de la barre", + "lblZindex": "Z-index" +} diff --git a/messages/hi.json b/messages/hi.json new file mode 100644 index 0000000..9d9b584 --- /dev/null +++ b/messages/hi.json @@ -0,0 +1,51 @@ +{ + "name": "हिन्दी", + "locale": "hi_IN", + "title": "ghost-progress-plugin: Ghost के लिए रीडिंग प्रोग्रेस बार · कॉन्फ़िगरेटर और डेमो", + "description": "एक लाइन कोड से अपने Ghost ब्लॉग में रीडिंग प्रोग्रेस बार जोड़ें। विकल्प बदलें, लाइव प्रीव्यू देखें और एम्बेड स्निपेट कॉपी करें। ओपन सोर्स (MIT)।", + "lblContent": "कंटेंट सिलेक्टर", + "hintContent": "(कोड के लिए · प्रीव्यू डेमो बॉडी दिखाता है)", + "lblPosition": "स्थिति", + "embedLabel": "एम्बेड कोड", + "copy": "कॉपी", + "copyDone": "कॉपी हो गया", + "heroText": "फ़ीचर छवि", + "demoTitle": "ghost-progress-plugin प्रीव्यू", + "demoIntro": "स्क्रॉल करें और ऊपर की बार को 0% से 100% तक भरते देखें। बाएँ पैनल में विकल्प बदलें, एम्बेड कोड भी साथ में अपडेट होता है।", + "h_intro": "परिचय", + "h_install": "इंस्टॉलेशन", + "h_codeinjection": "कोड इंजेक्शन", + "h_options": "विकल्प", + "h_customize": "कस्टमाइज़", + "h_color": "रंग", + "h_position": "स्थिति", + "h_closing": "निष्कर्ष", + "commentsTitle": "टिप्पणियाँ", + "langLabel": "भाषा", + "support": "पसंद आया? एक कॉफ़ी पिलाएँ ☕", + "themeLabel": "थीम", + "themeSystem": "सिस्टम", + "themeLight": "लाइट", + "themeDark": "डार्क", + "bodyIntro": "ghost-progress-plugin एक छोटा, बिना निर्भरता वाला Ghost रीडिंग प्रोग्रेस बार है। यह Ghost के लिए शुरू हुआ था, लेकिन यह Notion-आधारित ब्लॉग पर भी काम करता है, और जहाँ भी आप स्क्रिप्ट जोड़ सकते हैं वहाँ चलता है। पढ़ते समय एक पतली बार भरती है और बताती है कि आप लेख में कहाँ तक पहुँचे। यह पेज एक लाइव उदाहरण है: ऊपर की बार असली विजेट ही है।", + "bodyInstall": "बिना किसी बिल्ड चरण या थीम फ़ाइल संपादन के, नीचे दिया स्निपेट एक बार चिपकाएँ:", + "bodyCodeInjection": "Ghost में इसे Settings → Code injection → Site Footer में पेस्ट करें। Notion-आधारित होस्टिंग पर इसे कस्टम कोड फ़ील्ड में जोड़ें: oopy में head/footer कोड बॉक्स होता है, super.so में Custom Code क्षेत्र होता है, और वहाँ data-content को .notion-page-content पर सेट करें। किसी और साइट पर इसे बंद होते '' टैग से ठीक पहले रखें।", + "bodyOptions": "सारा व्यवहार स्क्रिप्ट टैग पर data-* एट्रिब्यूट से सेट होता है: कंटेंट सिलेक्टर, स्थिति, मोटाई और z-index:", + "bodyCustomize": "बार का रंग और मोटाई समायोज्य हैं। हर क्लास और CSS वेरिएबल greedylabs-ghost-progress नेमस्पेस में है, इसलिए यह आपकी थीम से कभी नहीं टकराता।", + "bodyColor": "भराव डिफ़ॉल्ट रूप से आपकी Ghost थीम के एक्सेंट रंग (--ghost-accent-color) का अनुसरण करता है; बदलने के लिए data-color दें या CSS वेरिएबल ओवरराइड करें। बिना पढ़ा ट्रैक डिफ़ॉल्ट रूप से पारदर्शी है, इसलिए 0% पर भी बार दिखाने के लिए ट्रैक को रंग दें:", + "bodyPosition": "ऊपर/नीचे के लिए data-position, और पिक्सेल में मोटाई के लिए data-height इस्तेमाल करें। जब लेख का शीर्ष व्यूपोर्ट के शीर्ष से मिलता है तो बार 0%, और जब उसका तल व्यूपोर्ट के तल से मिलता है तो 100% हो जाती है।", + "bodyClosing": "ghost-progress-plugin MIT लाइसेंस के तहत ओपन सोर्स है; कोड और issues GitHub पर हैं। बाएँ पैनल में विकल्प आज़माएँ और पसंद आने पर एम्बेड कोड कॉपी करें। अगर यह आपके काम आया, तो एक कॉफ़ी का स्वागत है ☕।", + "h_faq": "अक्सर पूछे जाने वाले प्रश्न", + "faqQ1": "यह पूरे पेज को मापता है या सिर्फ़ लेख को?", + "faqA1": "सिर्फ़ उस लेख को जिसे आप data-content से इंगित करते हैं। हेडर, फ़ीचर इमेज और फ़ुटर प्रगति में नहीं गिने जाते।", + "faqQ2": "ऊपर बार क्यों नहीं दिखती?", + "faqA2": "0% पर भराव की चौड़ाई शून्य होती है और ट्रैक डिफ़ॉल्ट रूप से पारदर्शी है। ट्रैक को रंग दें (रंग अनुभाग देखें) ताकि खाली होने पर भी बार दिखे।", + "faqQ3": "क्या यह Ghost के बाहर काम करता है?", + "faqA3": "हाँ। जहाँ भी आप स्क्रिप्ट इंजेक्ट कर सकें, data-content को अपने लेख कंटेनर पर इंगित करें। Notion में यह .notion-page-content है।", + "optTop": "ऊपर", + "optBottom": "नीचे", + "lblHeight": "मोटाई (px)", + "lblAutoColor": "Ghost थीम का एक्सेंट रंग स्वतः उपयोग करें", + "lblColor": "बार का रंग", + "lblZindex": "Z-index" +} diff --git a/messages/ja.json b/messages/ja.json new file mode 100644 index 0000000..ce5e5bb --- /dev/null +++ b/messages/ja.json @@ -0,0 +1,51 @@ +{ + "name": "日本語", + "locale": "ja_JP", + "title": "ghost-progress-plugin: Ghost 用の読書プログレスバー · 設定 & デモ", + "description": "コード1行で Ghost ブログに読書プログレスバーを追加。オプションを変えてライブプレビューし、埋め込みコードをコピー。オープンソース(MIT)。", + "lblContent": "本文セレクタ", + "hintContent": "(コード用 · プレビューはデモ本文)", + "lblPosition": "位置", + "embedLabel": "埋め込みコード", + "copy": "コピー", + "copyDone": "コピーしました", + "heroText": "アイキャッチ画像", + "demoTitle": "ghost-progress-plugin プレビュー", + "demoIntro": "スクロールすると上部のバーが0%から100%へ満ちます。左パネルでオプションを変えると、埋め込みコードも一緒に更新されます。", + "h_intro": "はじめに", + "h_install": "インストール", + "h_codeinjection": "コードインジェクション", + "h_options": "オプション設定", + "h_customize": "カスタマイズ", + "h_color": "配色", + "h_position": "位置", + "h_closing": "おわりに", + "commentsTitle": "コメント", + "langLabel": "言語", + "support": "役に立ったらコーヒーを一杯 ☕", + "themeLabel": "テーマ", + "themeSystem": "システム", + "themeLight": "ライト", + "themeDark": "ダーク", + "bodyIntro": "ghost-progress-plugin は Ghost 用の軽量で依存関係のない読書プログレスバーです。Ghost 向けとして始まりましたが、Notion ベースのブログでも動作し、スクリプトを追加できる場所ならどこでも動きます。読むにつれて細いバーが満ち、記事のどこまで読んだかを示します。このページがそのまま実例で、上部のバーが実際に動くウィジェットです。", + "bodyInstall": "ビルド工程もテーマ編集も不要。下のスニペットを一度貼り付けるだけです:", + "bodyCodeInjection": "Ghost では Settings → Code injection → Site Footer に貼り付けます。Notion ベースのホスティングなら、カスタムコード欄に追加します。oopy はサイト設定の head/footer コード欄、super.so は Custom Code 領域があり、そこで data-content を .notion-page-content にします。その他のサイトでは閉じタグ '' の直前に置きます。", + "bodyOptions": "動作はすべてスクリプトタグの data-* 属性で設定します:本文セレクタ、位置、太さ、z-index を指定できます:", + "bodyCustomize": "バーの色と太さは自由に調整できます。すべてのクラスと CSS 変数は greedylabs-ghost-progress で名前空間化されており、テーマと衝突しません。", + "bodyColor": "満ちる色は、既定で Ghost テーマのアクセント色(--ghost-accent-color)に従います。変更するには data-color を指定するか、CSS 変数を上書きします。未読部分のトラックは既定で透明なので、0%でもバーを見せたい場合はトラックに色を付けます:", + "bodyPosition": "data-position で上下、data-height で太さ(px)を指定します。バーは記事の上端がビューポート上端に来ると0%、下端がビューポート下端に来ると100%になります。", + "bodyClosing": "ghost-progress-plugin は MIT ライセンスのオープンソースで、コードと Issue は GitHub にあります。左パネルでオプションを変え、気に入ったら埋め込みコードをコピーしてください。お役に立てたら、コーヒーを一杯いただけると嬉しいです ☕。", + "h_faq": "よくある質問", + "faqQ1": "ページ全体ですか、それとも記事だけですか?", + "faqA1": "data-content で指定した記事だけです。ヘッダー、フィーチャー画像、フッターは進捗に含まれません。", + "faqQ2": "上部でバーが見えません。", + "faqA2": "0%では満ちる幅が0で、トラックが既定で透明だからです。トラックに色を付けると(配色セクション参照)、空でもバーが見えます。", + "faqQ3": "Ghost 以外でも使えますか?", + "faqA3": "使えます。スクリプトを追加できる場所なら、data-content で本文コンテナを指定するだけです。Notion では .notion-page-content です。", + "optTop": "上", + "optBottom": "下", + "lblHeight": "太さ(px)", + "lblAutoColor": "Ghost テーマのアクセント色を自動使用", + "lblColor": "バーの色", + "lblZindex": "z-index" +} diff --git a/messages/ko.json b/messages/ko.json new file mode 100644 index 0000000..368868d --- /dev/null +++ b/messages/ko.json @@ -0,0 +1,51 @@ +{ + "name": "한국어", + "locale": "ko_KR", + "title": "ghost-progress-plugin: Ghost용 읽기 진행 바 · 설정 & 데모", + "description": "Ghost 블로그에 코드 한 줄로 붙이는 읽기 진행 바. 옵션을 바꿔 실시간 미리보고 임베드 코드를 복사하세요. 오픈소스(MIT).", + "lblContent": "본문 선택자", + "hintContent": "(코드용 · 미리보기는 데모 본문)", + "lblPosition": "위치", + "embedLabel": "임베드 코드", + "copy": "복사", + "copyDone": "복사됨", + "heroText": "대표 이미지 (feature image)", + "demoTitle": "ghost-progress-plugin 미리보기", + "demoIntro": "스크롤하면 상단 바가 0%에서 100%로 채워집니다. 왼쪽 패널에서 옵션을 바꾸면 임베드 코드도 함께 갱신됩니다.", + "h_intro": "들어가며", + "h_install": "설치 방법", + "h_codeinjection": "코드 인젝션", + "h_options": "옵션 설정", + "h_customize": "커스터마이즈", + "h_color": "색상", + "h_position": "위치", + "h_closing": "마치며", + "commentsTitle": "댓글", + "langLabel": "언어", + "support": "도움이 되었다면 커피 한 잔 어때요? ☕", + "themeLabel": "테마", + "themeSystem": "시스템", + "themeLight": "라이트", + "themeDark": "다크", + "bodyIntro": "ghost-progress-plugin은 Ghost용의 가볍고 의존성 없는 읽기 진행 바입니다. Ghost 전용으로 시작했지만, Notion 기반 블로그에서도 동작하며 스크립트를 넣을 수 있는 곳이면 어디서나 동작합니다. 읽는 동안 얇은 바가 채워져 글의 어디쯤인지 보여줍니다. 이 페이지가 바로 그 예시로, 상단의 바가 실제로 동작하는 위젯입니다.", + "bodyInstall": "빌드 과정도, 테마 파일 수정도 없이 아래 스니펫 한 번이면 설치가 끝납니다:", + "bodyCodeInjection": "Ghost에서는 Settings → Code injection → Site Footer 에 붙여넣습니다. Notion 기반 호스팅이라면 커스텀 코드 주입란에 넣습니다. oopy는 사이트 설정의 head/footer 코드란, super.so는 Custom Code 영역이며, 이때 data-content를 .notion-page-content로 지정하세요. 그 밖의 사이트라면 닫는 '' 태그 바로 앞에 두면 됩니다.", + "bodyOptions": "동작은 모두 스크립트 태그의 data-* 속성으로 설정합니다: 본문 선택자, 위치, 두께, z-index를 지정할 수 있습니다:", + "bodyCustomize": "바의 색과 두께는 자유롭게 조절할 수 있습니다. 모든 클래스와 CSS 변수는 greedylabs-ghost-progress로 네임스페이스가 걸려 있어 테마와 절대 충돌하지 않습니다.", + "bodyColor": "채움 색은 기본적으로 Ghost 테마 강조색(--ghost-accent-color)을 따릅니다. 바꾸려면 data-color를 주거나 CSS 변수를 덮어쓰면 됩니다. 읽지 않은 부분의 트랙은 기본이 투명이니, 0%에서도 바가 보이게 하려면 트랙에 색을 주세요:", + "bodyPosition": "data-position으로 위/아래를, data-height로 두께(px)를 정합니다. 바는 글 상단이 뷰포트 위에 닿으면 0%, 글 하단이 뷰포트 바닥에 닿으면 100%가 됩니다.", + "bodyClosing": "ghost-progress-plugin은 MIT 라이선스 오픈소스이며, 소스와 이슈는 GitHub에 있습니다. 왼쪽 패널에서 옵션을 바꿔 확인한 뒤 마음에 들면 임베드 코드를 복사하세요. 도움이 되었다면 커피 한 잔 부탁드려요 ☕.", + "h_faq": "자주 묻는 질문", + "faqQ1": "전체 페이지 기준인가요, 본문 기준인가요?", + "faqA1": "data-content로 가리킨 본문 기준입니다. 헤더, 대표 이미지, 푸터는 진행률에 포함되지 않습니다.", + "faqQ2": "맨 위에서 바가 안 보여요.", + "faqA2": "0%에서는 채움 폭이 0이고 트랙이 기본 투명이라 그렇습니다. 트랙에 색을 주면(색상 섹션 참고) 비어 있어도 바가 보입니다.", + "faqQ3": "Ghost가 아니어도 되나요?", + "faqA3": "됩니다. 스크립트를 넣을 수 있는 곳이면 data-content로 본문 컨테이너만 가리키면 됩니다. Notion은 .notion-page-content입니다.", + "optTop": "위", + "optBottom": "아래", + "lblHeight": "두께(px)", + "lblAutoColor": "Ghost 테마 강조색 자동 사용", + "lblColor": "바 색상", + "lblZindex": "z-index" +} diff --git a/messages/pt.json b/messages/pt.json new file mode 100644 index 0000000..f236aed --- /dev/null +++ b/messages/pt.json @@ -0,0 +1,51 @@ +{ + "name": "Português", + "locale": "pt_BR", + "title": "ghost-progress-plugin: Barra de progresso de leitura para Ghost · configurador e demo", + "description": "Adicione uma barra de progresso de leitura ao seu blog Ghost com uma linha de código. Ajuste opções, veja a prévia ao vivo e copie o snippet. Código aberto (MIT).", + "lblContent": "Seletor de conteúdo", + "hintContent": "(para o código · a prévia usa o corpo demo)", + "lblPosition": "Posição", + "embedLabel": "Código de incorporação", + "copy": "Copiar", + "copyDone": "Copiado", + "heroText": "Imagem destacada", + "demoTitle": "Prévia do ghost-progress-plugin", + "demoIntro": "Role e veja a barra do topo encher de 0% a 100%. Altere as opções no painel à esquerda e o código de incorporação é atualizado.", + "h_intro": "Introdução", + "h_install": "Instalação", + "h_codeinjection": "Injeção de código", + "h_options": "Opções", + "h_customize": "Personalização", + "h_color": "Cores", + "h_position": "Posição", + "h_closing": "Conclusão", + "commentsTitle": "Comentários", + "langLabel": "Idioma", + "support": "Foi útil? Me paga um café ☕", + "themeLabel": "Tema", + "themeSystem": "Sistema", + "themeLight": "Claro", + "themeDark": "Escuro", + "bodyIntro": "ghost-progress-plugin é uma barra de progresso de leitura minúscula e sem dependências para o Ghost. Começou como um widget para o Ghost, mas também funciona em blogs baseados em Notion e em qualquer lugar onde você possa adicionar um script. Enquanto você lê, uma barra fina se enche para mostrar até onde você está no artigo. Esta página é um exemplo ao vivo: a barra no topo é o widget real.", + "bodyInstall": "Adicione de uma vez com este trecho, sem etapa de build nem arquivos do tema para editar:", + "bodyCodeInjection": "No Ghost, cole em Settings → Code injection → Site Footer. Em hospedagem baseada em Notion, adicione no campo de código personalizado: o oopy tem uma caixa de código head/footer, o super.so tem uma área Custom Code, e ali você define data-content como .notion-page-content. Em qualquer outro site, coloque logo antes da tag ''.", + "bodyOptions": "Tudo é configurado com atributos data-* na tag do script: o seletor de conteúdo, a posição, a espessura e o z-index:", + "bodyCustomize": "A cor e a espessura da barra são ajustáveis. Cada classe e variável CSS fica no namespace greedylabs-ghost-progress, então nunca conflita com o seu tema.", + "bodyColor": "O preenchimento segue, por padrão, a cor de destaque do seu tema Ghost (--ghost-accent-color); use data-color ou sobrescreva as variáveis CSS para mudá-la. A trilha não lida é transparente por padrão, então dê a ela uma cor para a barra aparecer mesmo em 0%:", + "bodyPosition": "Use data-position para topo ou base, e data-height para a espessura em pixels. A barra chega a 0% quando o topo do artigo encontra o topo da viewport, e a 100% quando a base encontra a base.", + "bodyClosing": "ghost-progress-plugin é de código aberto sob a licença MIT; o código e as issues estão no GitHub. Experimente as opções no painel à esquerda e copie o trecho quando gostar. Se ajudou você, um café é sempre bem-vindo ☕.", + "h_faq": "Perguntas frequentes", + "faqQ1": "Ele mede a página toda ou só o artigo?", + "faqA1": "Só o artigo apontado por data-content. Cabeçalho, imagem de destaque e rodapé não contam no progresso.", + "faqQ2": "Por que a barra fica invisível no topo?", + "faqA2": "Em 0% o preenchimento não tem largura e a trilha é transparente por padrão. Dê uma cor à trilha (ver Cores) para a barra aparecer mesmo vazia.", + "faqQ3": "Funciona fora do Ghost?", + "faqA3": "Sim. Onde você puder injetar um script, aponte data-content para o seu contêiner de artigo. No Notion é .notion-page-content.", + "optTop": "Topo", + "optBottom": "Base", + "lblHeight": "Espessura (px)", + "lblAutoColor": "Usar a cor de destaque do tema Ghost automaticamente", + "lblColor": "Cor da barra", + "lblZindex": "Z-index" +} diff --git a/messages/zh.json b/messages/zh.json new file mode 100644 index 0000000..f074aed --- /dev/null +++ b/messages/zh.json @@ -0,0 +1,51 @@ +{ + "name": "中文", + "locale": "zh_CN", + "title": "ghost-progress-plugin: Ghost 阅读进度条 · 配置与演示", + "description": "用一行代码为你的 Ghost 博客添加阅读进度条。修改选项、实时预览并复制嵌入代码。开源(MIT)。", + "lblContent": "正文选择器", + "hintContent": "(用于代码 · 预览使用演示正文)", + "lblPosition": "位置", + "embedLabel": "嵌入代码", + "copy": "复制", + "copyDone": "已复制", + "heroText": "特色图片", + "demoTitle": "ghost-progress-plugin 预览", + "demoIntro": "滚动时顶部的进度条会从 0% 填充到 100%。在左侧面板修改选项,嵌入代码也随之更新。", + "h_intro": "开始之前", + "h_install": "安装方法", + "h_codeinjection": "代码注入", + "h_options": "选项设置", + "h_customize": "自定义", + "h_color": "颜色", + "h_position": "位置", + "h_closing": "结语", + "commentsTitle": "评论", + "langLabel": "语言", + "support": "有帮助的话,请我喝杯咖啡 ☕", + "themeLabel": "主题", + "themeSystem": "系统", + "themeLight": "浅色", + "themeDark": "深色", + "bodyIntro": "ghost-progress-plugin 是一个轻量、无依赖的 Ghost 阅读进度条。它最初是为 Ghost 而做,但同样适用于基于 Notion 的博客,以及任何能添加脚本的地方。阅读时一条细条会填充,显示你读到文章的哪个位置。本页就是实时示例,顶部的进度条正是真实运行的组件。", + "bodyInstall": "无需构建、无需修改主题文件,粘贴下面这段代码即可完成安装:", + "bodyCodeInjection": "在 Ghost 中,粘贴到 Settings → Code injection → Site Footer。基于 Notion 的托管,则放进自定义代码处:oopy 在站点设置里有 head/footer 代码框,super.so 有 Custom Code 区域,在那里把 data-content 设为 .notion-page-content。其他网站则放在结束标签 '' 之前。", + "bodyOptions": "所有行为都通过脚本标签上的 data-* 属性配置:可设置正文选择器、位置、粗细和 z-index:", + "bodyCustomize": "进度条的颜色和粗细都可自由调整。所有类名和 CSS 变量都以 greedylabs-ghost-progress 命名空间隔离,绝不会与你的主题冲突。", + "bodyColor": "填充色默认跟随 Ghost 主题强调色(--ghost-accent-color)。要更改,可设置 data-color 或覆盖 CSS 变量。未读部分的轨道默认透明,若想在 0% 时也能看到进度条,请给轨道设置颜色:", + "bodyPosition": "用 data-position 设置顶部或底部,data-height 设置粗细(px)。当文章顶部到达视口顶部时为 0%,底部到达视口底部时为 100%。", + "bodyClosing": "ghost-progress-plugin 是 MIT 许可的开源项目,代码与问题反馈都在 GitHub 上。在左侧面板调整选项,满意后复制嵌入代码即可。如果它帮到了你,欢迎请我喝杯咖啡 ☕。", + "h_faq": "常见问题", + "faqQ1": "它以整页为准还是以文章为准?", + "faqA1": "以你用 data-content 指定的文章为准。页眉、封面图和页脚不计入进度。", + "faqQ2": "为什么顶部看不到进度条?", + "faqA2": "在 0% 时填充宽度为 0,且轨道默认透明。给轨道设置颜色(见配色一节),空的时候也能看到进度条。", + "faqQ3": "在 Ghost 之外能用吗?", + "faqA3": "能。只要能注入脚本,用 data-content 指向你的正文容器即可。Notion 是 .notion-page-content。", + "optTop": "顶部", + "optBottom": "底部", + "lblHeight": "粗细(px)", + "lblAutoColor": "自动使用 Ghost 主题强调色", + "lblColor": "进度条颜色", + "lblZindex": "z-index" +} diff --git a/next.config.mjs b/next.config.mjs new file mode 100644 index 0000000..5a990e9 --- /dev/null +++ b/next.config.mjs @@ -0,0 +1,13 @@ +import createNextIntlPlugin from 'next-intl/plugin'; + +const withNextIntl = createNextIntlPlugin('./i18n/request.js'); + +/** @type {import('next').NextConfig} */ +const nextConfig = { + output: 'export', + trailingSlash: true, + images: { unoptimized: true }, + reactStrictMode: false +}; + +export default withNextIntl(nextConfig); diff --git a/og-image.png b/og-image.png deleted file mode 100644 index d8feab5..0000000 Binary files a/og-image.png and /dev/null differ diff --git a/package.json b/package.json new file mode 100644 index 0000000..62c5434 --- /dev/null +++ b/package.json @@ -0,0 +1,24 @@ +{ + "name": "ghost-progress-plugin-demo", + "private": true, + "version": "0.0.0", + "type": "module", + "packageManager": "pnpm@11.8.0", + "scripts": { + "copy-widget": "node scripts/copy-widget.mjs", + "dev": "pnpm copy-widget && next dev", + "build": "pnpm copy-widget && next build", + "preview": "pnpm build && python3 -m http.server -d out 8080", + "start": "next start" + }, + "dependencies": { + "@giscus/react": "^3.1.0", + "next": "^15.1.0", + "next-intl": "^3.26.0", + "next-themes": "^0.4.6", + "react": "^19.0.0", + "react-dom": "^19.0.0", + "react-schemaorg": "^2.0.1", + "schema-dts": "^2.0.0" + } +} diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml new file mode 100644 index 0000000..7de4312 --- /dev/null +++ b/pnpm-lock.yaml @@ -0,0 +1,767 @@ +lockfileVersion: '9.0' + +settings: + autoInstallPeers: true + excludeLinksFromLockfile: false + +importers: + + .: + dependencies: + '@giscus/react': + specifier: ^3.1.0 + version: 3.1.0(react-dom@19.2.7(react@19.2.7))(react@19.2.7) + next: + specifier: ^15.1.0 + version: 15.5.20(react-dom@19.2.7(react@19.2.7))(react@19.2.7) + next-intl: + specifier: ^3.26.0 + version: 3.26.5(next@15.5.20(react-dom@19.2.7(react@19.2.7))(react@19.2.7))(react@19.2.7) + next-themes: + specifier: ^0.4.6 + version: 0.4.6(react-dom@19.2.7(react@19.2.7))(react@19.2.7) + react: + specifier: ^19.0.0 + version: 19.2.7 + react-dom: + specifier: ^19.0.0 + version: 19.2.7(react@19.2.7) + react-schemaorg: + specifier: ^2.0.1 + version: 2.0.1(react@19.2.7)(schema-dts@2.0.0(typescript@6.0.3))(typescript@6.0.3) + schema-dts: + specifier: ^2.0.0 + version: 2.0.0(typescript@6.0.3) + +packages: + + '@emnapi/runtime@1.11.2': + resolution: {integrity: sha512-kyOl3X0DuTiT1h2ft8r2fYO8JYtU9a9Xis/zBSiGArNaagCOWx90N1k2wxp18czFDH+OgcWGb5ZP/XMt3dcyPA==} + + '@formatjs/ecma402-abstract@2.3.6': + resolution: {integrity: sha512-HJnTFeRM2kVFVr5gr5kH1XP6K0JcJtE7Lzvtr3FS/so5f1kpsqqqxy5JF+FRaO6H2qmcMfAUIox7AJteieRtVw==} + + '@formatjs/fast-memoize@2.2.7': + resolution: {integrity: sha512-Yabmi9nSvyOMrlSeGGWDiH7rf3a7sIwplbvo/dlz9WCIjzIQAfy1RMf4S0X3yG724n5Ghu2GmEl5NJIV6O9sZQ==} + + '@formatjs/icu-messageformat-parser@2.11.4': + resolution: {integrity: sha512-7kR78cRrPNB4fjGFZg3Rmj5aah8rQj9KPzuLsmcSn4ipLXQvC04keycTI1F7kJYDwIXtT2+7IDEto842CfZBtw==} + + '@formatjs/icu-skeleton-parser@1.8.16': + resolution: {integrity: sha512-H13E9Xl+PxBd8D5/6TVUluSpxGNvFSlN/b3coUp0e0JpuWXXnQDiavIpY3NnvSp4xhEMoXyyBvVfdFX8jglOHQ==} + + '@formatjs/intl-localematcher@0.5.10': + resolution: {integrity: sha512-af3qATX+m4Rnd9+wHcjJ4w2ijq+rAVP3CCinJQvFv1kgSu1W6jypUmvleJxcewdxmutM8dmIRZFxO/IQBZmP2Q==} + + '@formatjs/intl-localematcher@0.6.2': + resolution: {integrity: sha512-XOMO2Hupl0wdd172Y06h6kLpBz6Dv+J4okPLl4LPtzbr8f66WbIoy4ev98EBuZ6ZK4h5ydTN6XneT4QVpD7cdA==} + + '@giscus/react@3.1.0': + resolution: {integrity: sha512-0TCO2TvL43+oOdyVVGHDItwxD1UMKP2ZYpT6gXmhFOqfAJtZxTzJ9hkn34iAF/b6YzyJ4Um89QIt9z/ajmAEeg==} + peerDependencies: + react: ^16 || ^17 || ^18 || ^19 + react-dom: ^16 || ^17 || ^18 || ^19 + + '@img/colour@1.1.0': + resolution: {integrity: sha512-Td76q7j57o/tLVdgS746cYARfSyxk8iEfRxewL9h4OMzYhbW4TAcppl0mT4eyqXddh6L/jwoM75mo7ixa/pCeQ==} + engines: {node: '>=18'} + + '@img/sharp-darwin-arm64@0.34.5': + resolution: {integrity: sha512-imtQ3WMJXbMY4fxb/Ndp6HBTNVtWCUI0WdobyheGf5+ad6xX8VIDO8u2xE4qc/fr08CKG/7dDseFtn6M6g/r3w==} + engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} + cpu: [arm64] + os: [darwin] + + '@img/sharp-darwin-x64@0.34.5': + resolution: {integrity: sha512-YNEFAF/4KQ/PeW0N+r+aVVsoIY0/qxxikF2SWdp+NRkmMB7y9LBZAVqQ4yhGCm/H3H270OSykqmQMKLBhBJDEw==} + engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} + cpu: [x64] + os: [darwin] + + '@img/sharp-libvips-darwin-arm64@1.2.4': + resolution: {integrity: sha512-zqjjo7RatFfFoP0MkQ51jfuFZBnVE2pRiaydKJ1G/rHZvnsrHAOcQALIi9sA5co5xenQdTugCvtb1cuf78Vf4g==} + cpu: [arm64] + os: [darwin] + + '@img/sharp-libvips-darwin-x64@1.2.4': + resolution: {integrity: sha512-1IOd5xfVhlGwX+zXv2N93k0yMONvUlANylbJw1eTah8K/Jtpi15KC+WSiaX/nBmbm2HxRM1gZ0nSdjSsrZbGKg==} + cpu: [x64] + os: [darwin] + + '@img/sharp-libvips-linux-arm64@1.2.4': + resolution: {integrity: sha512-excjX8DfsIcJ10x1Kzr4RcWe1edC9PquDRRPx3YVCvQv+U5p7Yin2s32ftzikXojb1PIFc/9Mt28/y+iRklkrw==} + cpu: [arm64] + os: [linux] + libc: [glibc] + + '@img/sharp-libvips-linux-arm@1.2.4': + resolution: {integrity: sha512-bFI7xcKFELdiNCVov8e44Ia4u2byA+l3XtsAj+Q8tfCwO6BQ8iDojYdvoPMqsKDkuoOo+X6HZA0s0q11ANMQ8A==} + cpu: [arm] + os: [linux] + libc: [glibc] + + '@img/sharp-libvips-linux-ppc64@1.2.4': + resolution: {integrity: sha512-FMuvGijLDYG6lW+b/UvyilUWu5Ayu+3r2d1S8notiGCIyYU/76eig1UfMmkZ7vwgOrzKzlQbFSuQfgm7GYUPpA==} + cpu: [ppc64] + os: [linux] + libc: [glibc] + + '@img/sharp-libvips-linux-riscv64@1.2.4': + resolution: {integrity: sha512-oVDbcR4zUC0ce82teubSm+x6ETixtKZBh/qbREIOcI3cULzDyb18Sr/Wcyx7NRQeQzOiHTNbZFF1UwPS2scyGA==} + cpu: [riscv64] + os: [linux] + libc: [glibc] + + '@img/sharp-libvips-linux-s390x@1.2.4': + resolution: {integrity: sha512-qmp9VrzgPgMoGZyPvrQHqk02uyjA0/QrTO26Tqk6l4ZV0MPWIW6LTkqOIov+J1yEu7MbFQaDpwdwJKhbJvuRxQ==} + cpu: [s390x] + os: [linux] + libc: [glibc] + + '@img/sharp-libvips-linux-x64@1.2.4': + resolution: {integrity: sha512-tJxiiLsmHc9Ax1bz3oaOYBURTXGIRDODBqhveVHonrHJ9/+k89qbLl0bcJns+e4t4rvaNBxaEZsFtSfAdquPrw==} + cpu: [x64] + os: [linux] + libc: [glibc] + + '@img/sharp-libvips-linuxmusl-arm64@1.2.4': + resolution: {integrity: sha512-FVQHuwx1IIuNow9QAbYUzJ+En8KcVm9Lk5+uGUQJHaZmMECZmOlix9HnH7n1TRkXMS0pGxIJokIVB9SuqZGGXw==} + cpu: [arm64] + os: [linux] + libc: [musl] + + '@img/sharp-libvips-linuxmusl-x64@1.2.4': + resolution: {integrity: sha512-+LpyBk7L44ZIXwz/VYfglaX/okxezESc6UxDSoyo2Ks6Jxc4Y7sGjpgU9s4PMgqgjj1gZCylTieNamqA1MF7Dg==} + cpu: [x64] + os: [linux] + libc: [musl] + + '@img/sharp-linux-arm64@0.34.5': + resolution: {integrity: sha512-bKQzaJRY/bkPOXyKx5EVup7qkaojECG6NLYswgktOZjaXecSAeCWiZwwiFf3/Y+O1HrauiE3FVsGxFg8c24rZg==} + engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} + cpu: [arm64] + os: [linux] + libc: [glibc] + + '@img/sharp-linux-arm@0.34.5': + resolution: {integrity: sha512-9dLqsvwtg1uuXBGZKsxem9595+ujv0sJ6Vi8wcTANSFpwV/GONat5eCkzQo/1O6zRIkh0m/8+5BjrRr7jDUSZw==} + engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} + cpu: [arm] + os: [linux] + libc: [glibc] + + '@img/sharp-linux-ppc64@0.34.5': + resolution: {integrity: sha512-7zznwNaqW6YtsfrGGDA6BRkISKAAE1Jo0QdpNYXNMHu2+0dTrPflTLNkpc8l7MUP5M16ZJcUvysVWWrMefZquA==} + engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} + cpu: [ppc64] + os: [linux] + libc: [glibc] + + '@img/sharp-linux-riscv64@0.34.5': + resolution: {integrity: sha512-51gJuLPTKa7piYPaVs8GmByo7/U7/7TZOq+cnXJIHZKavIRHAP77e3N2HEl3dgiqdD/w0yUfiJnII77PuDDFdw==} + engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} + cpu: [riscv64] + os: [linux] + libc: [glibc] + + '@img/sharp-linux-s390x@0.34.5': + resolution: {integrity: sha512-nQtCk0PdKfho3eC5MrbQoigJ2gd1CgddUMkabUj+rBevs8tZ2cULOx46E7oyX+04WGfABgIwmMC0VqieTiR4jg==} + engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} + cpu: [s390x] + os: [linux] + libc: [glibc] + + '@img/sharp-linux-x64@0.34.5': + resolution: {integrity: sha512-MEzd8HPKxVxVenwAa+JRPwEC7QFjoPWuS5NZnBt6B3pu7EG2Ge0id1oLHZpPJdn3OQK+BQDiw9zStiHBTJQQQQ==} + engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} + cpu: [x64] + os: [linux] + libc: [glibc] + + '@img/sharp-linuxmusl-arm64@0.34.5': + resolution: {integrity: sha512-fprJR6GtRsMt6Kyfq44IsChVZeGN97gTD331weR1ex1c1rypDEABN6Tm2xa1wE6lYb5DdEnk03NZPqA7Id21yg==} + engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} + cpu: [arm64] + os: [linux] + libc: [musl] + + '@img/sharp-linuxmusl-x64@0.34.5': + resolution: {integrity: sha512-Jg8wNT1MUzIvhBFxViqrEhWDGzqymo3sV7z7ZsaWbZNDLXRJZoRGrjulp60YYtV4wfY8VIKcWidjojlLcWrd8Q==} + engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} + cpu: [x64] + os: [linux] + libc: [musl] + + '@img/sharp-wasm32@0.34.5': + resolution: {integrity: sha512-OdWTEiVkY2PHwqkbBI8frFxQQFekHaSSkUIJkwzclWZe64O1X4UlUjqqqLaPbUpMOQk6FBu/HtlGXNblIs0huw==} + engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} + cpu: [wasm32] + + '@img/sharp-win32-arm64@0.34.5': + resolution: {integrity: sha512-WQ3AgWCWYSb2yt+IG8mnC6Jdk9Whs7O0gxphblsLvdhSpSTtmu69ZG1Gkb6NuvxsNACwiPV6cNSZNzt0KPsw7g==} + engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} + cpu: [arm64] + os: [win32] + + '@img/sharp-win32-ia32@0.34.5': + resolution: {integrity: sha512-FV9m/7NmeCmSHDD5j4+4pNI8Cp3aW+JvLoXcTUo0IqyjSfAZJ8dIUmijx1qaJsIiU+Hosw6xM5KijAWRJCSgNg==} + engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} + cpu: [ia32] + os: [win32] + + '@img/sharp-win32-x64@0.34.5': + resolution: {integrity: sha512-+29YMsqY2/9eFEiW93eqWnuLcWcufowXewwSNIT6UwZdUUCrM3oFjMWH/Z6/TMmb4hlFenmfAVbpWeup2jryCw==} + engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} + cpu: [x64] + os: [win32] + + '@lit-labs/ssr-dom-shim@1.6.0': + resolution: {integrity: sha512-VHb0ALPMTlgKjM6yIxxoQNnpKyUKLD04VzeQdsiXkMqkvYlAHxq9glGLmgbb889/1GsohSOAjvQYoiBppXFqrQ==} + + '@lit/reactive-element@2.1.2': + resolution: {integrity: sha512-pbCDiVMnne1lYUIaYNN5wrwQXDtHaYtg7YEFPeW+hws6U47WeFvISGUWekPGKWOP1ygrs0ef0o1VJMk1exos5A==} + + '@next/env@15.5.20': + resolution: {integrity: sha512-dXh51Wvddf8daEyBXryZZEe1FdVxEWx9lgaTseLZUtC1XP/W8Wri+Z+VPOElHlByk23CyqHdc2oVByX7wsTWsw==} + + '@next/swc-darwin-arm64@15.5.20': + resolution: {integrity: sha512-in0yXG7/pRBVjWeEl7f7ZZETpletSMFKXVS4GJgHENTPVrJFNJKPrYewa9rpZcvdjwFece5fZP0CK34G4PxowA==} + engines: {node: '>= 10'} + cpu: [arm64] + os: [darwin] + + '@next/swc-darwin-x64@15.5.20': + resolution: {integrity: sha512-0hsFshdPnTzGJdDTHeHJ+XPUShOpnyp9pUFDwDhqctsA0Cd8NcIVGRPtptYhgYY9DjkKgCDRkXxmgRc+CgT5Wg==} + engines: {node: '>= 10'} + cpu: [x64] + os: [darwin] + + '@next/swc-linux-arm64-gnu@15.5.20': + resolution: {integrity: sha512-DMvkoBtAABOzE6pMZRW/xNm7sKqql3wzzzZJ1R/d/rp4BCxv6LykouD3tHjGY8WdQqGpZs11t+R9AtjPxvvljw==} + engines: {node: '>= 10'} + cpu: [arm64] + os: [linux] + libc: [glibc] + + '@next/swc-linux-arm64-musl@15.5.20': + resolution: {integrity: sha512-RQmDfeYBtXV2FSId7dfA1hE6M/T6+g7wdbYnFQ47tw/gUBwV+CccLVejNmCGa9yLDitk83foeg8hl/3DjfYQ5g==} + engines: {node: '>= 10'} + cpu: [arm64] + os: [linux] + libc: [musl] + + '@next/swc-linux-x64-gnu@15.5.20': + resolution: {integrity: sha512-DkWLEdKajJwdGt27M3i1VEO2kelTvZrK6Pcb7JvW2BY+nofWm7FBsBNDj7g7Pr1NuQ5PLJvqEqYa20GTsBDnKQ==} + engines: {node: '>= 10'} + cpu: [x64] + os: [linux] + libc: [glibc] + + '@next/swc-linux-x64-musl@15.5.20': + resolution: {integrity: sha512-rAO5b7pKHvX+ExdmJskusDXTNbiNZfptifIPZItbUx+AOXxxTydVBsPt7Oz84DRd5mY8e0DcE8kvLj3AIfjE6w==} + engines: {node: '>= 10'} + cpu: [x64] + os: [linux] + libc: [musl] + + '@next/swc-win32-arm64-msvc@15.5.20': + resolution: {integrity: sha512-Hp3zFsN8N8Kj9+vY6L4vnZ9EtA9eXyATu0q4EfGbZTiocgPUNSfz8NWhym6xvaOmHpJ8EuoypuU1WejCPsTFtg==} + engines: {node: '>= 10'} + cpu: [arm64] + os: [win32] + + '@next/swc-win32-x64-msvc@15.5.20': + resolution: {integrity: sha512-T/L7CXpR1M0wij/xbF3rT1+7KvSkfOLr7C+ToHHWZTG2eKmb52C5WvsyGCBNtkVvDEUESWkRUbbqSH4rSbOCYQ==} + engines: {node: '>= 10'} + cpu: [x64] + os: [win32] + + '@swc/helpers@0.5.15': + resolution: {integrity: sha512-JQ5TuMi45Owi4/BIMAJBoSQoOJu12oOk/gADqlcUL9JEdHB8vyjUSsxqeNXnmXHjYKMi2WcYtezGEEhqUI/E2g==} + + '@types/trusted-types@2.0.7': + resolution: {integrity: sha512-ScaPdn1dQczgbl0QFTeTOmVHFULt394XJgOQNoyVhZ6r2vLnMLJfBPd53SB52T/3G36VI1/g2MZaX0cwDuXsfw==} + + caniuse-lite@1.0.30001800: + resolution: {integrity: sha512-MMHtuAz9Ys840zAY5F4k6fV5GaivZ9sPk+nz0mY+GYVzRBnYkN0mpqkSR92oWRQ19yQWo4HvBV/FnC16AJX8MA==} + + client-only@0.0.1: + resolution: {integrity: sha512-IV3Ou0jSMzZrd3pZ48nLkT9DA7Ag1pnPzaiQhpW7c3RbcqqzvzzVu+L8gfqMp/8IM2MQtSiqaCxrrcfu8I8rMA==} + + decimal.js@10.6.0: + resolution: {integrity: sha512-YpgQiITW3JXGntzdUmyUR1V812Hn8T1YVXhCu+wO3OpS4eU9l4YdD3qjyiKdV6mvV29zapkMeD390UVEf2lkUg==} + + detect-libc@2.1.2: + resolution: {integrity: sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==} + engines: {node: '>=8'} + + giscus@1.6.0: + resolution: {integrity: sha512-Zrsi8r4t1LVW950keaWcsURuZUQwUaMKjvJgTCY125vkW6OiEBkatE7ScJDbpqKHdZwb///7FVC21SE3iFK3PQ==} + + intl-messageformat@10.7.18: + resolution: {integrity: sha512-m3Ofv/X/tV8Y3tHXLohcuVuhWKo7BBq62cqY15etqmLxg2DZ34AGGgQDeR+SCta2+zICb1NX83af0GJmbQ1++g==} + + lit-element@4.2.2: + resolution: {integrity: sha512-aFKhNToWxoyhkNDmWZwEva2SlQia+jfG0fjIWV//YeTaWrVnOxD89dPKfigCUspXFmjzOEUQpOkejH5Ly6sG0w==} + + lit-html@3.3.3: + resolution: {integrity: sha512-el8M6jK2o3RXBnrSHX3ZKrsN8zEV63pSExTO1wYJz7QndGYZ8353e2a5PPX+qHe2aGayfnchQmkAojaWAREOIA==} + + lit@3.3.3: + resolution: {integrity: sha512-fycuvZg/hkpozL00lm1pEJH5nN/lr9ZXd6mJI2HSN4+Bzc+LDNdEApJ6HFbPkdFNHLvOplIIuJvxkS4XUxqirw==} + + nanoid@3.3.15: + resolution: {integrity: sha512-y7Wygv/7mEOvxTuEQDB8StXdMRBWf1kR/tlhAzBRUFkB2jfcLOAxO/SHmOO2zgz1pVgK29/kyupn059/bCHdjA==} + engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} + hasBin: true + + negotiator@1.0.0: + resolution: {integrity: sha512-8Ofs/AUQh8MaEcrlq5xOX0CQ9ypTF5dl78mjlMNfOK08fzpgTHQRQPBxcPlEtIw0yRpws+Zo/3r+5WRby7u3Gg==} + engines: {node: '>= 0.6'} + + next-intl@3.26.5: + resolution: {integrity: sha512-EQlCIfY0jOhRldiFxwSXG+ImwkQtDEfQeSOEQp6ieAGSLWGlgjdb/Ck/O7wMfC430ZHGeUKVKax8KGusTPKCgg==} + peerDependencies: + next: ^10.0.0 || ^11.0.0 || ^12.0.0 || ^13.0.0 || ^14.0.0 || ^15.0.0 + react: ^16.8.0 || ^17.0.0 || ^18.0.0 || >=19.0.0-rc <19.0.0 || ^19.0.0 + + next-themes@0.4.6: + resolution: {integrity: sha512-pZvgD5L0IEvX5/9GWyHMf3m8BKiVQwsCMHfoFosXtXBMnaS0ZnIJ9ST4b4NqLVKDEm8QBxoNNGNaBv2JNF6XNA==} + peerDependencies: + react: ^16.8 || ^17 || ^18 || ^19 || ^19.0.0-rc + react-dom: ^16.8 || ^17 || ^18 || ^19 || ^19.0.0-rc + + next@15.5.20: + resolution: {integrity: sha512-cvyS3/geydan1xLtE3FA8VCgdoQ/Gg/dlOldFkFCbB5VcVYJV7090hQLBnvTW2PwT76Z/dHdzDZCsVhZpoOlUA==} + engines: {node: ^18.18.0 || ^19.8.0 || >= 20.0.0} + hasBin: true + peerDependencies: + '@opentelemetry/api': ^1.1.0 + '@playwright/test': ^1.51.1 + babel-plugin-react-compiler: '*' + react: ^18.2.0 || 19.0.0-rc-de68d2f4-20241204 || ^19.0.0 + react-dom: ^18.2.0 || 19.0.0-rc-de68d2f4-20241204 || ^19.0.0 + sass: ^1.3.0 + peerDependenciesMeta: + '@opentelemetry/api': + optional: true + '@playwright/test': + optional: true + babel-plugin-react-compiler: + optional: true + sass: + optional: true + + picocolors@1.1.1: + resolution: {integrity: sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==} + + postcss@8.4.31: + resolution: {integrity: sha512-PS08Iboia9mts/2ygV3eLpY5ghnUcfLV/EXTOW1E2qYxJKGGBUtNjN76FYHnMs36RmARn41bC0AZmn+rR0OVpQ==} + engines: {node: ^10 || ^12 || >=14} + + react-dom@19.2.7: + resolution: {integrity: sha512-t0BRVXvbiE/o20Hfw669rLbMCDWtYZLvmJigy2f0MxsXF+71pxhR3xOkspmsO8h3ZlNzyibAmtCa3l4lYKk6gQ==} + peerDependencies: + react: ^19.2.7 + + react-schemaorg@2.0.1: + resolution: {integrity: sha512-3mS63dmMFYgKmmaBB2TWtQ9MHCzy/YJfDKxyCMUmJ2V3VzFMwVqCCagazsRA93BnOAkXfX0t29GTJx+2CoaL+Q==} + engines: {node: '>=12.0.0'} + peerDependencies: + react: '>=16.3.0' + schema-dts: '>=0.7.4' + typescript: '>=3.1.6' + + react@19.2.7: + resolution: {integrity: sha512-HNe9WslTbXmFK8o8cmwgAeJFSBvt1bPdHCVKtaaV+WlAN36mpT4hcRpwbf3fY56ar2oIXzsBpOAiIRHAdY0OlQ==} + engines: {node: '>=0.10.0'} + + scheduler@0.27.0: + resolution: {integrity: sha512-eNv+WrVbKu1f3vbYJT/xtiF5syA5HPIMtf9IgY/nKg0sWqzAUEvqY/xm7OcZc/qafLx/iO9FgOmeSAp4v5ti/Q==} + + schema-dts-lib@1.0.0: + resolution: {integrity: sha512-9MEO5vpQH9JdBioUupqluzxSYxPLjhmqRUudk15adUl/ypnRsM2/M1kN3AmVJQeG7nZqcL68H8JlGqQQT6vy9A==} + engines: {node: '>=14.0.0'} + peerDependencies: + typescript: '>=4.9.5' + + schema-dts@2.0.0: + resolution: {integrity: sha512-t7NoCy3Rn5GHGx6p7s1qIYK/AeIb8ZxJNR9WUNFkwMv2CiiGZBmqqYWc2FlZVm5ZbiHMY4OvBWhj7QtyrFO2Jw==} + + semver@7.8.5: + resolution: {integrity: sha512-Y7/KDsb8LjooZpwaqGyulO6DQlksgCncchHGk+sZIY4SBvUocMBEFH5Ur1fI4dV+Jvl0w6cjvucaIi40puRioA==} + engines: {node: '>=10'} + hasBin: true + + sharp@0.34.5: + resolution: {integrity: sha512-Ou9I5Ft9WNcCbXrU9cMgPBcCK8LiwLqcbywW3t4oDV37n1pzpuNLsYiAV8eODnjbtQlSDwZ2cUEeQz4E54Hltg==} + engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} + + source-map-js@1.2.1: + resolution: {integrity: sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==} + engines: {node: '>=0.10.0'} + + styled-jsx@5.1.6: + resolution: {integrity: sha512-qSVyDTeMotdvQYoHWLNGwRFJHC+i+ZvdBRYosOFgC+Wg1vx4frN2/RG/NA7SYqqvKNLf39P2LSRA2pu6n0XYZA==} + engines: {node: '>= 12.0.0'} + peerDependencies: + '@babel/core': '*' + babel-plugin-macros: '*' + react: '>= 16.8.0 || 17.x.x || ^18.0.0-0 || ^19.0.0-0' + peerDependenciesMeta: + '@babel/core': + optional: true + babel-plugin-macros: + optional: true + + tslib@2.8.1: + resolution: {integrity: sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==} + + typescript@6.0.3: + resolution: {integrity: sha512-y2TvuxSZPDyQakkFRPZHKFm+KKVqIisdg9/CZwm9ftvKXLP8NRWj38/ODjNbr43SsoXqNuAisEf1GdCxqWcdBw==} + engines: {node: '>=14.17'} + hasBin: true + + use-intl@3.26.5: + resolution: {integrity: sha512-OdsJnC/znPvHCHLQH/duvQNXnP1w0hPfS+tkSi3mAbfjYBGh4JnyfdwkQBfIVf7t8gs9eSX/CntxUMvtKdG2MQ==} + peerDependencies: + react: ^16.8.0 || ^17.0.0 || ^18.0.0 || >=19.0.0-rc <19.0.0 || ^19.0.0 + +snapshots: + + '@emnapi/runtime@1.11.2': + dependencies: + tslib: 2.8.1 + optional: true + + '@formatjs/ecma402-abstract@2.3.6': + dependencies: + '@formatjs/fast-memoize': 2.2.7 + '@formatjs/intl-localematcher': 0.6.2 + decimal.js: 10.6.0 + tslib: 2.8.1 + + '@formatjs/fast-memoize@2.2.7': + dependencies: + tslib: 2.8.1 + + '@formatjs/icu-messageformat-parser@2.11.4': + dependencies: + '@formatjs/ecma402-abstract': 2.3.6 + '@formatjs/icu-skeleton-parser': 1.8.16 + tslib: 2.8.1 + + '@formatjs/icu-skeleton-parser@1.8.16': + dependencies: + '@formatjs/ecma402-abstract': 2.3.6 + tslib: 2.8.1 + + '@formatjs/intl-localematcher@0.5.10': + dependencies: + tslib: 2.8.1 + + '@formatjs/intl-localematcher@0.6.2': + dependencies: + tslib: 2.8.1 + + '@giscus/react@3.1.0(react-dom@19.2.7(react@19.2.7))(react@19.2.7)': + dependencies: + giscus: 1.6.0 + react: 19.2.7 + react-dom: 19.2.7(react@19.2.7) + + '@img/colour@1.1.0': + optional: true + + '@img/sharp-darwin-arm64@0.34.5': + optionalDependencies: + '@img/sharp-libvips-darwin-arm64': 1.2.4 + optional: true + + '@img/sharp-darwin-x64@0.34.5': + optionalDependencies: + '@img/sharp-libvips-darwin-x64': 1.2.4 + optional: true + + '@img/sharp-libvips-darwin-arm64@1.2.4': + optional: true + + '@img/sharp-libvips-darwin-x64@1.2.4': + optional: true + + '@img/sharp-libvips-linux-arm64@1.2.4': + optional: true + + '@img/sharp-libvips-linux-arm@1.2.4': + optional: true + + '@img/sharp-libvips-linux-ppc64@1.2.4': + optional: true + + '@img/sharp-libvips-linux-riscv64@1.2.4': + optional: true + + '@img/sharp-libvips-linux-s390x@1.2.4': + optional: true + + '@img/sharp-libvips-linux-x64@1.2.4': + optional: true + + '@img/sharp-libvips-linuxmusl-arm64@1.2.4': + optional: true + + '@img/sharp-libvips-linuxmusl-x64@1.2.4': + optional: true + + '@img/sharp-linux-arm64@0.34.5': + optionalDependencies: + '@img/sharp-libvips-linux-arm64': 1.2.4 + optional: true + + '@img/sharp-linux-arm@0.34.5': + optionalDependencies: + '@img/sharp-libvips-linux-arm': 1.2.4 + optional: true + + '@img/sharp-linux-ppc64@0.34.5': + optionalDependencies: + '@img/sharp-libvips-linux-ppc64': 1.2.4 + optional: true + + '@img/sharp-linux-riscv64@0.34.5': + optionalDependencies: + '@img/sharp-libvips-linux-riscv64': 1.2.4 + optional: true + + '@img/sharp-linux-s390x@0.34.5': + optionalDependencies: + '@img/sharp-libvips-linux-s390x': 1.2.4 + optional: true + + '@img/sharp-linux-x64@0.34.5': + optionalDependencies: + '@img/sharp-libvips-linux-x64': 1.2.4 + optional: true + + '@img/sharp-linuxmusl-arm64@0.34.5': + optionalDependencies: + '@img/sharp-libvips-linuxmusl-arm64': 1.2.4 + optional: true + + '@img/sharp-linuxmusl-x64@0.34.5': + optionalDependencies: + '@img/sharp-libvips-linuxmusl-x64': 1.2.4 + optional: true + + '@img/sharp-wasm32@0.34.5': + dependencies: + '@emnapi/runtime': 1.11.2 + optional: true + + '@img/sharp-win32-arm64@0.34.5': + optional: true + + '@img/sharp-win32-ia32@0.34.5': + optional: true + + '@img/sharp-win32-x64@0.34.5': + optional: true + + '@lit-labs/ssr-dom-shim@1.6.0': {} + + '@lit/reactive-element@2.1.2': + dependencies: + '@lit-labs/ssr-dom-shim': 1.6.0 + + '@next/env@15.5.20': {} + + '@next/swc-darwin-arm64@15.5.20': + optional: true + + '@next/swc-darwin-x64@15.5.20': + optional: true + + '@next/swc-linux-arm64-gnu@15.5.20': + optional: true + + '@next/swc-linux-arm64-musl@15.5.20': + optional: true + + '@next/swc-linux-x64-gnu@15.5.20': + optional: true + + '@next/swc-linux-x64-musl@15.5.20': + optional: true + + '@next/swc-win32-arm64-msvc@15.5.20': + optional: true + + '@next/swc-win32-x64-msvc@15.5.20': + optional: true + + '@swc/helpers@0.5.15': + dependencies: + tslib: 2.8.1 + + '@types/trusted-types@2.0.7': {} + + caniuse-lite@1.0.30001800: {} + + client-only@0.0.1: {} + + decimal.js@10.6.0: {} + + detect-libc@2.1.2: + optional: true + + giscus@1.6.0: + dependencies: + lit: 3.3.3 + + intl-messageformat@10.7.18: + dependencies: + '@formatjs/ecma402-abstract': 2.3.6 + '@formatjs/fast-memoize': 2.2.7 + '@formatjs/icu-messageformat-parser': 2.11.4 + tslib: 2.8.1 + + lit-element@4.2.2: + dependencies: + '@lit-labs/ssr-dom-shim': 1.6.0 + '@lit/reactive-element': 2.1.2 + lit-html: 3.3.3 + + lit-html@3.3.3: + dependencies: + '@types/trusted-types': 2.0.7 + + lit@3.3.3: + dependencies: + '@lit/reactive-element': 2.1.2 + lit-element: 4.2.2 + lit-html: 3.3.3 + + nanoid@3.3.15: {} + + negotiator@1.0.0: {} + + next-intl@3.26.5(next@15.5.20(react-dom@19.2.7(react@19.2.7))(react@19.2.7))(react@19.2.7): + dependencies: + '@formatjs/intl-localematcher': 0.5.10 + negotiator: 1.0.0 + next: 15.5.20(react-dom@19.2.7(react@19.2.7))(react@19.2.7) + react: 19.2.7 + use-intl: 3.26.5(react@19.2.7) + + next-themes@0.4.6(react-dom@19.2.7(react@19.2.7))(react@19.2.7): + dependencies: + react: 19.2.7 + react-dom: 19.2.7(react@19.2.7) + + next@15.5.20(react-dom@19.2.7(react@19.2.7))(react@19.2.7): + dependencies: + '@next/env': 15.5.20 + '@swc/helpers': 0.5.15 + caniuse-lite: 1.0.30001800 + postcss: 8.4.31 + react: 19.2.7 + react-dom: 19.2.7(react@19.2.7) + styled-jsx: 5.1.6(react@19.2.7) + optionalDependencies: + '@next/swc-darwin-arm64': 15.5.20 + '@next/swc-darwin-x64': 15.5.20 + '@next/swc-linux-arm64-gnu': 15.5.20 + '@next/swc-linux-arm64-musl': 15.5.20 + '@next/swc-linux-x64-gnu': 15.5.20 + '@next/swc-linux-x64-musl': 15.5.20 + '@next/swc-win32-arm64-msvc': 15.5.20 + '@next/swc-win32-x64-msvc': 15.5.20 + sharp: 0.34.5 + transitivePeerDependencies: + - '@babel/core' + - babel-plugin-macros + + picocolors@1.1.1: {} + + postcss@8.4.31: + dependencies: + nanoid: 3.3.15 + picocolors: 1.1.1 + source-map-js: 1.2.1 + + react-dom@19.2.7(react@19.2.7): + dependencies: + react: 19.2.7 + scheduler: 0.27.0 + + react-schemaorg@2.0.1(react@19.2.7)(schema-dts@2.0.0(typescript@6.0.3))(typescript@6.0.3): + dependencies: + react: 19.2.7 + schema-dts: 2.0.0(typescript@6.0.3) + typescript: 6.0.3 + + react@19.2.7: {} + + scheduler@0.27.0: {} + + schema-dts-lib@1.0.0(typescript@6.0.3): + dependencies: + typescript: 6.0.3 + + schema-dts@2.0.0(typescript@6.0.3): + dependencies: + schema-dts-lib: 1.0.0(typescript@6.0.3) + transitivePeerDependencies: + - typescript + + semver@7.8.5: + optional: true + + sharp@0.34.5: + dependencies: + '@img/colour': 1.1.0 + detect-libc: 2.1.2 + semver: 7.8.5 + optionalDependencies: + '@img/sharp-darwin-arm64': 0.34.5 + '@img/sharp-darwin-x64': 0.34.5 + '@img/sharp-libvips-darwin-arm64': 1.2.4 + '@img/sharp-libvips-darwin-x64': 1.2.4 + '@img/sharp-libvips-linux-arm': 1.2.4 + '@img/sharp-libvips-linux-arm64': 1.2.4 + '@img/sharp-libvips-linux-ppc64': 1.2.4 + '@img/sharp-libvips-linux-riscv64': 1.2.4 + '@img/sharp-libvips-linux-s390x': 1.2.4 + '@img/sharp-libvips-linux-x64': 1.2.4 + '@img/sharp-libvips-linuxmusl-arm64': 1.2.4 + '@img/sharp-libvips-linuxmusl-x64': 1.2.4 + '@img/sharp-linux-arm': 0.34.5 + '@img/sharp-linux-arm64': 0.34.5 + '@img/sharp-linux-ppc64': 0.34.5 + '@img/sharp-linux-riscv64': 0.34.5 + '@img/sharp-linux-s390x': 0.34.5 + '@img/sharp-linux-x64': 0.34.5 + '@img/sharp-linuxmusl-arm64': 0.34.5 + '@img/sharp-linuxmusl-x64': 0.34.5 + '@img/sharp-wasm32': 0.34.5 + '@img/sharp-win32-arm64': 0.34.5 + '@img/sharp-win32-ia32': 0.34.5 + '@img/sharp-win32-x64': 0.34.5 + optional: true + + source-map-js@1.2.1: {} + + styled-jsx@5.1.6(react@19.2.7): + dependencies: + client-only: 0.0.1 + react: 19.2.7 + + tslib@2.8.1: {} + + typescript@6.0.3: {} + + use-intl@3.26.5(react@19.2.7): + dependencies: + '@formatjs/fast-memoize': 2.2.7 + intl-messageformat: 10.7.18 + react: 19.2.7 diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml new file mode 100644 index 0000000..b31d79c --- /dev/null +++ b/pnpm-workspace.yaml @@ -0,0 +1,5 @@ +verifyDepsBeforeRun: false +ignoredBuiltDependencies: + - sharp +allowBuilds: + sharp: set this to true or false diff --git a/pt/index.html b/pt/index.html deleted file mode 100644 index 4a7939a..0000000 --- a/pt/index.html +++ /dev/null @@ -1,253 +0,0 @@ - - - - - - - ghost-progress-plugin: Barra de progresso de leitura para Ghost · configurador e demo - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Imagem destacada
- -
-

Prévia do ghost-progress-plugin

-

Role e veja a barra do topo encher de 0% a 100%. Altere as opções no painel à esquerda e o código de incorporação é atualizado.

- -

Introdução

-

ghost-progress-plugin é uma barra de progresso de leitura minúscula e sem dependências para o Ghost. Começou como um widget para o Ghost, mas também funciona em blogs baseados em Notion e em qualquer lugar onde você possa adicionar um script. Enquanto você lê, uma barra fina se enche para mostrar até onde você está no artigo. Esta página é um exemplo ao vivo: a barra no topo é o widget real.

- -

Instalação

-

Adicione de uma vez com este trecho, sem etapa de build nem arquivos do tema para editar:

-
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/GreedyLabs/ghost-progress-plugin@1/progress.css">
-<script src="https://cdn.jsdelivr.net/gh/GreedyLabs/ghost-progress-plugin@1/progress.min.js"
-        data-content=".gh-content"
-        data-position="top"></script>
-

Injeção de código

-

No Ghost, cole em Settings → Code injection → Site Footer. Em hospedagem baseada em Notion, adicione no campo de código personalizado: o oopy tem uma caixa de código head/footer, o super.so tem uma área Custom Code, e ali você define data-content como .notion-page-content. Em qualquer outro site, coloque logo antes da tag </body>.

-

Opções

-

Tudo é configurado com atributos data-* na tag do script: o seletor de conteúdo, a posição, a espessura e o z-index:

-
data-content=".gh-content"
-data-position="top"
-data-height="4"
-data-z-index="100"
- -

Personalização

-

A cor e a espessura da barra são ajustáveis. Cada classe e variável CSS fica no namespace greedylabs-ghost-progress, então nunca conflita com o seu tema.

-

Cores

-

O preenchimento segue, por padrão, a cor de destaque do seu tema Ghost (--ghost-accent-color); use data-color ou sobrescreva as variáveis CSS para mudá-la. A trilha não lida é transparente por padrão, então dê a ela uma cor para a barra aparecer mesmo em 0%:

-
.greedylabs-ghost-progress {
-  --greedylabs-ghost-progress-track: rgba(0,0,0,.08);
-}
-@media (prefers-color-scheme: dark) {
-  .greedylabs-ghost-progress {
-    --greedylabs-ghost-progress-track: rgba(255,255,255,.14);
-  }
-}
-

Posição

-

Use data-position para topo ou base, e data-height para a espessura em pixels. A barra chega a 0% quando o topo do artigo encontra o topo da viewport, e a 100% quando a base encontra a base.

- -

Perguntas frequentes

- -

Ele mede a página toda ou só o artigo?

-

Só o artigo apontado por data-content. Cabeçalho, imagem de destaque e rodapé não contam no progresso.

-

Por que a barra fica invisível no topo?

-

Em 0% o preenchimento não tem largura e a trilha é transparente por padrão. Dê uma cor à trilha (ver Cores) para a barra aparecer mesmo vazia.

-

Funciona fora do Ghost?

-

Sim. Onde você puder injetar um script, aponte data-content para o seu contêiner de artigo. No Notion é .notion-page-content.

- -

Conclusão

-

ghost-progress-plugin é de código aberto sob a licença MIT; o código e as issues estão no GitHub. Experimente as opções no painel à esquerda e copie o trecho quando gostar. Se ajudou você, um café é sempre bem-vindo ☕.

-
- -
- -
- - - - - - diff --git a/CNAME b/public/CNAME similarity index 100% rename from CNAME rename to public/CNAME diff --git a/index.html b/public/index.html similarity index 83% rename from index.html rename to public/index.html index c47bb54..a305728 100644 --- a/index.html +++ b/public/index.html @@ -7,7 +7,7 @@ - + @@ -25,9 +25,9 @@ var n = ((navigator.languages && navigator.languages[0]) || navigator.language || def).toLowerCase(); var pick = def; for (var i = 0; i < supported.length; i++) { - if (n === supported[i] || n.indexOf(supported[i] + '-') === 0) { pick = supported[i]; break; } + if (n === supported[i] || n.indexOf(supported[i] + "-") === 0) { pick = supported[i]; break; } } - location.replace('/' + pick + '/'); + location.replace("/" + pick + "/"); })(); diff --git a/llms.txt b/public/llms.txt similarity index 100% rename from llms.txt rename to public/llms.txt diff --git a/public/og-image.png b/public/og-image.png new file mode 100644 index 0000000..45274d6 Binary files /dev/null and b/public/og-image.png differ diff --git a/robots.txt b/public/robots.txt similarity index 100% rename from robots.txt rename to public/robots.txt diff --git a/scripts/build-i18n.mjs b/scripts/build-i18n.mjs deleted file mode 100644 index 9267773..0000000 --- a/scripts/build-i18n.mjs +++ /dev/null @@ -1,367 +0,0 @@ -#!/usr/bin/env node -/* Generates the localized demo pages from i18n/translations.json: - * //index.html — fully translated, indexable, hreflang-linked - * /index.html — language detector that redirects to // - * /sitemap.xml — root + every language URL - * Shared assets (progress.css, progress.js, demo.css, demo.js, og-image.png) stay at root - * and are referenced with absolute paths so every language page shares them. - * - * Run from the repo root: node scripts/build-i18n.mjs - */ -import { readFileSync, writeFileSync, mkdirSync } from 'node:fs'; -import { fileURLToPath } from 'node:url'; -import { dirname, join } from 'node:path'; - -const ROOT = join(dirname(fileURLToPath(import.meta.url)), '..'); -const ORIGIN = 'https://ghost-progress-plugin.greedylabs.kr'; -// Widget delivery CDN: jsDelivr serves the GitHub repo; @1 tracks the latest -// v1.x release and auto-minifies (the .min file). Statically (@main) mirrors -// the same paths as a fallback if jsDelivr is down. -const CDN = 'https://cdn.jsdelivr.net/gh/GreedyLabs/ghost-progress-plugin@1'; -const data = JSON.parse(readFileSync(join(ROOT, 'i18n/translations.json'), 'utf8')); -const ORDER = data.order; -const DEFAULT = data.default; - -const esc = (s) => String(s).replace(/&/g, '&').replace(//g, '>'); -const escAttr = (s) => esc(s).replace(/"/g, '"'); - -// esc() a body string, then wrap unambiguous code tokens (data-* attributes, CSS -// selectors, class names) in so they render in monospace. One pass, so -// nothing double-wraps. Bare English words (after, replace) are left alone. -const CODE_RE = /(data-[a-z]+(?:-[a-z]+)*(?:="[^"]*")?)|(\.gh-[a-z-]+)|(\.notion-page-content)|(\.giscus)(?![\w-])|(gh-comments gh-canvas)|(--[a-z-]*ghost[a-z-]*)|(greedylabs-ghost-[a-z-]+)|(h[1-6](?:,\s?h[1-6])+)/g; -const richText = (s) => esc(s).replace(CODE_RE, (m) => `${m}`); - -// giscus UI language codes (fall back to en for unsupported) -const GISCUS_LANG = { ko: 'ko', en: 'en', ja: 'ja', zh: 'zh-CN', es: 'es', fr: 'fr', de: 'de', pt: 'pt', hi: 'en' }; - -// Code samples shown in the article body. Language-neutral, so they live here -// rather than in translations.json. esc()'d before they go into the HTML. -const codeInstall = () => -` -`; - -const CODE_OPTIONS = -`data-content=".gh-content" -data-position="top" -data-height="4" -data-z-index="100"`; - -const CODE_COLOR = -`.greedylabs-ghost-progress { - --greedylabs-ghost-progress-track: rgba(0,0,0,.08); -} -@media (prefers-color-scheme: dark) { - .greedylabs-ghost-progress { - --greedylabs-ghost-progress-track: rgba(255,255,255,.14); - } -}`; - -const FAVICON = "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Crect width='32' height='32' rx='7' fill='%231a73e8'/%3E%3Cg fill='white'%3E%3Crect x='8' y='9' width='12' height='2.5' rx='1.25'/%3E%3Crect x='8' y='15' width='16' height='2.5' rx='1.25'/%3E%3Crect x='8' y='21' width='10' height='2.5' rx='1.25'/%3E%3C/g%3E%3C/svg%3E"; - -function hreflangs(currentUrl) { - const links = ORDER.map( - (l) => ` ` - ); - links.push(` `); - return links.join('\n'); -} - -function langSwitch(cur) { - const opts = ORDER.map( - (l) => `` - ).join('\n '); - return ``; -} - -function themeSwitch(t) { - return ``; -} - -const REPO = 'https://github.com/GreedyLabs/ghost-progress-plugin'; -const ORG = 'https://github.com/GreedyLabs'; - -// SoftwareApplication + WebSite as a @graph. No aggregateRating — there are no -// real ratings, and fabricating them would be a policy violation. -function jsonld(lang, t, url) { - const graph = { - '@context': 'https://schema.org', - '@graph': [ - { - '@type': 'SoftwareApplication', - name: 'ghost-progress-plugin', - description: t.description, - applicationCategory: 'DeveloperApplication', - operatingSystem: 'Web (Ghost, Notion)', - softwareVersion: '1', - url, - codeRepository: REPO, - license: 'https://opensource.org/licenses/MIT', - author: { '@type': 'Organization', name: 'GreedyLabs', url: ORG }, - offers: { '@type': 'Offer', price: '0', priceCurrency: 'USD' }, - sameAs: [REPO] - }, - { - '@type': 'WebSite', - name: 'ghost-progress-plugin', - url: `${ORIGIN}/`, - inLanguage: lang, - publisher: { '@type': 'Organization', name: 'GreedyLabs', url: ORG } - } - ] - }; - return JSON.stringify(graph, null, 2) - .split('\n') - .map((line) => ' ' + line) - .join('\n'); -} - -function page(lang) { - const t = data.langs[lang]; - const url = `${ORIGIN}/${lang}/`; - const i18nJson = JSON.stringify({ copy: t.copy, copyDone: t.copyDone }); - return ` - - - - - - ${esc(t.title)} - - - - - - - - - - -${hreflangs(url)} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
${esc(t.heroText)}
- -
-

${esc(t.demoTitle)}

-

${richText(t.demoIntro)}

- -

${esc(t.h_intro)}

-

${richText(t.bodyIntro)}

- -

${esc(t.h_install)}

-

${richText(t.bodyInstall)}

-
${esc(codeInstall(t))}
-

${esc(t.h_codeinjection)}

-

${richText(t.bodyCodeInjection)}

-

${esc(t.h_options)}

-

${richText(t.bodyOptions)}

-
${esc(CODE_OPTIONS)}
- -

${esc(t.h_customize)}

-

${richText(t.bodyCustomize)}

-

${esc(t.h_color)}

-

${richText(t.bodyColor)}

-
${esc(CODE_COLOR)}
-

${esc(t.h_position)}

-

${richText(t.bodyPosition)}

- -

${esc(t.h_faq)}

- -

${esc(t.faqQ1)}

-

${richText(t.faqA1)}

-

${esc(t.faqQ2)}

-

${richText(t.faqA2)}

-

${esc(t.faqQ3)}

-

${richText(t.faqA3)}

- -

${esc(t.h_closing)}

-

${richText(t.bodyClosing)}

-
- -
- -
- - - - - - -`; -} - -function redirector() { - const noscript = ORDER.map((l) => `
  • ${esc(data.langs[l].name)}
  • `).join(''); - return ` - - - - - ghost-progress-plugin: Reading progress bar for Ghost - - - - -${hreflangs(`${ORIGIN}/`)} - - - - -

    Continue in English →

    - - -`; -} - -function sitemap() { - // root + each language - const items = [` \n ${ORIGIN}/\n monthly\n 1.0\n `]; - for (const l of ORDER) { - items.push(` \n ${ORIGIN}/${l}/\n monthly\n 0.8\n `); - } - return `\n\n${items.join('\n')}\n\n`; -} - -// --- write everything --- -for (const lang of ORDER) { - mkdirSync(join(ROOT, lang), { recursive: true }); - writeFileSync(join(ROOT, lang, 'index.html'), page(lang)); - console.log('wrote', `${lang}/index.html`); -} -writeFileSync(join(ROOT, 'index.html'), redirector()); -console.log('wrote', 'index.html (redirector)'); -writeFileSync(join(ROOT, 'sitemap.xml'), sitemap()); -console.log('wrote', 'sitemap.xml'); -console.log('done:', ORDER.length, 'languages'); diff --git a/scripts/copy-widget.mjs b/scripts/copy-widget.mjs new file mode 100644 index 0000000..8c03667 --- /dev/null +++ b/scripts/copy-widget.mjs @@ -0,0 +1,11 @@ +// Copy the CDN-canonical widget files into public/ so the static demo serves +// them locally at /progress.js and /progress.css. The copies are gitignored. +import { copyFileSync, mkdirSync } from 'node:fs'; +import { fileURLToPath } from 'node:url'; +import { dirname, join } from 'node:path'; + +const ROOT = join(dirname(fileURLToPath(import.meta.url)), '..'); +mkdirSync(join(ROOT, 'public'), { recursive: true }); +for (const f of ['progress.js', 'progress.css']) { + copyFileSync(join(ROOT, f), join(ROOT, 'public', f)); +} diff --git a/sitemap.xml b/sitemap.xml deleted file mode 100644 index a32f5a1..0000000 --- a/sitemap.xml +++ /dev/null @@ -1,53 +0,0 @@ - - - - https://ghost-progress-plugin.greedylabs.kr/ - monthly - 1.0 - - - https://ghost-progress-plugin.greedylabs.kr/ko/ - monthly - 0.8 - - - https://ghost-progress-plugin.greedylabs.kr/en/ - monthly - 0.8 - - - https://ghost-progress-plugin.greedylabs.kr/ja/ - monthly - 0.8 - - - https://ghost-progress-plugin.greedylabs.kr/zh/ - monthly - 0.8 - - - https://ghost-progress-plugin.greedylabs.kr/es/ - monthly - 0.8 - - - https://ghost-progress-plugin.greedylabs.kr/fr/ - monthly - 0.8 - - - https://ghost-progress-plugin.greedylabs.kr/de/ - monthly - 0.8 - - - https://ghost-progress-plugin.greedylabs.kr/pt/ - monthly - 0.8 - - - https://ghost-progress-plugin.greedylabs.kr/hi/ - monthly - 0.8 - - diff --git a/zh/index.html b/zh/index.html deleted file mode 100644 index 943c3b2..0000000 --- a/zh/index.html +++ /dev/null @@ -1,253 +0,0 @@ - - - - - - - ghost-progress-plugin: Ghost 阅读进度条 · 配置与演示 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    特色图片
    - -
    -

    ghost-progress-plugin 预览

    -

    滚动时顶部的进度条会从 0% 填充到 100%。在左侧面板修改选项,嵌入代码也随之更新。

    - -

    开始之前

    -

    ghost-progress-plugin 是一个轻量、无依赖的 Ghost 阅读进度条。它最初是为 Ghost 而做,但同样适用于基于 Notion 的博客,以及任何能添加脚本的地方。阅读时一条细条会填充,显示你读到文章的哪个位置。本页就是实时示例,顶部的进度条正是真实运行的组件。

    - -

    安装方法

    -

    无需构建、无需修改主题文件,粘贴下面这段代码即可完成安装:

    -
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/GreedyLabs/ghost-progress-plugin@1/progress.css">
    -<script src="https://cdn.jsdelivr.net/gh/GreedyLabs/ghost-progress-plugin@1/progress.min.js"
    -        data-content=".gh-content"
    -        data-position="top"></script>
    -

    代码注入

    -

    在 Ghost 中,粘贴到 Settings → Code injection → Site Footer。基于 Notion 的托管,则放进自定义代码处:oopy 在站点设置里有 head/footer 代码框,super.so 有 Custom Code 区域,在那里把 data-content 设为 .notion-page-content。其他网站则放在结束标签 </body> 之前。

    -

    选项设置

    -

    所有行为都通过脚本标签上的 data-* 属性配置:可设置正文选择器、位置、粗细和 z-index:

    -
    data-content=".gh-content"
    -data-position="top"
    -data-height="4"
    -data-z-index="100"
    - -

    自定义

    -

    进度条的颜色和粗细都可自由调整。所有类名和 CSS 变量都以 greedylabs-ghost-progress 命名空间隔离,绝不会与你的主题冲突。

    -

    颜色

    -

    填充色默认跟随 Ghost 主题强调色(--ghost-accent-color)。要更改,可设置 data-color 或覆盖 CSS 变量。未读部分的轨道默认透明,若想在 0% 时也能看到进度条,请给轨道设置颜色:

    -
    .greedylabs-ghost-progress {
    -  --greedylabs-ghost-progress-track: rgba(0,0,0,.08);
    -}
    -@media (prefers-color-scheme: dark) {
    -  .greedylabs-ghost-progress {
    -    --greedylabs-ghost-progress-track: rgba(255,255,255,.14);
    -  }
    -}
    -

    位置

    -

    data-position 设置顶部或底部,data-height 设置粗细(px)。当文章顶部到达视口顶部时为 0%,底部到达视口底部时为 100%。

    - -

    常见问题

    - -

    它以整页为准还是以文章为准?

    -

    以你用 data-content 指定的文章为准。页眉、封面图和页脚不计入进度。

    -

    为什么顶部看不到进度条?

    -

    在 0% 时填充宽度为 0,且轨道默认透明。给轨道设置颜色(见配色一节),空的时候也能看到进度条。

    -

    在 Ghost 之外能用吗?

    -

    能。只要能注入脚本,用 data-content 指向你的正文容器即可。Notion 是 .notion-page-content

    - -

    结语

    -

    ghost-progress-plugin 是 MIT 许可的开源项目,代码与问题反馈都在 GitHub 上。在左侧面板调整选项,满意后复制嵌入代码即可。如果它帮到了你,欢迎请我喝杯咖啡 ☕。

    -
    - -
    - -
    - - - - - -