mirror of
https://github.com/facebook/docusaurus.git
synced 2025-06-09 06:12:28 +02:00
feat(v2): add ability to set custom HTML in footer items (#1905)
This commit is contained in:
parent
2e58e839ee
commit
31d17c9d6b
2 changed files with 14 additions and 5 deletions
|
@ -9,6 +9,7 @@
|
||||||
- Refactor dark toggle into a hook.
|
- Refactor dark toggle into a hook.
|
||||||
- Changed the way we read the `USE_SSH` env variable during deployment to be the same as in v1.
|
- Changed the way we read the `USE_SSH` env variable during deployment to be the same as in v1.
|
||||||
- Fix accessing `docs/` or `/docs/xxxx` that does not match any existing doc page should return 404 (Not found) page, not blank page.
|
- Fix accessing `docs/` or `/docs/xxxx` that does not match any existing doc page should return 404 (Not found) page, not blank page.
|
||||||
|
- Allow user to add custom HTML to footer items.
|
||||||
- Simplify blog metadata. Previously, accessing `/blog/post-xxx` will request for next and prev blog post metadata too aside from target post metadata. We should only request target post metadata.
|
- Simplify blog metadata. Previously, accessing `/blog/post-xxx` will request for next and prev blog post metadata too aside from target post metadata. We should only request target post metadata.
|
||||||
- Prioritize `@docusaurus/core` dependencies/ node_modules over user's node_modules. This fix a bug whereby if user has core-js@3 on its own node_modules but docusaurus depends on core-js@2, we previously encounter `Module not found: core-js/modules/xxxx` (because core-js@3 doesn't have that).
|
- Prioritize `@docusaurus/core` dependencies/ node_modules over user's node_modules. This fix a bug whereby if user has core-js@3 on its own node_modules but docusaurus depends on core-js@2, we previously encounter `Module not found: core-js/modules/xxxx` (because core-js@3 doesn't have that).
|
||||||
Another example is if user installed webpack@3 but docusaurus depends on webpack@4.
|
Another example is if user installed webpack@3 but docusaurus depends on webpack@4.
|
||||||
|
|
|
@ -62,11 +62,19 @@ function Footer() {
|
||||||
Array.isArray(linkItem.items) &&
|
Array.isArray(linkItem.items) &&
|
||||||
linkItem.items.length > 0 ? (
|
linkItem.items.length > 0 ? (
|
||||||
<ul className="footer__items">
|
<ul className="footer__items">
|
||||||
{linkItem.items.map(item => (
|
{linkItem.items.map(item =>
|
||||||
|
item.html ? (
|
||||||
|
<div
|
||||||
|
dangerouslySetInnerHTML={{
|
||||||
|
__html: item.html,
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
) : (
|
||||||
<li key={item.href || item.to} className="footer__item">
|
<li key={item.href || item.to} className="footer__item">
|
||||||
<FooterLink item={item} />
|
<FooterLink item={item} />
|
||||||
</li>
|
</li>
|
||||||
))}
|
),
|
||||||
|
)}
|
||||||
</ul>
|
</ul>
|
||||||
) : null}
|
) : null}
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue