Skip to content

Commit

Permalink
feat: new puppeteer headless mode
Browse files Browse the repository at this point in the history
  • Loading branch information
CI committed Feb 20, 2024
1 parent 7067086 commit 67d10a0
Show file tree
Hide file tree
Showing 7 changed files with 191 additions and 176 deletions.
2 changes: 0 additions & 2 deletions mixins/ArticleAuthorsMixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ export default {
),
].flat()
// Prune the case differences
console.log('institutions: ', institutions)
institutions = [
...institutions
.map((s) => s.toLowerCase())
Expand All @@ -32,7 +31,6 @@ export default {
)
.values(),
]
console.log('institutions2: ', institutions)
return institutions
},
authorInformations() {
Expand Down
170 changes: 170 additions & 0 deletions modules/publio/lib/tsvToArticles/profiles (1).tsv

Large diffs are not rendered by default.

182 changes: 12 additions & 170 deletions modules/publio/lib/tsvToArticles/profiles.tsv

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion modules/publio/lib/tsvToArticles/tsvToArticles.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,11 @@ export default (options) => {
article_title,
issue: 'content/issues/' + slugify(issue) + '.md',
subissue: subissue || false,
published: published === 'TRUE',
published: true,
yt: yt || false,
start: start || false,
stop: stop || false,
language: 'English',
needDOI: needDOI === 'TRUE',
abstract: abstract.replace('|', ';'),
authors: [
Expand Down Expand Up @@ -107,6 +108,7 @@ export default (options) => {
highlight: highlight === 'TRUE',
}
})
console.log('json: ', json)

batchInsertArticles(json)
return options
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
"generate": "yarn prepare && nuxt generate",
"lint:js": "eslint --ext \".js,.vue\" --ignore-path .gitignore .",
"lint": "yarn lint:js",
"test": "jest"
"test": "jest",
"batchImport": "node ./modules/publio/lib/tsvToArticles/tsvToArticles.js"
},
"dependencies": {
"@mdi/font": "^6.2.95",
Expand Down
4 changes: 3 additions & 1 deletion pages/print/_slug/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -205,14 +205,16 @@ export default {
)[0]
const dirArticle = item.dir.slice(9)
console.log('item.dir: ', item.dir)
let articleNumber = 1
if (dirArticle.length > 1) {
console.log('item.dir.split', item.dir.split('/'))
articleNumber =
(
await $content('articles', { deep: true })
.where({
dir: { $contains: item.dir.split('/').at(-1) },
dir: { $contains: item.dir.split('/').pop() },
})
.only(['date', 'slug'])
.fetch()
Expand Down

0 comments on commit 67d10a0

Please sign in to comment.