Skip to content

Commit

Permalink
Make the Jekyll templates work with a --baseurl, also.
Browse files Browse the repository at this point in the history
  • Loading branch information
fabacab committed Sep 27, 2023
1 parent 371cc06 commit fc90061
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion _includes/calendar.html
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ <h5 class="modal-title">Filter calendar</h5>
</ul>
<script type="module">
// Generate list items out of each EventSource object in the Calendar.
import { default as calendar } from '{% link static/js/calendar.js %}';
import { default as calendar } from '{{ site.baseurl }}{% link static/js/calendar.js %}';
window.addEventListener('DOMContentLoaded', function (e) {
calendar.getEventSources().sort(function (a, b) {
var x = a.internalEventSource.extendedProps.name;
Expand Down
2 changes: 1 addition & 1 deletion _layouts/default.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,6 @@ <h1>{% assign words = site.title | split: ' ' %}{% for word in words %}
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.min.js" integrity="sha384-cuYeSxntonz0PPNlHhBs68uyIAVpIIOZZ5JqeqvYYIcEL727kskC66kF92t6Xl2V" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/leaflet.js" integrity="sha256-WBkoXOwTeyKclOHuWtc+i2uENFpDZ9YPdf5Hf+D7ewM=" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/leaflet.markercluster.min.js"></script>
<script type="module" src="{% link static/js/main.js %}"></script>
<script type="module" src="{{ site.baseurl }}{% link static/js/main.js %}"></script>
</body>
</html>
8 changes: 4 additions & 4 deletions static/js/calendar.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ import rrulePlugin from 'https://cdn.skypack.dev/@fullcalendar/[email protected]?min';
import bootstrap5Plugin from 'https://cdn.skypack.dev/@fullcalendar/[email protected]?min';

// Import our own module code sources.
import EventSources from '{% link static/js/event-sources.js %}';
import FullCalendarEvent from '{% link static/js/event.js %}';
import EventSources from '{{ site.baseurl }}{% link static/js/event-sources.js %}';
import FullCalendarEvent from '{{ site.baseurl }}{% link static/js/event.js %}';
import {
default as mapPlugin,
map,
addEventsInRangeTo
} from '{% link static/js/custom-views/map.js %}';
import { default as calendarFilterListItem } from '{% link static/js/custom-elements/calendar-filter-list-item.js %}';
} from '{{ site.baseurl }}{% link static/js/custom-views/map.js %}';
import { default as calendarFilterListItem } from '{{ site.baseurl }}{% link static/js/custom-elements/calendar-filter-list-item.js %}';

export const corsbase = 'https://cors.anarchism.nyc';
export const domparser = new DOMParser();
Expand Down
4 changes: 2 additions & 2 deletions static/js/custom-views/map.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ layout: none
---
import { sliceEvents, createPlugin } from 'https://cdn.skypack.dev/@fullcalendar/[email protected]?min';
import momentTimezone from 'https://cdn.skypack.dev/[email protected]?min';
import { default as calendar } from '{% link static/js/calendar.js %}';
import FullCalendarEvent from '{% link static/js/event.js %}';
import { default as calendar } from '{{ site.baseurl }}{% link static/js/calendar.js %}';
import FullCalendarEvent from '{{ site.baseurl }}{% link static/js/event.js %}';

export var map;

Expand Down
2 changes: 1 addition & 1 deletion static/js/main.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
layout: none
---
import { default as calendar, calendarHeaderToolbar } from '{% link static/js/calendar.js %}';
import { default as calendar, calendarHeaderToolbar } from '{{ site.baseurl }}{% link static/js/calendar.js %}';

function removePastFeaturedEvents () {
var els = document.getElementById('featured-events').querySelectorAll('[data-not-valid-after]');
Expand Down

0 comments on commit fc90061

Please sign in to comment.