mirror of
https://github.com/tabler/tabler.git
synced 2026-08-07 20:02:23 +04:00
Migrate preview and docs packages from Eleventy to Astro (#2694)
Co-authored-by: Bartek <xbartoszdobija@gmail.com>
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
---
|
||||
// Port of preview/pages/map-fullsize.html.
|
||||
// Front matter: layout-wrapper-full + layout-sidebar + layout-hide-topbar,
|
||||
// page-libs: [google-maps], page-menu: plugins.map-fullsize. No title / no
|
||||
// page-header (the page-header block renders empty in the reference).
|
||||
//
|
||||
// {% assign map-id = 'google' %} → id="map-google".
|
||||
// The {% capture_script %} block is registered synchronously (before any await).
|
||||
// We mirror the development build (environment == 'development'), so the
|
||||
// `window.tabler_map` bookkeeping lines are emitted (as in the reference).
|
||||
//
|
||||
// REQUIRES DefaultLayout `wrapperFull` support (see report): page-wrapper-full
|
||||
// class + slot rendered WITHOUT the .container-xl wrapper. Not implemented in
|
||||
// the shared DefaultLayout yet — flagged rather than modified here.
|
||||
import DefaultLayout from '@shared/layouts/DefaultLayout.astro';
|
||||
import { addPageScript } from '@shared/lib/page-scripts';
|
||||
|
||||
addPageScript(`<script>
|
||||
let map;
|
||||
window.tabler_map = window.tabler_map || {};
|
||||
|
||||
document.addEventListener("DOMContentLoaded", function() {
|
||||
map = new google.maps.Map(document.getElementById("map-google"), {
|
||||
center: { lat: -34.397, lng: 150.644 },
|
||||
zoom: 8,
|
||||
});
|
||||
|
||||
window.tabler_map["map-google"] = map;
|
||||
});
|
||||
</script>`);
|
||||
---
|
||||
|
||||
<DefaultLayout
|
||||
pageMenu="plugins.map-fullsize"
|
||||
pageLibs={['google-maps']}
|
||||
sidebar
|
||||
hideTopbar
|
||||
wrapperFull
|
||||
>
|
||||
<div class="map flex-fill" id="map-google"></div>
|
||||
</DefaultLayout>
|
||||
Reference in New Issue
Block a user