Aller au contenu

MkDocs

Create new mkdocs

  1. Create folder.

    mkdir ~/mkdocs
    
  2. Create yaml file with the below code.

    site_name: Site_name
    theme:
    custom_dir: docs
    features:
        - navigation.top
        - navigation.tabs
        - navigation.indexes
        - navigation.instant
        - navigation.tracking
        - content.code.copy
    
    
    favicon: images/favicon.ico
    icon:
        logo: material/robot-dead-outline
    language: fr
    name: material
    palette:
        primary: indigo
        scheme: slate
        toggle:
            icon: material/weather-night
            name: Switch to light mode
    markdown_extensions:
    - pymdownx.highlight:
        use_pygments: true
        anchor_linenums: true
    
    - pymdownx.superfences:
        custom_fences:
            - name: mermaid
            class: mermaid
            format: !!python/name:pymdownx.superfences.fence_code_format
    - pymdownx.inlinehilite
    - pymdownx.betterem
    - attr_list
    - pymdownx.emoji:
        emoji_index: !!python/name:materialx.emoji.twemoji
        emoji_generator: !!python/name:materialx.emoji.to_svg
    - md_in_html 
    - pymdownx.critic 
    - pymdownx.caret 
    - pymdownx.keys 
    - pymdownx.mark
    - pymdownx.tilde
    - pymdownx.details
    - admonition
    
    copyright: Copyright © 2022 your_name
    
  3. Add fstab entry to point to remote folder.

    //remote_ip/remote_foler    /home/user/mkdocs      cifs    credentials=/root/.smbcredential,iocharset=utf8,gid=1000,uid=1000,_netdev,vers=3.0  0       0
    
  4. Create .service file.

    nano mkdocs.service    
    
  5. Copy/Paste the below vode.

    [Unit]
    Description=MKDocs
    After=network.target
    ConditionPathExists=/home/user/mkdocs
    
    [Service]
    Type=simple
    User=admin-mkdocs
    Group=admin-mkdocs
    Restart=on-failure
    RestartSec=5
    RemainAfterExit=yes
    WorkingDirectory=/home/user/mkdocs
    ExecStart=/usr/local/bin/mkdocs serve -a 0.0.0.0:8889
    
    [Install]
    WantedBy=multi-user.target