picocms / Pico

Pico is a stupidly simple, blazing fast, flat file CMS.
http://picocms.org/
MIT License
3.83k stars 617 forks source link

google custom search and picocoms #407

Closed meentix closed 6 years ago

meentix commented 6 years ago

Hey,

Ive tried to implement a google custom search on my page. But after Ive inserted the code from google nothing is shown on my page. Maybe the problem is that the code which Ive inserted in the search.md is modified automatically by pico / markdown? The last line is

<gcse:search></gcse:search>

but when I look at the source code it is changed to:

<search></search>

I think thats not correct? Why does this happen :-/

PhrozenByte commented 6 years ago

Parsedown, the 3rd-party Markdown parser Pico uses, unfortunately has some known limitations regarding custom HTML elements. Anyway, since a search page is rather part of a website's structure than a website's contents, I recommend moving Google's code to a Twig template. Simply create a search.twig with the code of Google's custom search in your theme's directory and create a search.md with Template: search in its YAML Frontmatter.

stale[bot] commented 6 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in two days if no further activity occurs. Thank you for your contributions! :+1: