Merge branch 'v4' of github.com:jackyzha0/quartz into v4

This commit is contained in:
Justin 2024-07-02 04:06:54 -04:00
commit a1aa16090d
8 changed files with 206 additions and 40 deletions

View File

@ -7,6 +7,7 @@ on:
push: push:
branches: branches:
- v4 - v4
workflow_dispatch:
jobs: jobs:
build-and-test: build-and-test:
@ -18,17 +19,17 @@ jobs:
permissions: permissions:
contents: write contents: write
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v4
with: with:
fetch-depth: 0 fetch-depth: 0
- name: Setup Node - name: Setup Node
uses: actions/setup-node@v3 uses: actions/setup-node@v4
with: with:
node-version: 18 node-version: 18
- name: Cache dependencies - name: Cache dependencies
uses: actions/cache@v3 uses: actions/cache@v4
with: with:
path: ~/.npm path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
@ -52,17 +53,17 @@ jobs:
permissions: permissions:
contents: write contents: write
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v4
with: with:
fetch-depth: 0 fetch-depth: 0
- name: Setup Node - name: Setup Node
uses: actions/setup-node@v3 uses: actions/setup-node@v4
with: with:
node-version: 18 node-version: 18
- name: Get package version - name: Get package version
run: node -p -e '`PACKAGE_VERSION=${require("./package.json").version}`' >> $GITHUB_ENV run: node -p -e '`PACKAGE_VERSION=${require("./package.json").version}`' >> $GITHUB_ENV
- name: Create release tag - name: Create release tag
uses: pkgdeps/git-tag-action@v2 uses: pkgdeps/git-tag-action@v3
with: with:
github_token: ${{ secrets.GITHUB_TOKEN }} github_token: ${{ secrets.GITHUB_TOKEN }}
github_repo: ${{ github.repository }} github_repo: ${{ github.repository }}

View File

@ -57,18 +57,16 @@ jobs:
build: build:
runs-on: ubuntu-22.04 runs-on: ubuntu-22.04
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v4
with: with:
fetch-depth: 0 # Fetch all history for git info fetch-depth: 0 # Fetch all history for git info
- uses: actions/setup-node@v3 - uses: actions/setup-node@v4
with:
node-version: 18.14
- name: Install Dependencies - name: Install Dependencies
run: npm ci run: npm ci
- name: Build Quartz - name: Build Quartz
run: npx quartz build run: npx quartz build
- name: Upload artifact - name: Upload artifact
uses: actions/upload-pages-artifact@v2 uses: actions/upload-pages-artifact@v3
with: with:
path: public path: public
@ -81,7 +79,7 @@ jobs:
steps: steps:
- name: Deploy to GitHub Pages - name: Deploy to GitHub Pages
id: deployment id: deployment
uses: actions/deploy-pages@v2 uses: actions/deploy-pages@v4
``` ```
Then: Then:
@ -182,35 +180,31 @@ Using `docs.example.com` is an example of a subdomain. They're a simple way of c
## GitLab Pages ## GitLab Pages
In your local Quartz, create a new file `.gitlab-ci.yaml`. In your local Quartz, create a new file `.gitlab-ci.yml`.
```yaml title=".gitlab-ci.yaml" ```yaml title=".gitlab-ci.yml"
stages: stages:
- build - build
- deploy - deploy
variables: image: node:18
NODE_VERSION: "18.14" cache: # Cache modules in between jobs
key: $CI_COMMIT_REF_SLUG
paths:
- .npm/
build: build:
stage: build stage: build
rules: rules:
- if: '$CI_COMMIT_REF_NAME == "v4"' - if: '$CI_COMMIT_REF_NAME == "v4"'
before_script: before_script:
- apt-get update -q && apt-get install -y nodejs npm
- npm install -g n
- n $NODE_VERSION
- hash -r - hash -r
- npm ci - npm ci --cache .npm --prefer-offline
script: script:
- npx quartz build - npx quartz build
artifacts: artifacts:
paths: paths:
- public - public
cache:
paths:
- ~/.npm/
key: "${CI_COMMIT_REF_SLUG}-node-${CI_COMMIT_REF_NAME}"
tags: tags:
- docker - docker

View File

@ -6,6 +6,7 @@ import ja from "./locales/ja-JP"
import de from "./locales/de-DE" import de from "./locales/de-DE"
import nl from "./locales/nl-NL" import nl from "./locales/nl-NL"
import ro from "./locales/ro-RO" import ro from "./locales/ro-RO"
import ca from "./locales/ca-ES"
import es from "./locales/es-ES" import es from "./locales/es-ES"
import ar from "./locales/ar-SA" import ar from "./locales/ar-SA"
import uk from "./locales/uk-UA" import uk from "./locales/uk-UA"
@ -20,6 +21,7 @@ import pl from "./locales/pl-PL"
export const TRANSLATIONS = { export const TRANSLATIONS = {
"en-US": en, "en-US": en,
"en-GB": en,
"fr-FR": fr, "fr-FR": fr,
"it-IT": it, "it-IT": it,
"ja-JP": ja, "ja-JP": ja,
@ -28,6 +30,7 @@ export const TRANSLATIONS = {
"nl-BE": nl, "nl-BE": nl,
"ro-RO": ro, "ro-RO": ro,
"ro-MD": ro, "ro-MD": ro,
"ca-ES": ca,
"es-ES": es, "es-ES": es,
"ar-SA": ar, "ar-SA": ar,
"ar-AE": ar, "ar-AE": ar,

View File

@ -0,0 +1,84 @@
import { Translation } from "./definition"
export default {
propertyDefaults: {
title: "Sense títol",
description: "Sense descripció",
},
components: {
callout: {
note: "Nota",
abstract: "Resum",
info: "Informació",
todo: "Per fer",
tip: "Consell",
success: "Èxit",
question: "Pregunta",
warning: "Advertència",
failure: "Fall",
danger: "Perill",
bug: "Error",
example: "Exemple",
quote: "Cita",
},
backlinks: {
title: "Retroenllaç",
noBacklinksFound: "No s'han trobat retroenllaços",
},
themeToggle: {
lightMode: "Mode clar",
darkMode: "Mode fosc",
},
explorer: {
title: "Explorador",
},
footer: {
createdWith: "Creat amb",
},
graph: {
title: "Vista Gràfica",
},
recentNotes: {
title: "Notes Recents",
seeRemainingMore: ({ remaining }) => `Vegi ${remaining} més →`,
},
transcludes: {
transcludeOf: ({ targetSlug }) => `Transcluit de ${targetSlug}`,
linkToOriginal: "Enllaç a l'original",
},
search: {
title: "Cercar",
searchBarPlaceholder: "Cerca alguna cosa",
},
tableOfContents: {
title: "Taula de Continguts",
},
contentMeta: {
readingTime: ({ minutes }) => `Es llegeix en ${minutes} min`,
},
},
pages: {
rss: {
recentNotes: "Notes recents",
lastFewNotes: ({ count }) => `Últimes ${count} notes`,
},
error: {
title: "No s'ha trobat.",
notFound: "Aquesta pàgina és privada o no existeix.",
home: "Torna a la pàgina principal",
},
folderContent: {
folder: "Carpeta",
itemsUnderFolder: ({ count }) =>
count === 1 ? "1 article en aquesta carpeta." : `${count} articles en esta carpeta.`,
},
tagContent: {
tag: "Etiqueta",
tagIndex: "índex d'Etiquetes",
itemsUnderTag: ({ count }) =>
count === 1 ? "1 article amb aquesta etiqueta." : `${count} article amb aquesta etiqueta.`,
showingFirst: ({ count }) => `Mostrant les primeres ${count} etiquetes.`,
totalTags: ({ count }) => `S'han trobat ${count} etiquetes en total.`,
},
},
} as const satisfies Translation

View File

@ -0,0 +1,84 @@
import { Translation } from "./definition"
export default {
propertyDefaults: {
title: "Untitled",
description: "No description provided",
},
components: {
callout: {
note: "Note",
abstract: "Abstract",
info: "Info",
todo: "To-Do",
tip: "Tip",
success: "Success",
question: "Question",
warning: "Warning",
failure: "Failure",
danger: "Danger",
bug: "Bug",
example: "Example",
quote: "Quote",
},
backlinks: {
title: "Backlinks",
noBacklinksFound: "No backlinks found",
},
themeToggle: {
lightMode: "Light mode",
darkMode: "Dark mode",
},
explorer: {
title: "Explorer",
},
footer: {
createdWith: "Created with",
},
graph: {
title: "Graph View",
},
recentNotes: {
title: "Recent Notes",
seeRemainingMore: ({ remaining }) => `See ${remaining} more →`,
},
transcludes: {
transcludeOf: ({ targetSlug }) => `Transclude of ${targetSlug}`,
linkToOriginal: "Link to original",
},
search: {
title: "Search",
searchBarPlaceholder: "Search for something",
},
tableOfContents: {
title: "Table of Contents",
},
contentMeta: {
readingTime: ({ minutes }) => `${minutes} min read`,
},
},
pages: {
rss: {
recentNotes: "Recent notes",
lastFewNotes: ({ count }) => `Last ${count} notes`,
},
error: {
title: "Not Found",
notFound: "Either this page is private or doesn't exist.",
home: "Return to Homepage",
},
folderContent: {
folder: "Folder",
itemsUnderFolder: ({ count }) =>
count === 1 ? "1 item under this folder." : `${count} items under this folder.`,
},
tagContent: {
tag: "Tag",
tagIndex: "Tag Index",
itemsUnderTag: ({ count }) =>
count === 1 ? "1 item with this tag." : `${count} items with this tag.`,
showingFirst: ({ count }) => `Showing first ${count} tags.`,
totalTags: ({ count }) => `Found ${count} total tags.`,
},
},
} as const satisfies Translation

View File

@ -22,8 +22,8 @@ export default {
quote: "Cita", quote: "Cita",
}, },
backlinks: { backlinks: {
title: "Enlaces de Retroceso", title: "Retroenlaces",
noBacklinksFound: "No se han encontrado enlaces traseros", noBacklinksFound: "No se han encontrado retroenlaces",
}, },
themeToggle: { themeToggle: {
lightMode: "Modo claro", lightMode: "Modo claro",
@ -54,18 +54,18 @@ export default {
title: "Tabla de Contenidos", title: "Tabla de Contenidos",
}, },
contentMeta: { contentMeta: {
readingTime: ({ minutes }) => `${minutes} min read`, readingTime: ({ minutes }) => `Se lee en ${minutes} min`,
}, },
}, },
pages: { pages: {
rss: { rss: {
recentNotes: "Notas recientes", recentNotes: "Notas recientes",
lastFewNotes: ({ count }) => `Últimás ${count} notas`, lastFewNotes: ({ count }) => `Últimas ${count} notas`,
}, },
error: { error: {
title: "No se encontró.", title: "No se ha encontrado.",
notFound: "Esta página es privada o no existe.", notFound: "Esta página es privada o no existe.",
home: "Regresar a la página principal", home: "Regresa a la página principal",
}, },
folderContent: { folderContent: {
folder: "Carpeta", folder: "Carpeta",
@ -78,7 +78,7 @@ export default {
itemsUnderTag: ({ count }) => itemsUnderTag: ({ count }) =>
count === 1 ? "1 artículo con esta etiqueta." : `${count} artículos con esta etiqueta.`, count === 1 ? "1 artículo con esta etiqueta." : `${count} artículos con esta etiqueta.`,
showingFirst: ({ count }) => `Mostrando las primeras ${count} etiquetas.`, showingFirst: ({ count }) => `Mostrando las primeras ${count} etiquetas.`,
totalTags: ({ count }) => `Se encontraron ${count} etiquetas en total.`, totalTags: ({ count }) => `Se han encontrado ${count} etiquetas en total.`,
}, },
}, },
} as const satisfies Translation } as const satisfies Translation

