mirror of
https://github.com/Relintai/rcpp_framework.git
synced 2025-02-20 15:14:26 +01:00
Now paged article has a summary field again, if it finds a summary.md it will load it and store that, otherwise it will just use it's uri segment.
This commit is contained in:
parent
bb4aa4ebdd
commit
ead57f1d6a
@ -88,6 +88,12 @@ void PagedArticle::load() {
|
|||||||
|
|
||||||
Utils::markdown_to_html(&fd);
|
Utils::markdown_to_html(&fd);
|
||||||
|
|
||||||
|
if (files[i] == "summary.md") {
|
||||||
|
summary = fd;
|
||||||
|
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
String pagination;
|
String pagination;
|
||||||
|
|
||||||
pagination = Utils::get_pagination_links(get_full_uri(), files, i);
|
pagination = Utils::get_pagination_links(get_full_uri(), files, i);
|
||||||
@ -116,12 +122,24 @@ void PagedArticle::load() {
|
|||||||
|
|
||||||
file_cache->wwwroot_refresh_cache();
|
file_cache->wwwroot_refresh_cache();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (summary == "") {
|
||||||
|
generate_summary();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
String PagedArticle::get_index_page() {
|
String PagedArticle::get_index_page() {
|
||||||
return index_page;
|
return index_page;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
String PagedArticle::get_summary() {
|
||||||
|
return summary;
|
||||||
|
}
|
||||||
|
|
||||||
|
void PagedArticle::generate_summary() {
|
||||||
|
summary = get_uri_segment();
|
||||||
|
}
|
||||||
|
|
||||||
void PagedArticle::_notification(const int what) {
|
void PagedArticle::_notification(const int what) {
|
||||||
switch (what) {
|
switch (what) {
|
||||||
case NOTIFICATION_ENTER_TREE:
|
case NOTIFICATION_ENTER_TREE:
|
||||||
|
@ -19,6 +19,9 @@ public:
|
|||||||
void load();
|
void load();
|
||||||
void load_folder(const String &folder, const String &path);
|
void load_folder(const String &folder, const String &path);
|
||||||
String get_index_page();
|
String get_index_page();
|
||||||
|
String get_summary();
|
||||||
|
|
||||||
|
virtual void generate_summary();
|
||||||
|
|
||||||
void _notification(const int what);
|
void _notification(const int what);
|
||||||
|
|
||||||
@ -31,6 +34,7 @@ public:
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
String index_page;
|
String index_page;
|
||||||
|
String summary;
|
||||||
std::map<String, String *> pages;
|
std::map<String, String *> pages;
|
||||||
FileCache *file_cache;
|
FileCache *file_cache;
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user