mirror of
https://gh.wpcy.net/https://github.com/discourse/discourse.git
synced 2026-05-04 08:00:01 +08:00
- Import the full `discourse/discourse-developer-docs` repository into `docs/developer-guides/` using `git subtree add` with complete git history preserved - Move CI workflows (lint + publish) from the nested `.github/` to root-level workflows scoped to `docs/developer-guides/**` path changes - The [developer-docs repo](https://github.com/discourse/discourse-developer-docs) was archived.
15 lines
325 B
Ruby
15 lines
325 B
Ruby
# frozen_string_literal: true
|
|
|
|
module Util
|
|
def self.parse_md(raw)
|
|
if match = raw.match(/\A---\s*\n(.+?)\n---\n?(.*)\z/m)
|
|
raw_frontmatter, content = match.captures
|
|
frontmatter = YAML.safe_load(raw_frontmatter)
|
|
else
|
|
content = raw
|
|
frontmatter = {}
|
|
end
|
|
|
|
[frontmatter, content]
|
|
end
|
|
end
|