> # Articles
>
> ```qinp!config
> route is "articles";
> enable watermark;
> ```
> ```qinp!run
> import "grouped";
>
> macro HEADER_PREFIX "# ";
> macro MAIN_ROUTE "articles";
>
> let article_routes = grouped.load_subroutes_date_sorted(MAIN_ROUTE);
>
> let output = list.empty(string);
> for let i = 0; i < list.len(article_routes); i += 1 {
> let route = article_routes[i];
> if route == MAIN_ROUTE -> continue;
>
> let content = pinq.get_resource_static(route);
> if content.kind == option.None -> grouped.load_error(MAIN_ROUTE);
>
> let first_line = str.split(content.Some, "\n")[0];
> let title = str.strip_prefix(first_line, HEADER_PREFIX);
>
> output += "=> " + route + " " + title + "\n";
> }
>
> grouped.echo_output(output);
> ```
>
> => home 🔙 Back to home
> ```qinp!run
> macro QINP_SOURCE_CODE "__qinp_source_code";
>
> fn load_error(what: string) {
> echoln "## Error";
> echoln "An error occurred, " + what + " could not be loaded";
> echoln "";
> echoln "=> home Back to home";
> terminate();
> }
>
> fn load_subroutes_date_sorted(route: string) string[] {
> let routes = pinq.list_routes_start_matching(route);
> // routes are dates, so sorts by date...
> list.sort(routes);
> // ...and reverse to get most recent at the top
> list.reverse(routes);
> return routes;
> }
>
> fn echo_output(output: string[]) {
> let length = list.len(output);
> if length == 0 {
> echoln "## Nothing here yet!";
> return;
> }
>
> for let i = 0; i < length; i += 1 {
> echo output[i];
> }
> }
> ```