1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
//! gen-linkedin: LinkedIn draft generation and post publishing for CI usage.
//!
//! This crate provides two main capabilities:
//!
//! 1. **Draft generation** — scan Zola/Hugo blog posts for a `[linkedin]`
//! frontmatter section, build staged `.linkedin` JSON files, and stamp the
//! source frontmatter with a creation date (idempotent).
//!
//! 2. **Post publishing** — read staged `.linkedin` files, publish each as a
//! LinkedIn text post via the Posts API, write a `published` date back into
//! the source frontmatter, and delete the draft file.
//!
//! # Frontmatter convention
//!
//! A blog post opts in by adding a `[linkedin]` section to its TOML
//! frontmatter:
//!
//! ```toml
//! [linkedin]
//! description_file = "linkedin.md" # preferred for long posts
//! # description = "Short inline text is also accepted."
//! ```
//!
//! The post text must be **author-written** and is not derived from any other
//! frontmatter field. LinkedIn posts are validated against
//! [`LINKEDIN_POST_MAX_CHARS`] (including the appended post link).
//!
//! # Authentication
//!
//! Callers supply a LinkedIn access token and author URN directly. Token
//! acquisition (OAuth 2.0) is outside the scope of this crate. See
//! [`auth::StaticTokenProvider`] for the simple bearer-token provider used
//! in CI contexts.
/// Token providers for bearer tokens used to authenticate with LinkedIn.
/// Base HTTP client wrapper shared by feature modules.
/// LinkedIn draft generation from blog post frontmatter.
/// Error types returned by this crate.
/// Serde-based frontmatter types for the `[linkedin]` TOML section.
/// LinkedIn post publishing from staged draft files.
/// LinkedIn Posts API (REST) support.
pub use crate::;