Logo

index : blog

---

  • summary
  • about
  • tree
  • log
  • branches
<< path: root/public/blog.git/html/src/gen/constants.h blob: 41b92bd111582a773f877dfa1abf068a6decf786 [raw] [clear marker]

        
0
1
2/** Parsing related */
3METADATA_CMD_CURRENT_DT :: "now";
4
5METADATA_MARKER :: "META;";
6REFERENCE_MARKER :: "[!link:";
7
8PATTERN_PUBLISHED :: "published:";
9PATTERN_UPDATED :: "updated:";
10
11/** This is used by the search server. Hence the 'extern' */
12PATTERN_EXTERN_ENTRY :: "<!-- extern template: search_results -->";
13
14/** Note: The order is very important! @blog.jai: dispatch_metadata() */
15KEYWORDS :: string.[
16 "title:",
17 "width:",
18 PATTERN_PUBLISHED,
19 PATTERN_UPDATED,
20];
21
22/** Regex pattern covers those cases:
23
24 2025-01-01(123456)
25 2025-01-01-01-01(123456)
26 2025-01-01 ( 123456 )
27 2025-01-01-01-01 ( 123456 )
28*/
29PATTERN_RE_DATETIME :: "\\d{4}-\\d{2}-\\d{2}(?:-\\d{2}-\\d{2})?\\s*\\(\\s*\\d+\\s*\\)";
30
31
32/** Allowed date formats in the header of blog posts.
33
34 YYYY-MM-DD-hh-mm
35 published: 2025-05-01-01-00 Date and time
36 published: 2025-05-01 Only date
37 published: now Current DT
38 published: Empty (uses current dt)
39 Omitted (uses current dt)
40
41*/
42
43PARSER_FORMAT_DT_DELIMITER :: "-";
44PARSER_FORMAT_DATETIME_DELIMITER_COUNT :: 4;
45PARSER_FORMAT_DATE_DELIMITER_COUNT :: 2;
46
47/** End parser stuff */
48
49
50/** TODO(adam, 2): The whole directory management is a little bit messy, for now it's fine,
51 but maybe we need something more concise.
52
53 The current for creating directories also sucks. */
54
55/** Top level directories */
56DIR_TEMPLATES :: "templates";
57DIR_POSTS :: "posts";
58DIR_WWW :: "www";
59DIR_GENERIC :: "generic";
60DIR_ASSETS :: "assets";
61DIR_DUMPS :: "dumps";
62
63/** Relative to top level (don't create them) */
64SUBDIR_IMAGES :: "images";
65SUBDIR_POSTS :: "posts";
66
67/** Absolute paths */
68DIR_POSTS_IMAGES :: #run tprint("%/%", DIR_POSTS, SUBDIR_IMAGES);
69DIR_WWW_IMAGES :: #run tprint("%/%", DIR_WWW, SUBDIR_IMAGES);
70DIR_WWW_POSTS :: #run tprint("%/%", DIR_WWW, SUBDIR_POSTS);
71
72/** File paths */
73FP_DUMP_ENTRIES_MD :: #run tprint("%/entries_md.bin", DIR_DUMPS);
74FP_DUMP_ENTRIES_HTML :: #run tprint("%/entries_html.bin", DIR_DUMPS);
75FP_DUMP_SEARCH_INDEX :: #run tprint("%/search_index.bin", DIR_DUMPS);
76FP_ASSETS_FAVICON :: #run tprint("%/logo.png", DIR_ASSETS);
77FP_WWW_FAVICON :: #run tprint("%/favicon.png", DIR_WWW);
78FP_WWW_SEARCH_RESULTS :: #run tprint("%/search_results.html", DIR_WWW);
79
80/** Things to create */
81DIRECTORIES_TO_CREATE :: string.[
82 /** Top level */
83 DIR_WWW,
84 DIR_DUMPS,
85
86 /** Sub directories */
87 DIR_WWW_IMAGES,
88 DIR_WWW_POSTS,
89];
90
91FILES_TO_COPY :: Copy_File.[
92 .{ FP_ASSETS_FAVICON, FP_WWW_FAVICON },
93];
94
95
96/** Website metadata */
97PAGE_URL :: "https://blog.ptrace.dev";
98PAGE_URL_POST :: #run tprint("%?ts=\%", PAGE_URL);
99
100PAGE_TITLE :: "ptrace blog";
101
102PAGE_DESCRIPTION :: "Some tech blog";
103PAGE_IMAGE_MAX_WIDTH :: 1000;
104PAGE_ENTRIES_MAX :: 25;
105PAGE_OVERVIEW_ITEMS_MAX :: 200;
106
107RSS_FP :: #run tprint("%/ptrace.dev.rss", DIR_WWW);
108RSS_URL :: #run tprint("%/rss", PAGE_URL);
109
110
Copyright 2026  E766CB298A6D1E64 | Git-Thing heavily inspired by cgit