Skip to content

Commit

Permalink
[ENH] Correctly embed tailwind into the site (#199)
Browse files Browse the repository at this point in the history
Get rid of CDN dependency
Closes #55
  • Loading branch information
surchs authored May 14, 2024
1 parent c6e2d69 commit c05afaa
Show file tree
Hide file tree
Showing 11 changed files with 3,369 additions and 7 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -128,3 +128,5 @@ dmypy.json

# Pyre type checker
.pyre/

node_modules/
18 changes: 17 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,20 @@ When your local build runs well, commit the changes to the `main` branch with a
mkdocs gh-deploy
```

See the [docs for more details](https://www.mkdocs.org/user-guide/deploying-your-docs/).
See the [docs for more details](https://www.mkdocs.org/user-guide/deploying-your-docs/).

## Installing tailwind

To install tailwind, run:

```bash
npm i
```

## Rebuilding tailwind

If you need to rebuild the tailwind css, run:

```bash
npx tailwindcss build docs/stylesheets/tailwind.css -o docs/stylesheets/output.css
```
5 changes: 0 additions & 5 deletions docs/overrides/home.html
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
<!-- Custom HTML site displayed as the Home chapter -->
{% extends "main.html" %}

{% block scripts %}
{{ super() }}
<script src="https://cdn.tailwindcss.com"></script>
{% endblock %}

{% block tabs %}
{{ super() }}

Expand Down
5 changes: 5 additions & 0 deletions docs/overrides/main.html
Original file line number Diff line number Diff line change
@@ -1,2 +1,7 @@

{% extends "base.html" %}

{% block extra_css %}
{{ super() }}
<link rel="stylesheet" href="{{ base_url }}/stylesheet/output.css">
{% endblock %}
Loading

0 comments on commit c05afaa

Please sign in to comment.