Should we add an author example to the docs?
See original GitHub issueJust curious if you would like to add an example of loading authors from separate files or perhaps adding truncated descriptions without needing to put in the <!-- more -->
comment? This is how we are accomplishing both:
hooks: {
'content:file:beforeInsert': async (document, database) => {
if (document.extension === '.md' && document.dir === '/blog/posts') {
const html = converter.makeHtml(document.text);
const description = truncate(html.replace(/(<([^>]+)>)/gi, ''), {
length: 260,
separator: /,?\.* +/
});
document.description = description;
const author = await database
.query(`/blog/authors/${document.authorId}`)
.fetch();
document.author = author;
}
}
}
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:7 (2 by maintainers)
Top Results From Across the Web
Defining authorship in your research paper - Author Services
Why does authorship matter? Authorship gives credit and implies accountability for published work, so there are academic, social and financial implications.
Read more >How to Co-Author and Peer Edit with Google Docs | Web Writing
This tutorial illustrates how to co-author and peer edit with Google Documents. You are welcome to freely share this guide with others (such...
Read more >Defining the Role of Authors and Contributors - ICMJE
The corresponding author is the one individual who takes primary responsibility for communication with the journal during the manuscript submission, peer-review ...
Read more >How to Decide the First Author and Corresponding Author in a ...
Choosing the first author and corresponding author in a scientific manuscript is easier when you know expectations. Get details here.
Read more >Add citations and a bibliography - Google Docs Editors Help
You can add citations and a bibliography to your Google Doc with these styles: MLA (8th ed.) APA (7th ed.) Chicago Author-Date (17th...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks for the idea @rwwagner90
Actually we try to keep nuxt/content docs as light as possible, having convention for directories and logic such as blog, authors, etc would be added to Docus (will be released soon).
I decided to put my authors in a JS file instead of markdown files, so that works for me now: