mirror of
https://github.com/Ed94/metadesk.git
synced 2026-08-06 15:48:47 +00:00
finish the elimination of MD_PushSibling
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"><meta name="author" content="Ryan Fleury">
|
||||
<meta property="og:title" content="">
|
||||
<meta name="twitter:title" content="">
|
||||
<link rel="canonical" href="https://example.site">
|
||||
<meta property="og:type" content="website">
|
||||
<meta property="og:url" content="https://example.site">
|
||||
<meta property="og:site_name" content="Example Site">
|
||||
<meta name="twitter:card" content="summary">
|
||||
<meta name="twitter:site" content="@ryanjfleury">
|
||||
<link rel="stylesheet" type="text/css" href="style.css">
|
||||
<script src="site.js"></script>
|
||||
<title>Example Site</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div class="header">
|
||||
<h1>Example Site</h1>
|
||||
<a href="#">Test Link 1</a>
|
||||
<a href="#">Test Link 2</a>
|
||||
<a href="#">Test Link 3</a>
|
||||
</div>
|
||||
<div class="page_content">
|
||||
</div>
|
||||
|
||||
<div class="footer">
|
||||
<h4>Example Site Footer</h4>
|
||||
<a href="#">Test Link 1</a>
|
||||
<a href="#">Test Link 2</a>
|
||||
<a href="#">Test Link 3</a>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -55,11 +55,8 @@ int main(int argument_count, char **arguments)
|
||||
site_info = ParseSiteInfo(site_info_file);
|
||||
}
|
||||
|
||||
// TODO(allen): use list system
|
||||
|
||||
//~ NOTE(rjf): Parse pages.
|
||||
MD_Node *first_root = MD_NilNode();
|
||||
MD_Node *last_root = MD_NilNode();
|
||||
MD_Node *root_list = MD_MakeList();
|
||||
{
|
||||
printf("Searching for site pages at \"%.*s\"...\n", MD_StringExpand(page_dir_path));
|
||||
MD_FileInfo file_info = {0};
|
||||
@@ -76,7 +73,8 @@ int main(int argument_count, char **arguments)
|
||||
MD_String8 path = MD_PushStringF("%.*s/%.*s",
|
||||
MD_StringExpand(folder),
|
||||
MD_StringExpand(file_info.filename));
|
||||
MD_PushSibling(&first_root, &last_root, MD_ParseWholeFile(path).node);
|
||||
MD_Node *node = MD_ParseWholeFile(path).node;
|
||||
MD_PushReference(root_list, node);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -84,8 +82,9 @@ int main(int argument_count, char **arguments)
|
||||
//~ NOTE(rjf): Generate index table.
|
||||
MD_Map index_table = {0};
|
||||
{
|
||||
for(MD_EachNode(root, first_root))
|
||||
for(MD_EachNode(ref, root_list->first_child))
|
||||
{
|
||||
MD_Node *root = MD_Deref(ref);
|
||||
for(MD_EachNode(node, root->first_child))
|
||||
{
|
||||
if(!MD_NodeIsNil(node->first_child) && MD_StringMatch(node->string, MD_S8Lit("index"), MD_MatchFlag_CaseInsensitive))
|
||||
@@ -123,8 +122,9 @@ int main(int argument_count, char **arguments)
|
||||
}
|
||||
|
||||
//~ NOTE(rjf): Generate files for all roots.
|
||||
for(MD_EachNode(root, first_root))
|
||||
for(MD_EachNode(ref, root_list->first_child))
|
||||
{
|
||||
MD_Node *root = MD_Deref(ref);
|
||||
PageInfo page_info = ParsePageInfo(root);
|
||||
|
||||
MD_String8 name_without_extension = MD_SkipFolder(MD_ChopExtension(root->string));
|
||||
|
||||
Reference in New Issue
Block a user