Skip to content

Sample site creation workflow

Creating a mkdocs site

source: https://www.mkdocs.org/getting-started/

mkdocs new sreemafilaments
cd sreemafilaments
# Default port 8000 already used by my doc site, using 8001 instead
mkdocs serve -a 127.0.0.1:8001

Create a home/landing page first and use it as template in index. Let mkdocs know where you will be able to find these files using custom_dir:

mkdocs.yml
site_name: Sreema Filaments
site_url: https://sreemafilaments.net
theme:
  name: material
  custom_dir: overrides
vector@ArchLinuxVS ~/sreemafilaments $ tree
.
├── docs
│   └── index.md
├── mkdocs.yml
└── overrides
    └── home.html

3 directories, 3 files
~/sreemafilaments/overrides/home.html
{% extends "main.html" %}
{% block tabs %}
{{ super() }}
<style>
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700&display=swap');

html, body, .md-content, .md-content__inner {
    font-family: 'Roboto', sans-serif;
    margin: 0;
    padding: 0;
}

.md-content__inner {
    margin: 0;
    padding: 0;
}

.hero-section {
    position: relative;
    min-height: calc(100vh - 120px);
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    overflow: hidden;
}

.hero-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1400px;
    margin: 0 auto;
    padding: 4rem 2rem;
}

.hero-text {
    flex: 1;
    padding-right: 4rem;
}

.hero-text h1 {
    font-size: 3.5rem;
    color: #1a237e;
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

.hero-text p {
    font-size: 1.25rem;
    color: #424242;
    margin-bottom: 2rem;
    line-height: 1.6;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-top: 4rem;
}

.feature-card {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-5px);
}

.feature-card h3 {
    color: #1a237e;
    margin-bottom: 1rem;
}

.feature-card p {
    color: #616161;
    font-size: 1rem;
    line-height: 1.5;
}

.cta-button {
    display: inline-block;
    background: #1a237e;
    color: white;
    padding: 1rem 2rem;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 500;
    transition: background 0.3s ease;
    margin-right: 1rem;
}

.cta-button:hover {
    background: #283593;
}

.cta-button.secondary {
    background: transparent;
    border: 2px solid #1a237e;
    color: #1a237e;
}

.cta-button.secondary:hover {
    background: #1a237e;
    color: white;
}

.hero-image {
    flex: 1;
    position: relative;
}

.hero-image img {
    width: 100%;
    max-width: 600px;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
}

@media (max-width: 1024px) {
    .hero-content {
        flex-direction: column;
        text-align: center;
        padding: 2rem;
    }

    .hero-text {
        padding-right: 0;
        margin-bottom: 2rem;
    }

    .hero-text h1 {
        font-size: 2.5rem;
    }

    .feature-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .feature-grid {
        grid-template-columns: 1fr;
    }

    .cta-button {
        display: block;
        margin: 1rem 0;
    }
}
</style>

<section class="hero-section">
    <div class="hero-content">
        <div class="hero-text">
            <h1>Precision Manufacturing Solutions</h1>
            <p>Leading the industry with cutting-edge technology and unmatched expertise in precision manufacturing, automation, and quality control.</p>

            <a href="./solutions" class="cta-button">Explore Solutions</a>
            <a href="./contact" class="cta-button secondary">Contact Us</a>

            <div class="feature-grid">
                <div class="feature-card">
                    <h3>Advanced Manufacturing</h3>
                    <p>State-of-the-art facilities equipped with the latest CNC machinery and automation systems.</p>
                </div>
                <div class="feature-card">
                    <h3>Quality Assurance</h3>
                    <p>ISO 9001:2015 certified processes ensuring consistent, high-quality output.</p>
                </div>
                <div class="feature-card">
                    <h3>Custom Solutions</h3>
                    <p>Tailored manufacturing solutions to meet your specific requirements and industry standards.</p>
                </div>
            </div>
        </div>

        <div class="hero-image">
            <img src="/api/placeholder/600/400" alt="Advanced Manufacturing Facility">
        </div>
    </div>
</section>
{% endblock %}
{% block content %}{% endblock %}

Comments