Open mrleblanc101 opened 1 year ago
My bad, the search on the v2 website also index the content of the v1 website. So clicking the link redirected me to the v1 website... Odd choice.
The createdAt
and updatedAt
variables does not exist on v2.
Why tho ?
Those fields anyway were misleading as they were based on file creation date, which changes any time we download/clone the repo. So, better to use manually added fields. Or you can use some VS Code extension or Obsidian plugin to automatically add/update those fields whenever you actually make changes to the file.
In fact, createdAt
can't be trusted. (https://stackoverflow.com/questions/62039244/does-git-store-the-file-creation-time).
However, we can add the updatedAt
easily thanks to unstorage.
And you can manually add a createdAt
using frontMatter
Hang on, but what is the status of this?
The documentation mentions createdAt
and updatedAt
fields will be auto-generated. If this is not the case, the the docs should be updated accordingly.
So which one is it - do those fields get generated or not? :)
Hang on, but what is the status of this?
The documentation mentions
createdAt
andupdatedAt
fields will be auto-generated. If this is not the case, the the docs should be updated accordingly.So which one is it - do those fields get generated or not? :)
Where in the documentation?
Where in the documentation?
They probably got there by googling and ended up at the v1 docs which happened to me: https://content.nuxtjs.org/v1/getting-started/writing
In Nuxt v3, I am currently not able to provide any frontmatter attributes which are then also included. Is this by design? I would like to be able to search for tags as well and be able to display creationDate (manually added in frontmatter) in the results.
@EtzBetz Hi, any frontmatter attribute you type in the md file is automatically generated as a key in the content code. You can simply display it inside the current file itself or the Vue page where you are fetching the file.
@ManasMadrecha Oh, I didn't really specify, but I thought it was obvious from the thread. I am talking about search. In search, by default, only title and the content itself are searched.
Environment
Darwin
v16.14.0
3.0.0
1.0.0
yarn@1.22.19
vite
srcDir
,modules
,colorMode
,postcss
,vite
@nuxtjs/tailwindcss@6.2.0
,@nuxtjs/color-mode@3.2.0
,@nuxt/content@2.3.0
Build Modules:
-
Reproduction
Coming
Describe the bug
I want to display the createAt from my blog post and sort my posts by date creation date, but I don't see the![Capture d’écran, le 2023-01-05 à 22 53 50](https://user-images.githubusercontent.com/17392251/210926836-411fa366-fb5a-4e94-91a1-de132787570c.png)
createdAt
orupdatedAt
fields in my data unlike what the documentation website says here.Additional context
No response
Logs
No response