@compiiile/compiiile 2.14.0 → 2.14.2

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.
@@ -105,11 +105,11 @@
105
105
  return this.fileIndex > -1 ? this.$context.fileList[this.fileIndex] : null
106
106
  },
107
107
  fileSiblings() {
108
- let visibleFiles = this.$context.fileList
109
- if(!this.file.meta.hidden){
110
- visibleFiles = visibleFiles.filter(file => !file.meta.hidden)
111
- }
112
- const newIndex = visibleFiles.findIndex((file) => file.uuid === this.name)
108
+ let visibleFiles = this.$context.fileList
109
+ if (this.file && !this.file.meta.hidden) {
110
+ visibleFiles = visibleFiles.filter((file) => !file.meta.hidden)
111
+ }
112
+ const newIndex = visibleFiles.findIndex((file) => file.uuid === this.name)
113
113
 
114
114
  return {
115
115
  prev: visibleFiles[newIndex - 1] ?? null,
@@ -201,7 +201,7 @@
201
201
  margin: 20px auto;
202
202
  display: block;
203
203
  object-fit: contain;
204
- height: auto;
204
+ height: auto;
205
205
  }
206
206
 
207
207
  a {
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <li class="nav-list-item no-wrap" v-if="!route.meta.hidden">
2
+ <li v-if="isVisible(item)" class="nav-list-item no-wrap">
3
3
  <template v-if="item.isDirectory">
4
4
  <svg
5
5
  class="directory-icon"
@@ -156,6 +156,21 @@
156
156
  route() {
157
157
  return this.$context.routeList.find((route) => route.name === this.item.uuid)
158
158
  }
159
+ },
160
+ methods: {
161
+ isVisible(item) {
162
+ if (!item.isDirectory) {
163
+ const route = this.$context.routeList.find((route) => route.name === item.uuid)
164
+ return !route.meta.hidden
165
+ }
166
+
167
+ return (
168
+ item.children.length > 0 &&
169
+ item.children.some((child) => {
170
+ return this.isVisible(child)
171
+ })
172
+ )
173
+ }
159
174
  }
160
175
  }
161
176
  </script>
@@ -9,7 +9,7 @@ import markdownConfig from "../markdownConfig.js"
9
9
  import { unemojify } from "node-emoji"
10
10
  import slugify from "slugify"
11
11
  import parseIgnore from "parse-gitignore"
12
- import { minimatch } from 'minimatch'
12
+ import { minimatch } from "minimatch"
13
13
 
14
14
  export default class {
15
15
  WORKSPACE_BASE_PATH = "c"
@@ -84,24 +84,25 @@ export default class {
84
84
  const filePath = path.join(directoryPath, file)
85
85
 
86
86
  try {
87
- const compiiileIgnoreFilePath = fs.readFileSync(path.join(process.env.COMPIIILE_SOURCE, ".compiiileignore"))
87
+ const compiiileIgnoreFilePath = fs.readFileSync(
88
+ path.join(process.env.COMPIIILE_SOURCE, ".compiiileignore")
89
+ )
88
90
  const compiiileIgnore = parseIgnore(compiiileIgnoreFilePath)
89
91
 
90
- const ignoreGlobs = compiiileIgnore.globs().filter(globType => globType.type === "ignore")
92
+ const ignoreGlobs = compiiileIgnore.globs().filter((globType) => globType.type === "ignore")
91
93
  const ignorePatterns = ignoreGlobs.reduce((patterns, currentIgnoreGlobItem) => {
92
94
  return [...patterns, ...currentIgnoreGlobItem.patterns]
93
95
  }, [])
94
96
 
95
- const isFilePathInIgnoredPatterns = ignorePatterns.some(pattern => minimatch(filePath, pattern))
97
+ const isFilePathInIgnoredPatterns = ignorePatterns.some((pattern) => minimatch(filePath, pattern))
96
98
 
97
- if(isFilePathInIgnoredPatterns){
99
+ if (isFilePathInIgnoredPatterns) {
98
100
  continue
99
101
  }
100
- } catch(e){
102
+ } catch (e) {
101
103
  // No .compiiileignore file found at the root
102
104
  }
103
105
 
104
-
105
106
  const isDirectory = fs.statSync(filePath).isDirectory()
106
107
  const uuid = uuidv4()
107
108
  const fileName = path.parse(filePath).name
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@compiiile/compiiile",
3
3
  "private": false,
4
- "version": "2.14.0",
4
+ "version": "2.14.2",
5
5
  "description": "The most convenient way to render a folder containing markdown files. Previewing and searching markdown files has never been that easy.",
6
6
  "author": "AlbanCrepel <alban.crepel@gmail.com>",
7
7
  "license": "GPL-3.0-only",