estruyf / vscode-front-matter

Front Matter is a CMS running straight in Visual Studio Code. Can be used with static site generators like Hugo, Jekyll, Hexo, NextJs, Gatsby, and many more...
https://frontmatter.codes
MIT License
1.86k stars 70 forks source link

Tag list to select #775

Closed bksubhuti closed 4 months ago

bksubhuti commented 4 months ago

I imported my tags and categories but I don't see a list that pops up as I type. That would be very useful.

estruyf commented 4 months ago

@bksubhuti have you configured your content type to use the tags field? Once imported and using the tags field, you will get a dropdown in which you can type ahead, select, or add new tags.

https://frontmatter.codes/docs/content-creation/fields#tags

bksubhuti commented 4 months ago

I read that this feature is working The tags field allows you to create or use tags from your .frontmatter/database/taxonomyDb.json file (by default, none existing). When adding a tag which does not yet exist, you will have the option to create it. I'm using hugo and I did select hugo. I'm not sure about "content type" you ask about

bksubhuti commented 4 months ago

image

What does this do?

bksubhuti commented 4 months ago

I'm not able to find that content type again. I think something does not work. I guess you already have this feature. When i initialized the project.. after import tags.. it didn't show the last check box step. It is still pretty cool and can do useful things.. the tags is what I really need it for though.

estruyf commented 4 months ago

Content types are a way to define the structure of your content. Each content type can have its own set of fields.

For instance, a page can have a title, description, slug. That is something you can define in a content type (configured in the frontmatter.json file).

The image you shared shows that there is a mismatch between the default content type and your fields in the page. This happens most of the time during configuration of new projects.

You have the option to:

I suggest going for the first option, and override the default content type. Once you've done that, you can see that in your frontmatter.json file, a frontMatter.taxonomy.contentTypes setting has been configured with the fields you use in your content.

Make sure that your tags field is using type tags:

{
  "title": "Tags",
  "name": "tags",
  "type": "tags"
}
bksubhuti commented 4 months ago

it was already there

{
  "$schema": "https://frontmatter.codes/frontmatter.schema.json",
  "frontMatter.taxonomy.contentTypes": [
    {
      "name": "default",
      "pageBundle": false,
      "previewPath": null,
      "fields": [
        {
          "title": "title",
          "name": "title",
          "type": "string"
        },
        {
          "title": "date",
          "name": "date",
          "type": "datetime"
        },
        {
          "title": "categories",
          "name": "categories",
          "type": "categories"
        },
        {
          "title": "tags",
          "name": "tags",
          "type": "tags"
        },
        {
          "title": "authors",
          "name": "authors",
          "type": "choice",
          "choices": [
            "bksubhuti"
          ]
        },
        {
          "title": "image",
          "name": "image",
          "type": "image"
        },
        {
          "title": "featured_image",
          "name": "featured_image",
          "type": "image"
        },
        {
          "title": "description",
          "name": "description",
          "type": "string"
        },
        {
          "title": "draft",
          "name": "draft",
          "type": "draft"
        },
        {
          "title": "type",
          "name": "type",
          "type": "string"
        }
      ]
    }
  ]
}
bksubhuti commented 4 months ago

I can add tags with FM but I'm expecting a popup to select existing tags.

estruyf commented 4 months ago

Yes, that is the default content type you get when initializing the project.

I tested out your website, and it seems to work fine on my end:

image

image

I can add tags with FM but I'm expecting a popup to select existing tags.

If you click on the pick your tags input, you will see a dropdown with all your tags.

bksubhuti commented 4 months ago

My project is here.. if you want to debug. oh. you got the project already https://github.com/dhammacakka/americanmonk/ hmm..

did I need to add special GUI things I saw an option for (that I didn't understand) I'm also using the standard version.. your video said to use the beta

bksubhuti commented 4 months ago

I also have "pick your tags" but nothing shows up when I type. there is no button to click to get the pop up. image

bksubhuti commented 4 months ago

maybe I didn't setup the FM correctly.
Maybe I should start again. How to delete the stuff that makes it known to fm? It seems that I initialize my project last. I also didn't select the github.

estruyf commented 4 months ago

I see nothing wrong, UI shows up correctly.

There is no button to click on, you should get the dropdown options when clicking in the input field.

bksubhuti commented 4 months ago

i click in the field and nothing happens.. nothing happens when I type.

How do I start over? I deleted the json file but it didn't do anything to prompt me to start again. I will delete the extension and try install again.

bksubhuti commented 4 months ago

Peek 2024-03-15 21-58

estruyf commented 4 months ago

Ah! Now I see it, something is wrong with the mapping of the taxonomydb.json file. So it is a problem with the extension, I believe.

Can you provide more information about your environment? Which OS are you using?

bksubhuti commented 4 months ago

uninstalling and installing again.. did not really do anything.. it was a quick download too. It didn't really uninstall.

bksubhuti commented 4 months ago

I'm using linux Mint latest. Most of the project is already uploaded with the link i gave you. https://github.com/dhammacakka/americanmonk/

hopefully you found the right one.

extensions installed

image

System:
  Kernel: 5.15.0-100-generic x86_64 bits: 64 compiler: gcc v: 11.4.0 Desktop: Cinnamon 6.0.4
    tk: GTK 3.24.33 wm: muffin vt: 7 dm: LightDM 1.30.0 Distro: Linux Mint 21.3 Virginia
    base: Ubuntu 22.04 jammy
Machine:
  Type: Laptop System: LENOVO product: 82KT v: IdeaPad 3 14ALC6 serial: <superuser required>
    Chassis: type: 10 v: IdeaPad 3 14ALC6 serial: <superuser required>
  Mobo: LENOVO model: LNVNB161216 v: SDK0T76465WIN serial: <superuser required> UEFI: LENOVO
    v: GLCN52WW date: 12/09/2022
Battery:
  ID-1: BAT0 charge: 34.4 Wh (84.9%) condition: 40.5/45.0 Wh (90.1%) volts: 12.4 min: 11.1
    model: SMP L20M3PF0 type: Li-poly serial: <filter> status: Charging cycles: 725
CPU:
  Info: 6-core model: AMD Ryzen 5 5500U with Radeon Graphics bits: 64 type: MT MCP smt: enabled
    arch: Zen 2 rev: 1 cache: L1: 384 KiB L2: 3 MiB L3: 8 MiB
  Speed (MHz): avg: 1940 high: 3793 min/max: 1400/2100 boost: enabled cores: 1: 2179 2: 3006
    3: 1645 4: 1530 5: 1866 6: 3793 7: 1796 8: 1600 9: 1527 10: 1549 11: 1397 12: 1397
    bogomips: 50303
  Flags: avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3 svm
Graphics:
  Device-1: AMD Lucienne vendor: Lenovo driver: amdgpu v: 6.2.4 pcie: speed: 8 GT/s lanes: 16
    ports: active: eDP-1 empty: HDMI-A-1 bus-ID: 03:00.0 chip-ID: 1002:164c class-ID: 0300
  Device-2: Chicony Integrated Camera type: USB driver: uvcvideo bus-ID: 1-3:2
    chip-ID: 04f2:b725 class-ID: fe01 serial: <filter>
  Display: x11 server: X.Org v: 1.21.1.4 driver: X: loaded: amdgpu,ati
    unloaded: fbdev,modesetting,vesa gpu: amdgpu display-ID: :0 screens: 1
  Screen-1: 0 s-res: 1920x1080 s-dpi: 96 s-size: 508x285mm (20.0x11.2") s-diag: 582mm (22.9")
  Monitor-1: eDP res: 1920x1080 hz: 60 dpi: 158 size: 309x173mm (12.2x6.8") diag: 354mm (13.9")
  OpenGL: renderer: AMD Radeon Graphics (renoir LLVM 16.0.6 DRM 3.54 5.15.0-100-generic)
    v: 4.6 Mesa 23.2.0-devel direct render: Yes
Audio:
  Device-1: AMD Renoir Radeon High Definition Audio vendor: Lenovo driver: snd_hda_intel v: kernel
    pcie: speed: 8 GT/s lanes: 16 bus-ID: 03:00.1 chip-ID: 1002:1637 class-ID: 0403
  Device-2: AMD Raven/Raven2/FireFlight/Renoir Audio Processor vendor: Lenovo driver: N/A pcie:
    speed: 8 GT/s lanes: 16 bus-ID: 03:00.5 chip-ID: 1022:15e2 class-ID: 0480
  Device-3: AMD Family 17h HD Audio vendor: Lenovo driver: snd_hda_intel v: kernel pcie:
    speed: 8 GT/s lanes: 16 bus-ID: 03:00.6 chip-ID: 1022:15e3 class-ID: 0403
  Sound Server-1: ALSA v: k5.15.0-100-generic running: yes
  Sound Server-2: PulseAudio v: 15.99.1 running: yes
  Sound Server-3: PipeWire v: 0.3.48 running: yes
Network:
  Device-1: Realtek RTL8822CE 802.11ac PCIe Wireless Network Adapter vendor: Lenovo
    driver: rtw_8822ce v: N/A pcie: speed: 2.5 GT/s lanes: 1 port: 2000 bus-ID: 01:00.0
    chip-ID: 10ec:c822 class-ID: 0280
  IF: wlp1s0 state: up mac: <filter>
Bluetooth:
  Device-1: Realtek Bluetooth Radio type: USB driver: btusb v: 0.8 bus-ID: 3-4:4
    chip-ID: 0bda:c123 class-ID: e001 serial: <filter>
  Report: hciconfig ID: hci0 rfk-id: 7 state: up address: <filter> bt-v: 3.0 lmp-v: 5.1
    sub-v: 6d7d hci-v: 5.1 rev: 19b7
Drives:
  Local Storage: total: 238.47 GiB used: 128.55 GiB (53.9%)
  ID-1: /dev/nvme0n1 vendor: Samsung model: MZALQ256HBJD-00BL2 size: 238.47 GiB speed: 31.6 Gb/s
    lanes: 4 type: SSD serial: <filter> rev: 7L2QFXM7 temp: 33.9 C scheme: GPT
Partition:
  ID-1: / size: 96.09 GiB used: 81.96 GiB (85.3%) fs: ext4 dev: /dev/nvme0n1p6
  ID-2: /boot/efi size: 256 MiB used: 41.2 MiB (16.1%) fs: vfat dev: /dev/nvme0n1p1
Swap:
  ID-1: swap-1 type: file size: 2 GiB used: 15.8 MiB (0.8%) priority: -2 file: /swapfile
USB:
  Hub-1: 1-0:1 info: Hi-speed hub with single TT ports: 4 rev: 2.0 speed: 480 Mb/s
    chip-ID: 1d6b:0002 class-ID: 0900
  Device-1: 1-3:2 info: Chicony Integrated Camera type: Video driver: uvcvideo interfaces: 3
    rev: 2.0 speed: 480 Mb/s power: 500mA chip-ID: 04f2:b725 class-ID: fe01 serial: <filter>
  Hub-2: 2-0:1 info: Super-speed hub ports: 2 rev: 3.1 speed: 10 Gb/s chip-ID: 1d6b:0003
    class-ID: 0900
  Hub-3: 3-0:1 info: Hi-speed hub with single TT ports: 4 rev: 2.0 speed: 480 Mb/s
    chip-ID: 1d6b:0002 class-ID: 0900
  Device-1: 3-1:6 info: Logitech M105 Optical Mouse type: Mouse driver: hid-generic,usbhid
    interfaces: 1 rev: 2.0 speed: 1.5 Mb/s power: 100mA chip-ID: 046d:c077 class-ID: 0301
  Device-2: 3-3:3 info: Elan Micro ELAN:Fingerprint type: <vendor specific> driver: N/A
    interfaces: 1 rev: 2.0 speed: 12 Mb/s power: 100mA chip-ID: 04f3:0c4b class-ID: 0000
  Device-3: 3-4:4 info: Realtek Bluetooth Radio type: Bluetooth driver: btusb interfaces: 2
    rev: 1.0 speed: 12 Mb/s power: 500mA chip-ID: 0bda:c123 class-ID: e001 serial: <filter>
  Hub-4: 4-0:1 info: Super-speed hub ports: 2 rev: 3.1 speed: 10 Gb/s chip-ID: 1d6b:0003
    class-ID: 0900
Sensors:
  System Temperatures: cpu: N/A mobo: N/A gpu: amdgpu temp: 43.0 C
  Fan Speeds (RPM): N/A
Repos:
  Packages: 3138 apt: 3131 flatpak: 7
  No active apt repos in: /etc/apt/sources.list
  Active apt repos in: /etc/apt/sources.list.d/amdgpu-proprietary.list
    1: deb https: //repo.radeon.com/amdgpu/23.20/amdgpu/ubuntu jammy proprietary
  Active apt repos in: /etc/apt/sources.list.d/amdgpu.list
    1: deb https: //repo.radeon.com/amdgpu/23.20/amdgpu/ubuntu jammy main
  Active apt repos in: /etc/apt/sources.list.d/google-chrome.list
    1: deb [arch=amd64] https: //dl.google.com/linux/chrome/deb/ stable main
  Active apt repos in: /etc/apt/sources.list.d/mkusb-ppa-jammy.list
    1: deb [signed-by=/etc/apt/keyrings/mkusb-ppa-jammy.gpg] https: //ppa.launchpadcontent.net/mkusb/ppa/ubuntu jammy main
  Active apt repos in: /etc/apt/sources.list.d/official-package-repositories.list
    1: deb http: //packages.linuxmint.com virginia main upstream import backport
    2: deb https: //mirrors.ipserverone.com/ubuntu jammy main restricted universe multiverse
    3: deb https: //mirrors.ipserverone.com/ubuntu jammy-updates main restricted universe multiverse
    4: deb https: //mirrors.ipserverone.com/ubuntu jammy-backports main restricted universe multiverse
    5: deb http: //security.ubuntu.com/ubuntu/ jammy-security main restricted universe multiverse
  Active apt repos in: /etc/apt/sources.list.d/protonvpn-stable.list
    1: deb [arch="all", signed-by=/usr/share/keyrings/protonvpn-stable-archive-keyring.gpg] https: //repo.protonvpn.com/debian stable main
  Active apt repos in: /etc/apt/sources.list.d/rocm.list
    1: deb [arch=amd64] https: //repo.radeon.com/amdgpu/23.20/rocm/apt/5.7 jammy main
  Active apt repos in: /etc/apt/sources.list.d/vivaldi.list
    1: deb [arch=amd64] https: //repo.vivaldi.com/stable/deb/ stable main
  Active apt repos in: /etc/apt/sources.list.d/vscode.list
    1: deb [arch=amd64,arm64,armhf] http: //packages.microsoft.com/repos/code stable main
Info:
  Processes: 377 Uptime: 8h 23m wakeups: 6 Memory: 9.55 GiB used: 5.08 GiB (53.2%) Init: systemd
  v: 249 runlevel: 5 Compilers: gcc: 11.4.0 alt: 11/12 clang: 14.0.0-1ubuntu1.1 Client: Cinnamon
  v: 6.0.4 inxi: 3.3.13
bksubhuti commented 4 months ago

image

estruyf commented 4 months ago

Can you run the "front matter: import tags and categories" command again?

If it worked, it should have created the new taxonomydb.json file with your entries in it.

bksubhuti commented 4 months ago

Like I said.. I want to start all over again.. rather than try to fix it. But I don't know how to start fresh. I uninstalled and reinstalled. I deleted the json file but it generated a new one.

I don't know how to get back to the initialization screen again.. not sure how to do that. Let me know how to start fresh.. what to delete. Usually that is the quickest way.

Peek 2024-03-15 22-09

estruyf commented 4 months ago

You will just have to delete the files that were created during the setup. As you're using git, you can quickly revive them.

Manually:

Remove the frontmatter.json file and the .frontmatter folder from your project. Restart VSCode and you can start again.

bksubhuti commented 4 months ago

I found taxonomy db json and it looks like it is empty. However, not sure the dashboard thinks it is empty.

bksubhuti commented 4 months ago

okay will try again

estruyf commented 4 months ago

I found taxonomy db json and it looks like it is empty. However, not sure the dashboard thinks it is empty.

I know, that is why you only need to run the command to import again.

Dashboard just shows the values from the file.

bksubhuti commented 4 months ago

I deleted the folder and the json on the root. IT still "knows" my project and didn't prompt me for initialization like the first time I added the extension.

estruyf commented 4 months ago

Restart VSCode in order to get it.

bksubhuti commented 4 months ago

i did.. it still knows my content folders.everything.

estruyf commented 4 months ago

In that case, the files are not deleted.

I'll do the configuration later for you and push a PR.

bksubhuti commented 4 months ago

okay.. i got it to reset and it worked. I think the issue was that i didn't originally choose (or see) initialize project First and then later did "initialize" Later I did "initialize project" but then it must have been too late. So it is is a ux order of operations issue.

To get the full reset.. I had to uninstall , reload vsc. delete the files and reload vsc again. Then ... i could install and it worked. It must have been in memory or something. but I did restart vsc a few times..

in any case.. it works now.. and I bet you can reproduce this error by not initializing first.

bksubhuti commented 4 months ago

That last step was not a clickable option when I went to it. (show dash). But all works well. The tags popup which works will help me stop repeating or variating my tags. I just came over from WP a month ago . So I still have some clean up to do. I appreciate your efforts in this extension (and your support just now). It is sri lanka.. time for bed.

estruyf commented 4 months ago

Great to hear. Have a good night.

bksubhuti commented 4 months ago

I appreciate your help. If you can duplicate the issue, let me know.. If not, I'll try to duplicate the issue later today.
I think you should call it "Activate Front Matter Extension" instead of initialize.

I think should not enable anything until that step is finished. That should solve all problems. I appreciate your help. I'll try to have more feature requests later. (Even though this was already implemented). Great work and passion for the project.!