Skip to content

Commit

Permalink
template cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
markzegarelli committed Apr 1, 2024
1 parent 433073c commit 93d9bb4
Show file tree
Hide file tree
Showing 5 changed files with 116 additions and 136 deletions.
1 change: 1 addition & 0 deletions content/collections/pages/test.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ author: 0c3a318b-936a-4cbd-8fdf-771a90c297f0
template: default
updated_by: 0c3a318b-936a-4cbd-8fdf-771a90c297f0
updated_at: 1707241404
hide_toc: true
---

## Background
Expand Down
84 changes: 32 additions & 52 deletions resources/views/default.antlers.html
Original file line number Diff line number Diff line change
@@ -1,55 +1,35 @@
<div class="container prose">
<div
class="w-56 h-100 fixed left-0 top-0 bottom-0 border-solid border-r border-grey-200 hidden lg:block overflow-auto pt-10">
{{ if segment_1 }}
{{ if nav_type }}
{{ partial:side-nav-charts :nav_title="nav_title" }}
{{ else }}
{{ partial:side-nav :nav_title="nav_title" }}
{{ /if }}
{{ /if }}
</div>
<div class="absolute top-0 left-0 lg:left-56 bottom-0 right-0">
<div class="w-full p-5">
<div class="box-border">
{{ partial:top-nav }}
<section class="w-full flex flex-col items-center">
{{ partial:breadcrumbs }}
<div class="flex flex-row w-full p-8">
<div class="copy">
<div class="flex flex-row items-start justify-between">
<h1>{{ title }}</h1>
{{ if environment == 'local' }}
<span class="ml-4 text-xs text-gray-300 align-middle"><a href="{{ edit_url }}"
target="_blank">Edit</a></span>
{{ /if }}
</div>
<div
class="prose prose-a:text-amp-blue-300 prose-ol:list-decimal prose-ol:list-outside prose-pre:bg-[#fafafa] max-w-prose">
{{ partial:sdk-comparison }}
{{ partial:goals }}
{{ content | markdown }}
</div>
{{ if slug == "charts-overview" }}
<div class="flex flex-wrap">
{{ collection:charts landing:is="true" sort="sort:asc" }}
<a href="{{ url }}">
<div class="flex-none border border-gray-500 rounded size-48 m-8 p-4 hover:shadow-lg transition-shadow">
<p>{{ title }}</p>
</div>
</a>
{{ /collection:charts }}
{{ /if }}
{{# <p class="text-xs text-amp-light-blue-700">Last updated: {{updated_at}} by {{updated_by:email}}</p> #}}
</div>
<div class="w-full">
<section class="w-full flex flex-col items-center">
{{ partial:breadcrumbs }}
<div class="flex flex-row w-full p-8">
<div class="copy">
<div class="flex flex-row items-start justify-between">
<h1>{{ title }}</h1>
{{ if environment == 'local' }}
<span class="ml-4 text-xs text-gray-300 align-middle"><a href="{{ edit_url }}"
target="_blank">Edit</a></span>
{{ /if }}
</div>
<div
class="prose prose-a:text-amp-blue-300 prose-ol:list-decimal prose-ol:list-outside prose-pre:bg-[#fafafa] max-w-prose">
{{ partial:sdk-comparison }}
{{ partial:goals }}
{{ content | markdown }}
</div>
{{ if slug == "charts-overview" }}
<div class="flex flex-wrap">
{{ collection:charts landing:is="true" sort="sort:asc" }}
<a href="{{ url }}">
<div
class="flex-none border border-gray-500 rounded size-48 m-8 p-4 hover:shadow-lg transition-shadow">
<p>{{ title }}</p>
</div>
</a>
{{ /collection:charts }}
{{ /if }}
{{# <p class="text-xs text-amp-light-blue-700">Last updated: {{updated_at}} by {{updated_by:email}}</p> #}}
</div>
{{ partial:toc }}
</div>
</div>
</section>
{{unless hide_toc}}
{{partial:toc}}
{{/unless}}
</div>
</div>
</div>
</div>
</section>
23 changes: 22 additions & 1 deletion resources/views/layout.antlers.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,28 @@
</head>
<body class="bg-gray-100 font-sans leading-normal text-gray-800">
<div class="mx-auto px-2 lg:min-h-screen flex flex-col items-center justify-center">
{{ template_content }}
<div class="container prose">
<div
class="w-56 h-100 fixed left-0 top-0 bottom-0 border-solid border-r border-black-200 hidden lg:block overflow-auto pt-10">
{{ if segment_1 }}
{{ if nav_type }}
{{ partial:side-nav-charts :nav_title="nav_title" }}
{{ else }}
{{ partial:side-nav :nav_title="nav_title" }}
{{ /if }}
{{ /if }}
</div>
<div class="absolute top-0 left-0 lg:left-56 bottom-0 right-0">
<div class="w-full py-5 pl-5">
<div class="box-border">
{{ partial:top-nav }}
</div>
</div>
<div class="w-full">
{{template_content}}
</div>
</div>
</div>
</div>
</body>
</html>
35 changes: 17 additions & 18 deletions resources/views/partials/top-nav.antlers.html
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
<div class="box-border flex flex-row flex-nowrap items-center border-solid border-b border-grey-200 h-12 px-4"
style="margin-left: -20px; margin-top: -20px;">
<div class="flex-auto mr-4 text-sm"><a href="/">Home</a></div>
{{nav:collection:sections sort="order"}}
{{if children}}
<div class="flex-auto mr-4 text-sm" x-data="{ open: false }" @mouseleave="open = false"><button @click.prevent @mouseover="open = true" style="font-weight:normal">{{title}}</button>
<div x-cloak x-show="open" class="mt-4 absolute border-2 border-grey-500 top-4 bg-white w-24 p-4">
{{children }}
<a href="{{url}}">{{title}}</a> <br />
<div class="box-border flex flex-row flex-nowrap items-center border-solid border-b border-black-200 h-12 px-4"
style="margin-left: -20px; margin-top: -20px;">
<div class="flex-auto mr-4 text-sm"><a href="/">Home</a></div>
{{ nav:collection:sections sort="order" }}
{{ if children }}
<div class="flex-auto mr-4 text-sm" x-data="{ open: false }" @mouseleave="open = false"><button
@click.prevent @mouseover="open = true" style="font-weight:normal">{{ title }}</button>
<div x-cloak x-show="open" class="mt-4 absolute border-2 border-black-500 top-4 bg-white w-24 p-4">
{{ children }}
<a href="{{ url }}">{{ title }}</a> <br />
{{ /children }}
</div>
</div>
{{else}}
<!--{{segment_1}} - {{slug}}-->
<div class="flex-auto mr-4 text-sm "><a href="{{url}}" class="{{if segment_1 === slug}}text-green-700{{/if}}">{{title}}</a></div>
{{/if}}


{{/nav:collection:sections}}
</div>
</div>
{{ else }}
<div class="flex-auto mr-4 text-sm "><a href="{{ url }}"
class="{{if segment_1 === slug}}text-green-700{{/if}}">{{ title }}</a></div>
{{ /if }}
{{ /nav:collection:sections }}
</div>
109 changes: 44 additions & 65 deletions resources/views/sdk-landing.antlers.html
Original file line number Diff line number Diff line change
@@ -1,69 +1,48 @@
<div class="container prose">
<div
class="w-56 h-100 fixed left-0 top-0 bottom-0 border-solid border-r border-grey-200 hidden lg:block overflow-auto pt-10">
{{ if segment_1 }}
{{ if nav_type }}
{{ partial:side-nav-charts :nav_title="nav_title" }}
{{ else }}
{{ partial:side-nav :nav_title="nav_title" }}
{{ /if }}
{{ /if }}
</div>
<div class="absolute top-0 left-0 lg:left-56 bottom-0 right-0">
<div class="w-full p-5">
<div class="box-border">
{{ partial:top-nav }}
<section class="w-full flex flex-col items-center">
{{ partial:breadcrumbs }}
<div class="flex flex-row w-full p-8">
<div class="copy">
<div class="flex flex-row items-start justify-between">
<h1>{{ title }}</h1>
{{ if environment == 'local' }}
<span class="ml-4 text-xs text-gray-300 align-middle"><a href="{{ edit_url }}"
target="_blank">Edit</a></span>
{{ /if }}
</div>
</div>
<div class="w-full">
<section class="w-full flex flex-col items-center">
{{ partial:breadcrumbs }}
<div class="flex flex-row w-full p-8">
<div class="copy">
<div class="flex flex-row items-start justify-between">
<h1>{{ title }}</h1>
{{ if environment == 'local' }}
<span class="ml-4 text-xs text-gray-300 align-middle"><a href="{{ edit_url }}"
target="_blank">Edit</a></span>
{{ /if }}
</div>
<div
class="prose prose-a:text-amp-blue-300 prose-ol:list-decimal prose-ol:list-outside prose-pre:bg-[#fafafa] max-w-prose">
<div class="flex flex-wrap gap-4 w-full">
{{ collection :from="mount" article_type:is="core" sort="order" }}
<div class="flex-1 basis-80 border grow-0 rounded p-4">
<span class="text-xs my-0">{{ sdk_status }}</span>
<a href="{{ url }}">
<h2 class="text-md my-0">{{ title }}</h2>
</a>
<div class="inline"><a href="{{ bundle_url }}" target="_blank"><img
class="my-0 inline" src="{{ shields_io_badge }}" alt=""
srcset="" /></a>
{{ supported_languages }}
<img class="h-4 inline mx-1 my-0" src="/assets/icons/{{ value }}.svg" />
{{ /supported_languages }}
</div>
<ul class="text-sm">
<li><a href="{{ github_link }}" target="_blank">GitHub</a></li>
<li><a href="{{ releases_url }}" target="_blank">Releases</a></li>
{{ if ampli_article }}
{{ ampli_article }}
<li><a href="{{ url }}">Ampli</a></li>
{{ /ampli_article }}
{{ /if }}
{{ if migration_guide }}
{{ migration_guide }}
<li><a href="{{ url }}">{{ title }}</a></li>
{{ /migration_guide }}
{{ /if }}
</ul>
</div>
{{ /collection }}
</div>
{{#
<div class="prose prose-a:text-amp-blue-300 prose-ol:list-decimal prose-ol:list-outside prose-pre:bg-[#fafafa]">
#}}
<div class="flex flex-wrap gap-4 w-full">
{{ collection :from="mount" article_type:is="core" sort="order" }}
<div class="flex-1 basis-80 border grow-0 rounded p-4">
<span class="text-xs my-0">{{ sdk_status }}</span>
<a href="{{ url }}">
<h2 class="text-md my-0">{{ title }}</h2>
</a>
<div class="inline"><a href="{{ bundle_url }}" target="_blank"><img
class="my-0 inline" src="{{ shields_io_badge }}" alt=""
srcset="" /></a>
{{ supported_languages }}
<img class="h-4 inline mx-1 my-0" src="/assets/icons/{{ value }}.svg" />
{{ /supported_languages }}
</div>

<ul class="text-sm">
<li><a href="{{ github_link }}" target="_blank">GitHub</a></li>
<li><a href="{{ releases_url }}" target="_blank">Releases</a></li>
{{ if ampli_article }}
{{ ampli_article }}
<li><a href="{{ url }}">Ampli</a></li>
{{ /ampli_article }}
{{ /if }}
{{ if migration_guide }}
{{ migration_guide }}
<li><a href="{{ url }}">{{ title }}</a></li>
{{ /migration_guide }}
{{ /if }}
</ul>
</div>
</section>
{{ /collection }}
</div>
{{# </div> #}}
</div>
</div>
</div>
</section>

0 comments on commit 93d9bb4

Please sign in to comment.