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

Chris/homepage #1011

Open
wants to merge 21 commits into
base: main
Choose a base branch
from
Open

Chris/homepage #1011

wants to merge 21 commits into from

Conversation

isoceles
Copy link
Collaborator

@isoceles isoceles commented Feb 7, 2025

Description

The following documentation is in docs/theme/README.md

Development Setup

  1. Install Node.js dependencies in the docs/theme directory
    npm install
  2. Build the theme assets
    npm run build
  3. Start the development server
    npm run dev

This will:

  • Watch and compile Tailwind CSS
  • Watch and bundle JavaScript with esbuild
  1. In another terminal, start MkDocs:
# In the project root
mkdocs serve

Homepage-Specific Assets

The Tailwind CSS and JavaScript are only loaded on the homepage. This is controlled in main.html:

{% block extrahead %}
  {{ super() }}
  {% if page.is_homepage or (page.meta and page.meta.template == "home.html") %}
    <link href="{{ 'theme/assets/styles.css'|url }}" rel="stylesheet">
    <script type="module" src="{{ 'theme/assets/dist/home.js'|url }}"></script>
  {% endif %}
{% endblock %}
  • styles.css - Tailwind styles for homepage components
  • home.js - JavaScript for homepage animations and interactions

Directory Structure

  • assets/ - Source files and compiled assets
    • tailwind.css - Tailwind source file (homepage only)
    • home.js - JavaScript source file (homepage only)
    • dist/ - Compiled JavaScript (gitignored)
    • styles.css - Compiled CSS (gitignored)
    • static/ - Static assets like images and animations
  • home.html - Homepage template
  • main.html - Base template that extends MkDocs Material

Dependencies

  • Tailwind CSS for homepage styling
  • esbuild for JavaScript bundling
  • GSAP for homepage animations
  • Rive for interactive animations

Build Process

The theme assets are automatically built when running mkdocs build through the build hook in build.py. This ensures the homepage assets are compiled before the site is built.

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • This change requires a documentation update

How has this change been tested, please provide a testcase or example of how you tested the change?

YOUR_ANSWER

Any specific deployment considerations

For example, documentation changes, usability, usage/costs, secrets, etc.

Docs

  • Docs updated? What were the changes:

@CLAassistant
Copy link

CLAassistant commented Feb 7, 2025

CLA assistant check
All committers have signed the CLA.

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.

5 participants