View File

@ -54,7 +54,7 @@ export default {
title: "Зміст", title: "Зміст",
}, },
contentMeta: { contentMeta: {
readingTime: ({ minutes }) => `${minutes} min read`, readingTime: ({ minutes }) => `${minutes} хв читання`,
}, },
}, },
pages: { pages: {
@ -68,17 +68,17 @@ export default {
home: "Повернутися на головну сторінку", home: "Повернутися на головну сторінку",
}, },
folderContent: { folderContent: {
folder: "Папка", folder: "Тека",
itemsUnderFolder: ({ count }) => itemsUnderFolder: ({ count }) =>
count === 1 ? "У цій папці 1 елемент." : `Елементів у цій папці: ${count}.`, count === 1 ? "У цій теці 1 елемент." : `Елементів у цій теці: ${count}.`,
}, },
tagContent: { tagContent: {
tag: "Тег", tag: "Мітка",
tagIndex: "Індекс тегу", tagIndex: "Індекс мітки",
itemsUnderTag: ({ count }) => itemsUnderTag: ({ count }) =>
count === 1 ? "1 елемент з цим тегом." : `Елементів з цим тегом: ${count}.`, count === 1 ? "1 елемент з цією міткою." : `Елементів з цією міткою: ${count}.`,
showingFirst: ({ count }) => `Показ перших ${count} тегів.`, showingFirst: ({ count }) => `Показ перших ${count} міток.`,
totalTags: ({ count }) => `Всього знайдено тегів: ${count}.`, totalTags: ({ count }) => `Всього знайдено міток: ${count}.`,
}, },
}, },
} as const satisfies Translation } as const satisfies Translation

View File

@ -3,7 +3,7 @@ import { QuartzFilterPlugin } from "../types"
export const RemoveDrafts: QuartzFilterPlugin<{}> = () => ({ export const RemoveDrafts: QuartzFilterPlugin<{}> = () => ({
name: "RemoveDrafts", name: "RemoveDrafts",
shouldPublish(_ctx, [_tree, vfile]) { shouldPublish(_ctx, [_tree, vfile]) {
const draftFlag: boolean = vfile.data?.frontmatter?.draft ?? false const draftFlag: boolean = vfile.data?.frontmatter?.draft || false
return !draftFlag return !draftFlag
}, },
}) })