Youlog Theme

Theme Configuration

Theme Configuration

2026-07-04

Theme Configuration

Youlog is a documentation/blog theme for everkm-publish, with book as the default template. Site-level configuration is placed under the config node in workspace __everkm/everkm.yaml; route parameters for book directories are set in the query of folders.

Configuration Overview

# __everkm/everkm.yaml

config:
  site: { ... }           # Site basic info
  layout: { ... }         # Layout options
  features: { ... }       # Feature toggles
  theme_color: "..."      # Browser theme color
  custom_css: "..."       # Custom stylesheet
  copyright: { ... }      # Footer copyright
  beian: [ ... ]          # ICP filing info
  yousha: { ... }         # Yousha comments
  algolia_search: { ... } # Full-text search
  header_nav: [ ... ]     # Top navigation bar
  bottom_nav: [ ... }     # Footer links
  body_end_html: "..."    # HTML appended at end of body

folders:
  "/docs/":
    template: book
    query:
      nav_file: /docs/_nav.md   # Optional: chapter navigation file
      stack: true               # Optional: top-bottom layout (header on top, below split into left/right)

Site Info site

FieldTypeDescription
site.namestringSite name, used in page title, sidebar, header, footer, etc.
site.descriptionstringSite description (publish system metadata)
site.keywordsstringSite keywords (publish system metadata)
site.logostringLogo image path, e.g. ~/assets/logos/logo.svg
site.hoststringSite domain, used for "Permalink" display in the content area

Example:

config:
  site:
    name: My Docs
    description: My documentation site
    keywords: docs, everkm
    logo: ~/assets/logos/logo.svg
    host: docs.example.com

Layout layout

FieldTypeDefaultDescription
layout.only_display_logobooleanfalseWhen a logo exists, show only the image without the site name
layout.aisde_no_headerbooleanfalseSidebar does not show the site header (Logo / site name). Note: the config key uses the historical spelling aisde, not aside
layout.hide_print_buttonbooleanfalseWhen true, hides the print entry (Print button in meta area and print header)
layout.hide_page_qrcodebooleanfalseWhen true, hides the page QR code (on screen and at the bottom of printed pages)

The hide_print_button and hide_page_qrcode options can also be set in individual article front matter (see below). Article-level config takes precedence over global layout config.

Example:

config:
  layout:
    hide_print_button: false
    hide_page_qrcode: false

When stack=true, the site header moves to the top-left of the top bar; it is no longer duplicated inside the sidebar.


Feature Toggles features

FieldTypeDefaultDescription
features.code_highlightbooleantrueWhether to enable Prism code highlighting
features.katex_formulabooleanfalseWhether to enable KaTeX math formula rendering

Example:

config:
  features:
    code_highlight: true
    katex_formula: true

Appearance

FieldTypeDescription
theme_colorstringBrowser theme-color, e.g. "#0f766e"
custom_cssstringPath to custom CSS file, e.g. ~/assets/my.css

Color variable examples can be found under templates/theme-demo/ in the theme package. Override CSS variables via custom_css to customize brand colors.


Navigation

Header Navigation header_nav

Displayed at the top-right of the page (horizontal menu on desktop, collapsible menu on mobile). Supports nested sub-menus.

config:
  header_nav:
    - title: Home
      url: /
    - title: Docs
      url: /docs/
    - title: More
      url: /more/
      children:
        - title: Sub-menu
          url: /more/sub/
