@docsector/docsector-reader 1.3.0 → 1.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -47,6 +47,7 @@ Transform Markdown content into beautiful, navigable documentation sites — wit
47
47
  - 📱 **Responsive** — Mobile-friendly with collapsible sidebar and drawers
48
48
  - 🏷️ **Status Badges** — Mark pages as `done`, `draft`, or `empty` with visual indicators
49
49
  - ✏️ **Edit on GitHub** — Direct links to edit pages on your repository
50
+ - 🧭 **Robust Edit Link Mapping** — Normalizes route paths (including trailing slashes) into `page.subpage.locale.md` source files for reliable GitHub edit URLs
50
51
  - 📅 **Last Updated Date** — Automatic per-page "last updated" date from git commit history, locale-formatted
51
52
  - 📊 **Translation Progress** — Automatic translation percentage based on header coverage
52
53
  - 🧠 **Markdown Negotiation** — Responds with Markdown when clients send `Accept: text/markdown`, while keeping HTML as browser default
package/bin/docsector.js CHANGED
@@ -23,7 +23,7 @@ const packageRoot = resolve(__dirname, '..')
23
23
  const args = process.argv.slice(2)
24
24
  const command = args[0]
25
25
 
26
- const VERSION = '1.3.0'
26
+ const VERSION = '1.3.1'
27
27
 
28
28
  const HELP = `
29
29
  Docsector Reader v${VERSION}
@@ -24,7 +24,7 @@ export default {
24
24
  discussions: 'https://github.com/docsector/docsector-reader/discussions',
25
25
  chat: null, // e.g., Discord/Slack invite URL
26
26
  email: null, // e.g., 'mailto:contact@example.com'
27
- changelog: '/changelog',
27
+ changelog: 'https://github.com/docsector/docsector-reader/releases',
28
28
  roadmap: null, // e.g., external roadmap URL
29
29
  sponsor: null, // e.g., GitHub Sponsors URL
30
30
  explore: null // e.g., URL to explore related repos
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@docsector/docsector-reader",
3
- "version": "1.3.0",
3
+ "version": "1.3.1",
4
4
  "description": "A documentation rendering engine built with Vue 3, Quasar v2 and Vite. Transform Markdown into beautiful, navigable documentation sites.",
5
5
  "productName": "Docsector Reader",
6
6
  "author": "Rodrigo de Araujo Vieira",
@@ -12,11 +12,34 @@ const route = useRoute()
12
12
  const router = useRouter()
13
13
  const { t, locale, availableLocales, te, tm } = useI18n()
14
14
 
15
- const base = docsectorConfig.github?.editBaseUrl || ''
15
+ function normalizeEditBaseUrl (url = '') {
16
+ const normalized = String(url).trim().replace(/\/+$/, '')
17
+ return normalized.replace(/(github\.com\/[^/]+\/[^/]+)\/(blob|tree)\//, '$1/edit/')
18
+ }
19
+
20
+ const base = normalizeEditBaseUrl(docsectorConfig.github?.editBaseUrl || '')
21
+
22
+ function routePathToSourcePath (path = '') {
23
+ const cleanPath = String(path)
24
+ .replace(/\/index\.html$/, '')
25
+ .replace(/\/+$/, '')
26
+
27
+ if (cleanPath === '' || cleanPath === '/') {
28
+ return '/Homepage'
29
+ }
30
+
31
+ const segments = cleanPath.replace(/^\//, '').split('/').filter(Boolean)
32
+ if (segments.length < 2) {
33
+ return `/${segments.join('/')}`
34
+ }
35
+
36
+ const subpage = segments.pop()
37
+ return `/${segments.join('/')}.${subpage}`
38
+ }
16
39
 
17
40
  const status = computed(() => route.meta.status)
18
41
  const URL = computed(() => {
19
- const path = route.path.replace(/\/([^/]*)$/, '.$1')
42
+ const path = routePathToSourcePath(route.path)
20
43
  return `${base}${path}.${locale.value}.md`
21
44
  })
22
45
  const color = computed(() => {