Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add hooks #50

Merged
merged 2 commits into from
Sep 28, 2020
Merged

Add hooks #50

merged 2 commits into from
Sep 28, 2020

Conversation

razonyang
Copy link
Contributor

@razonyang razonyang commented Sep 27, 2020

Hooks provide a way to add code on a page. For example(search engine webmaster verification: Google, Bing, Baidu etc):

<meta name="google-site-verification" content="xxx" />

This way is more flexible than define a parameter for each search engines.

@onweru
Copy link
Collaborator

onweru commented Sep 28, 2020

Interesting idea. It does, however, introduce the same problem described by @rootwork in #28.

@razonyang
Copy link
Contributor Author

razonyang commented Sep 28, 2020

I don't think there will be such a problem. I create my own hooks in layouts/partials/hooks/*(not themes/hugo-clarity/layouts/partials/hooks/*), so the theme can be a git submodule, and we can also track modifications, because we create and override these files not modify them.

Partial Template Lookup Order

@onweru
Copy link
Collaborator

onweru commented Sep 28, 2020

Fair enough, could you add comments on the hook files placeholders e.g layouts/partials/hooks/body-end.html, indicating that the contents of those files should only be overridden (i.e never edited directly)?

@razonyang
Copy link
Contributor Author

I documented this in README.md.

@onweru onweru merged commit 7a32c6a into chipzoller:master Sep 28, 2020
@razonyang razonyang deleted the feature-hooks branch September 29, 2020 04:05
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants