From c20ea9f6922557db29061a5d53c067ab20c734b9 Mon Sep 17 00:00:00 2001 From: Volpeon <git@volpeon.ink> Date: Sat, 13 Nov 2021 18:03:55 +0100 Subject: Improved list generation, remove index template --- templates/base.html | 4 +- templates/layouts/categorized_list.html | 98 ++++++++++++++++++++-------- templates/layouts/deep_categorized_list.html | 54 +++++++++++++++ templates/layouts/index.html | 67 ------------------- templates/layouts/list.html | 96 +++++++++++++++++++-------- 5 files changed, 194 insertions(+), 125 deletions(-) create mode 100644 templates/layouts/deep_categorized_list.html delete mode 100644 templates/layouts/index.html (limited to 'templates') diff --git a/templates/base.html b/templates/base.html index e736864..ede7941 100644 --- a/templates/base.html +++ b/templates/base.html @@ -63,8 +63,8 @@ </nav> <main> - $if(namespace.root.is_index)$ -${layouts/index()} + $if(layout.is_deep_categorized_list)$ +${layouts/deep_categorized_list()} $elseif(layout.is_categorized_list)$ ${layouts/categorized_list()} $elseif(layout.is_list)$ diff --git a/templates/layouts/categorized_list.html b/templates/layouts/categorized_list.html index a3af43c..ad510ae 100644 --- a/templates/layouts/categorized_list.html +++ b/templates/layouts/categorized_list.html @@ -11,36 +11,76 @@ $body$ <h2 class="c-card-list__category-header"> <a href="$it.url.rel$">$it.title$</a> </h2> - <div class="c-card-list__category-content$if(it.list_grid)$ c-card-list__category-content--grid$endif$"> - $for(it.pages.all)$ - <a href="$it.url.rel$" class="c-card-list__card c-card"> - $if(pages.all.list_read_indicators)$ - <div class="c-card__block c-card__block--indicator"></div> - $endif$ - $if(pages.all.icon)$ - <svg class="c-card__block o-icon" width="1em" height="1em"> - <use href="/symbols.svg#icon-$pages.all.icon$"></use> - </svg> - $endif$ - <div class="c-card__block c-card__block--main"> - $it.title$ - </div> - $if(it.date)$ - <time datetime="$it.date.yyyy_mm_dd$" class="c-card__block u-fs0"> - <small class="u-dn@sm-hi"> - $it.date.short$ - </small> - <small class="u-dn@sm-lo"> - $it.date.long$ - </small> - </time> - $endif$ - </a> - $endfor$ - </div> + $if(it.list_grid)$ + <div class="c-card-list__category-content c-card-list__category-content--grid"> + $for(it.pages.all)$ + <a href="$it.url.rel$" class="c-card-list__card c-card"> + $if(pages.all.list_read_indicators)$ + <div class="c-card__block c-card__block--indicator"></div> + $endif$ + $if(pages.all.icon)$ + <svg class="c-card__block o-icon" width="1em" height="1em"> + <use href="/symbols.svg#icon-$pages.all.icon$"></use> + </svg> + $endif$ + <div class="c-card__block c-card__block--main"> + $if(it.date)$ + <time datetime="$it.date.yyyy_mm_dd$"> + <small class="u-dn@sm-hi"> + $it.date.short$ + </small> + <small class="u-dn@sm-lo"> + $it.date.long$ + </small> + </time> + <strong class="u-db">$it.title$</strong> + $else$ + $it.title$ + $endif$ + </div> + $if(list_icon)$ + <svg class="c-card__block o-icon" width="1em" height="1em"> + <use href="/symbols.svg#$list_icon$"></use> + </svg> + $endif$ + </a> + $endfor$ + </div> + $else$ + <div class="c-card-list__category-content"> + $for(it.pages.all)$ + <a href="$it.url.rel$" class="c-card-list__card c-card"> + $if(pages.all.list_read_indicators)$ + <div class="c-card__block c-card__block--indicator"></div> + $endif$ + $if(pages.all.icon)$ + <svg class="c-card__block o-icon" width="1em" height="1em"> + <use href="/symbols.svg#icon-$pages.all.icon$"></use> + </svg> + $endif$ + <div class="c-card__block c-card__block--main"> + $it.title$ + </div> + $if(it.date)$ + <time datetime="$it.date.yyyy_mm_dd$" class="c-card__block u-fs0"> + <small class="u-dn@sm-hi"> + $it.date.short$ + </small> + <small class="u-dn@sm-lo"> + $it.date.long$ + </small> + </time> + $endif$ + $if(list_icon)$ + <svg class="c-card__block o-icon" width="1em" height="1em"> + <use href="/symbols.svg#$list_icon$"></use> + </svg> + $endif$ + </a> + $endfor$ + </div> + $endif$ $endif$ $endfor$ </div> </section> - - diff --git a/templates/layouts/deep_categorized_list.html b/templates/layouts/deep_categorized_list.html new file mode 100644 index 0000000..eec16c9 --- /dev/null +++ b/templates/layouts/deep_categorized_list.html @@ -0,0 +1,54 @@ +<section class="l-container l-container--pad-x l-container--pad-y l-container--content"> + <div class="s-headlines s-colored-links"> + <h1 class="u-mt0"><span class="s-headlines__title-inner">$title$</span></h1> + +$body$ + </div> + + <div class="c-card-list"> + $for(pages.all)$ + $if(it.pages)$ + <h2 class="c-card-list__category-header"> + <a href="$it.url.rel$">$it.title$</a> + </h2> + <div class="c-card-list__category-content$if(it.list_grid)$ c-card-list__category-content--grid$endif$"> + $for(pages.all.pages.all)$ + $for(pages.all.pages.all.pages.all)$ + <a href="$it.url.rel$" class="c-card-list__card c-card"> + $if(pages.all.list_read_indicators)$ + <div class="c-card__block c-card__block--indicator"></div> + $endif$ + $if(pages.all.pages.all.icon)$ + <svg class="c-card__block o-icon" width="1em" height="1em"> + <use href="/symbols.svg#icon-$pages.all.pages.all.icon$"></use> + </svg> + $endif$ + <div class="c-card__block c-card__block--main"> + <small class="u-db">$pages.all.pages.all.title$</small> + <strong class="u-db">$it.title$</strong> + </div> + $if(it.date)$ + <time datetime="$it.date.yyyy_mm_dd$" class="c-card__block u-fs0"> + <small class="u-dn@sm-hi"> + $it.date.short$ + </small> + <small class="u-dn@sm-lo"> + $it.date.long$ + </small> + </time> + $endif$ + $if(pages.all.list_icon)$ + <svg class="c-card__block o-icon" width="1em" height="1em"> + <use href="/symbols.svg#$pages.all.list_icon$"></use> + </svg> + $endif$ + </a> + $endfor$ + $endfor$ + </div> + $endif$ + $endfor$ + </div> +</section> + + diff --git a/templates/layouts/index.html b/templates/layouts/index.html deleted file mode 100644 index 1eca10f..0000000 --- a/templates/layouts/index.html +++ /dev/null @@ -1,67 +0,0 @@ -<section class="l-container l-container--pad-x l-container--pad-y l-container--content"> - <div class="s-headlines s-colored-links"> - <h1 class="u-mt0"><span class="s-headlines__title-inner">I'm a <strong>red fox</strong> in disguise.</span></h1> - -$body$ - </div> - - <div class="c-card-list"> - <h2 class="c-card-list__category-header"> - Profiles - </h2> - <div class="c-card-list__category-content c-card-list__category-content--grid"> - $for(profiles)$ - $if(it.featured)$ - $if(it.url)$ - <a class="c-card-list__card c-card" href="$it.url$"> - $else$ - <div class="c-card-list__card c-card"> - $endif$ - $if(it.icon)$ - <svg class="c-card__block o-icon" width="1em" height="1em"> - <use href="/symbols.svg#icon-$it.icon$"></use> - </svg> - $endif$ - <div class="c-card__block c-card__block--main"> - <strong class="u-db">$it.platform$</strong> - <small class="u-db">$it.username$</small> - </div> - $if(it.url)$ - <svg class="c-card__block o-icon" width="1em" height="1em"> - <use href="/symbols.svg#icon-arrow-up-right"></use> - </svg> - $endif$ - $if(it.url)$ - </a> - $else$ - </div> - $endif$ - $endif$ - $endfor$ - </div> - - <h2 class="c-card-list__category-header"> - <a href="$pages.by_id.projects.url.rel$">$pages.by_id.projects.title$</a> - </h2> - <div class="c-card-list__category-content c-card-list__category-content--grid"> - $for(pages.by_id.projects.pages.all)$ - $for(it.pages.all)$ - <a href="$it.url.rel$" class="c-card-list__card c-card"> - $if(pages.by_id.projects.pages.all.icon)$ - <svg class="c-card__block o-icon" width="1em" height="1em"> - <use href="/symbols.svg#icon-$pages.by_id.projects.pages.all.icon$"></use> - </svg> - $endif$ - <div class="c-card__block c-card__block--main"> - <small class="u-db">$pages.by_id.projects.pages.all.title$</small> - <strong class="u-db">$it.title$</strong> - </div> - <svg class="c-card__block o-icon" width="1em" height="1em"> - <use href="/symbols.svg#icon-arrow-right"></use> - </svg> - </a> - $endfor$ - $endfor$ - </div> - </div> -</section> diff --git a/templates/layouts/list.html b/templates/layouts/list.html index 2ef02ab..b4647a1 100644 --- a/templates/layouts/list.html +++ b/templates/layouts/list.html @@ -6,33 +6,75 @@ $body$ </div> <div class="c-card-list"> - <div class="c-card-list__category-content$if(list_grid)$ c-card-list__category-content--grid$endif$"> - $for(pages.all)$ - <a href="$it.url.rel$" class="c-card-list__card c-card"> - $if(list_read_indicators)$ - <div class="c-card__block c-card__block--indicator"></div> - $endif$ - $if(icon)$ - <svg class="c-card__block o-icon"> - <use href="/symbols.svg#icon-$icon$"></use> - </svg> - $endif$ - <div class="c-card__block c-card__block--main"> - $it.title$ - </div> - $if(it.date)$ - <time datetime="$it.date.yyyy_mm_dd$" class="c-card__block u-fs0"> - <small class="u-dn@sm-hi"> - $it.date.short$ - </small> - <small class="u-dn@sm-lo"> - $it.date.long$ - </small> - </time> - $endif$ - </a> - $endfor$ - </div> + $if(list_grid)$ + <div class="c-card-list__category-content c-card-list__category-content--grid"> + $for(pages.all)$ + <a href="$it.url.rel$" class="c-card-list__card c-card"> + $if(list_read_indicators)$ + <div class="c-card__block c-card__block--indicator"></div> + $endif$ + $if(icon)$ + <svg class="c-card__block o-icon"> + <use href="/symbols.svg#icon-$icon$"></use> + </svg> + $endif$ + <div class="c-card__block c-card__block--main"> + $if(it.date)$ + <time datetime="$it.date.yyyy_mm_dd$"> + <small class="u-dn@sm-hi"> + $it.date.short$ + </small> + <small class="u-dn@sm-lo"> + $it.date.long$ + </small> + </time> + <strong class="u-db">$it.title$</strong> + $else$ + $it.title$ + $endif$ + </div> + $if(list_icon)$ + <svg class="c-card__block o-icon" width="1em" height="1em"> + <use href="/symbols.svg#$list_icon$"></use> + </svg> + $endif$ + </a> + $endfor$ + </div> + $else$ + <div class="c-card-list__category-content"> + $for(pages.all)$ + <a href="$it.url.rel$" class="c-card-list__card c-card"> + $if(list_read_indicators)$ + <div class="c-card__block c-card__block--indicator"></div> + $endif$ + $if(icon)$ + <svg class="c-card__block o-icon"> + <use href="/symbols.svg#icon-$icon$"></use> + </svg> + $endif$ + <div class="c-card__block c-card__block--main"> + $it.title$ + </div> + $if(it.date)$ + <time datetime="$it.date.yyyy_mm_dd$" class="c-card__block u-fs0"> + <small class="u-dn@sm-hi"> + $it.date.short$ + </small> + <small class="u-dn@sm-lo"> + $it.date.long$ + </small> + </time> + $endif$ + $if(list_icon)$ + <svg class="c-card__block o-icon" width="1em" height="1em"> + <use href="/symbols.svg#$list_icon$"></use> + </svg> + $endif$ + </a> + $endfor$ + </div> + $endif$ </div> </section> -- cgit v1.2.3-70-g09d2