Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Add custom-head.html #755

Merged
merged 1 commit into from
Jun 21, 2022
Merged

Add custom-head.html #755

merged 1 commit into from
Jun 21, 2022

Conversation

ROCKTAKEY
Copy link
Contributor

Summary

Add empty file named partials/head/custom-head.html, which is "partial" called from partials/head/head.html

Basic example

<!-- Write custom head code in custom-head.html on user repo generated from doks-child-theme -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.1.1/css/all.min.css" integrity="sha512-KfkfwYDsLkIlwQp6LFnl8zNdLGxu9YAA1QvwINks4PhcElQSvqcyVLLD9aMhXd13uQjoXtEKNosOWaZqXgel0g==" crossorigin="anonymous" referrerpolicy="no-referrer" />

Motivation

doks-child-theme is hard to customize to import some external code like code from CDN.
Even it is not for deep custom, flexible head can be allowed, I think.

In addition, some user-adding tags in <head> cannot be categorized to existing "partials" in head, such as "favicons.html", "seo.html". So custom-head.html is useful for doks user (i.e. non-doks-child-theme user).

Checks

  • Read Create a Pull Request
  • Supports all screen sizes (if relevant)
  • Supports both light and dark mode (if relevant)
  • Passes npm run test

@h-enk
Copy link
Member

h-enk commented May 19, 2022

Nice one, thanks!

Like _custom.scss, the custom-head.html should then also be added to the doks-child-theme (as an override).

Will get back to you.

Copy link
Member

@h-enk h-enk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Super handy for e.g. quickly adding styles and scripts served from a CDN (if you want that — Doks recommends using npm as a single, central dependency manager though). Tested + verified.

@h-enk h-enk added this to the v0.5.0 milestone Jun 21, 2022
@h-enk h-enk merged commit f317cc7 into thuliteio:master Jun 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants