mrvautin / squido

A dead simple static HTML website builder which can be hosted anywhere for super fast websites and very little effort
https://squido.markmoffat.com/
MIT License
63 stars 6 forks source link

Is the search function available by default? #21

Open ghost opened 1 year ago

ghost commented 1 year ago

I can see a search input in docs but I was expecting this search functionality would come built-in in squido, I cannot see the plugin search.js anywhere... So it could be possible to have this functionality by default?Thanks in advance

mrvautin commented 1 year ago

I don't think it really fits built-in and should be added as a plugin if needed. The docs Github repo is here.

You can see the search.js plugin file + the frontend site.js

ghost commented 1 year ago

How can I get the search input? I've put search.js into my source/plugins/ directory and added the:

plugins: [
      {
        name: 'search',
        options: {}
      }
    ]

but I cannot see it still. I guess it's missing some html somewhere to make it show but I don't know how...

Also, which would be the plugin options?

PS: I'm not a developer and BTW the project aims to be dead simple and to not need to know about developing to get it up and running, but I think docs should be little improved to help get what you see in the demo/example page IMHO. Don't get me wrong (maybe my english doesn't help) I love your work and appreciate it but I felt some things were tricky to get it working by someone who doesn't have enough developing skills. I've test some other static site-generators and yours is what's best for my needs, it's simple, beautiful and customizable, but I think it should be better if I could follow a guide on how to customize it. I hope you understand me. Thanks

EDIT: I get it now, the docs repo you linked was a template lol I didn't realise until I've been reading your web in depth, sorry.

mrvautin commented 1 year ago

You need to add the data so the frontend can read it. Maybe you are missing this line from your layout.hbs: https://github.com/mrvautin/squido-docs/blob/e35760385951d73dc36f006f2d03aa9770ce83ce/source/layouts/layout.hbs#L61

Also, which would be the plugin options?

The plugin options can be left blank how you have them.

PS: I'm not a developer and BTW the project aims to be dead simple and to not need to know about developing to get it up and running, but I think docs should be little improved to help get what you see in the demo/example page IMHO. Don't get me wrong (maybe my english doesn't help) I love your work and appreciate it but I felt some things were tricky to get it working by someone who doesn't have enough developing skills. I've test some other static site-generators and yours is what's best for my needs, it's simple, beautiful and customizable, but I think it should be better if I could follow a guide on how to customize it. I hope you understand me. Thanks

This is good feedback. I'm a developer and don't know where the gaps in the docs are until I'm told.

If you have some time would you be able to details the steps where you got stuck? I will then update the docs for the next person.

ghost commented 1 year ago

I think there's some ambiguity. I expected to get what I saw in the demo page, but until I get templates page I didn't realize the demo page (squido-docs) was a template for squido. At this point, I belived squido was just what the template squido-docs provides you. I've to say that the templates page is very well designed and self-explanatory. Maybe a brief text in github's page explaining what you see in the squido-docs is just a piece of what squido can provide you and telling is just a template of many? I don't know :)

So far I have found this problem:

First time I uploaded a markdown I get this on console,

/usr/lib/node_modules/squido/lib/common.js:55
    if(meta.permalink.slice(-1) !== '/'){
                      ^

Yeah, if you read carefully posts section you get the permalink's required (my fault), but then you get this:

/usr/lib/node_modules/squido/node_modules/feed/lib/atom1.js:58
      updated: item.date.toISOString()
                         ^

so maybe point out date meta is also mandatory.

I've found this also but I should open an issue for this: adding tags meta I realized that If I edit post.hbs, page.hbs, 404.hbs or tag.hbs then tags in /tag/<tag_name> multiplies (except if I edit index.hbs), like shown here:

https://user-images.githubusercontent.com/34288954/231145224-871ff4a1-3f88-4ff7-afdb-1b50554b29a7.mp4

And if you add a new tag to an existing markdown you have to restart squido to see applied changes, otherwise if you click to that newly created tag it shows a 404 not found...I dunno if that's fixable.

mrvautin commented 1 year ago

I've found this also but I should open an issue for this: adding tags meta I realized that If I edit post.hbs, page.hbs, 404.hbs or tag.hbs then tags in /tag/ multiplies (except if I edit index.hbs), like shown here:

I think this is due to not having the -c flag (Clean build dir) on your squido command. So the command in your terminal would be squido serve -w -b -c. Maybe -c should be enabled by default. I can't recall exactly why but maybe I added so the build/watch was faster.

mrvautin commented 1 year ago

First time I uploaded a markdown I get this on console, /usr/lib/node_modules/squido/lib/common.js:55 if(meta.permalink.slice(-1) !== '/'){ ^ Yeah, if you read carefully posts section you get the permalink's required (my fault), but then you get this: /usr/lib/node_modules/squido/node_modules/feed/lib/atom1.js:58 updated: item.date.toISOString() ^ so maybe point out date meta is also mandatory.

Agreed. The error handling is not good enough around this bit. I will add something more helpful.

ghost commented 1 year ago

I've found this also but I should open an issue for this: adding tags meta I realized that If I edit post.hbs, page.hbs, 404.hbs or tag.hbs then tags in /tag/ multiplies (except if I edit index.hbs), like shown here:

I think this is due to not having the -c flag (Clean build dir) on your squido command. So the command in your terminal would be squido serve -w -b -c. Maybe -c should be enabled by default. I can't recall exactly why but maybe I added so the build/watch was faster.

I've been using -bwc all the time:

https://user-images.githubusercontent.com/34288954/231400429-ebaa7dc5-f8f7-4a05-baaf-2581ed0f3537.mp4

ghost commented 1 year ago

Regarding search. Could the search result in the dropbox layer follow the anchor? I mean, if I click on a result, it loads only the markdown document where the result is, but not the specific anchor where really it is. The expected behaviour would be the same as when you click on TOC sidebar's on the right.