FieldTypeDefaultDescription
titlestringDisplay text
urlstringLink URL
new_windowbooleantrueWhether to open in a new window
childrenarraySub-menu items, same structure as parent
start_iconstringIcon before text; supports language, external
end_iconstringIcon after text; supports language, external
no_highlightbooleanfalseDo not apply current-page highlight style to this item
reflect_active_childbooleanfalseWhen a child matches the current page, show the child's title on the parent
match_children_prefixbooleanfalseAllow prefix matching (including /) for direct children only, in a scoped second pass; does not change global home matching
exact_matchbooleanfalseExact page match only (including /path//path/index.html); no prefix. Takes priority over match_children_prefix when both apply

Footer Navigation bottom_nav

Displayed at the bottom of the content area. Only supports one level of links.

config:
  bottom_nav:
    - title: everkm
      url: https://everkm.cn
    - title: GitHub
      url: https://github.com/everkm/theme-youlog
      new_window: true

Search algolia_search

When configured, the Algolia full-text search component appears in the top bar (requires plugin-in-search build artifacts).

config:
  algolia_search:
    app_id: YOUR_APP_ID
    api_key: YOUR_SEARCH_API_KEY
    index_name: your_index
    site: your-site-id
FieldDescription
app_idAlgolia Application ID
api_keyAlgolia Search-Only API Key
index_nameIndex name
siteSite identifier (used internally by the plugin)

Comments yousha

Configure to integrate Yousha Comments:

config:
  yousha:
    community: your-community-id

When configured, a <yousha-comment> component is rendered below the article content.


Footer Info

Copyright copyright

config:
  copyright:
    from_year: 2021        # Optional, start year; if omitted, only the current year is shown
    text: everkm           # Copyright holder text
    link: https://everkm.cn  # Optional, link URL

ICP Filing beian

config:
  beian:
    - text: ICP Filing Number
      link: https://beian.miit.gov.cn/
    - text: Public Security Filing Number
      link: https://beian.mps.gov.cn/

Book Template Route Parameters (folders.query)

For directories using template: book, template query parameters can be passed via query in everkm.yaml:

folders:
  "/docs/":
    template: book
    query:
      nav_file: /docs/_nav.md
      stack: true
  "/blog/":
    template: book
    # No nav_file: no left-side tree navigation
ParameterTypeDescription
nav_filestringOptional. Path to the chapter navigation Markdown file (usually _nav.md or _SUMMARY.md). When not configured or the file does not exist, tree navigation and previous/next navigation are not displayed
stackbooleanOptional. true / 1 / yes enables top-bottom layout: full-width header on top, navigation tree on the left and content on the right below. Default false uses left-right layout (full-height sidebar on the left, header and content on the right)

Layout Mode Comparison

Default (stack=false)

┌──────────┬──────────────────┐
│ Sidebar  │ Header           │
│ (full h) ├──────────────────┤
│ Nav tree │ Content + TOC    │
└──────────┴──────────────────┘

Top-Bottom Layout (stack=true)

┌─────────────────────────────┐
│ Header (site Logo + tools)  │
├──────────┬──────────────────┤
│ Nav tree │ Content + TOC    │
└──────────┴──────────────────┘

Behavior differences when stack=true:

  • The site Logo / name is permanently displayed on the left side of the top bar (no longer switches to article title on scroll)
  • The sidebar no longer duplicates the site header
  • The sidebar only shows the navigation tree

Article Front Matter

The following fields can be set in the YAML front matter at the beginning of a Markdown file:

FieldTypeDescription
meta.descriptionstringPage <meta name="description">
meta.keywordsstringPage <meta name="keywords">
meta.hide_metabooleanWhen true, hides meta info such as update date and permalink (default false)
meta.hide_tocbooleanWhen true, hides the table of contents (TOC) (default false)
meta.hide_titlebooleanWhen true, hides the article title (default false)
meta.permalinkstringPermalink slug, displayed in the meta area as https://{site.host}/{permalink}
meta.hide_print_buttonbooleanWhen true, hides the print entry; when not set, inherits layout.hide_print_button (default false)
meta.hide_page_qrcodebooleanWhen true, hides the page QR code; when not set, inherits layout.hide_page_qrcode (default false)

Example:

---
title: Built-in Filters
meta:
  description: Filter documentation
  keywords: filter, everkm
  permalink: docs/builtin-filter
  hide_print_button: true
  hide_page_qrcode: true
---

Environment Variables

Deployment or hosting platforms can inject values via environment variables (read by the theme via env()):

VariableDescription
YOULOG_PLATFORMYoulog platform link; when configured, a "Youlog" entry appears in the footer
YOULOG_VERSIONCurrent deployment version number; linked with the version list component
YOULOG_VERSIONS_URLVersion list JSON URL, used by the <youlog-version> component

The versions_url field in everkm.yaml is reserved for the publish workspace; the theme's footer version component actually reads the environment variable YOULOG_VERSIONS_URL.


Content Markdown Extensions

Alert Blocks

Use blockquotes with specific classes in Markdown:

ClassPurpose
.tipsTips
.infoInfo
.warningWarning
.errorError
.successSuccess

dcard list Parameter

dcard/list supports the parameter hide_prev_next: true, which hides the previous/next navigation links in list items.


Reader Settings (Browser-side)

The following settings are stored locally in the user's browser and are not configured in everkm.yaml:

  • Font size, line height, font family
  • Light / dark mode

Access the reading settings panel via the "Aa" button in the top bar.


Theme Metadata

ItemValue
Theme nameyoulog
Default templatebook
Demo sitehttps://youlog.theme.everkm.com/
Repositoryhttps://github.com/everkm/theme-youlog