This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require("dotenv").config(); | |
const { AssetCache } = require("@11ty/eleventy-cache-assets"); | |
const Airtable = require("airtable"); | |
// You configure here… | |
const airtableBaseId = "{{ GET ME FROM AIRTABLE }}"; | |
const airtableTable = "{{ NAME OF YOUR TABLE }}"; | |
const airtableTableView = "{{ THE VIEW YOU WANT TO PULL FROM }}"; | |
const assetCacheId = "airtableCMS"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const options = { | |
html: true, | |
breaks: true, | |
linkify: true, | |
}; | |
const rwdOptions = { | |
responsive: { | |
'srcset': { | |
'*': [ { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
eleventyConfig.addFilter("imgSuffix", (imgStr, suffix)=> { | |
const i = imgStr.lastIndexOf('.'); | |
const imgPath = imgStr.substring(0, i); | |
const ext = imgStr.substring(i + 1); | |
return `${imgPath}-${suffix}.${ext}`; | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
import os | |
with open('oldblog.json') as f: | |
data = json.load(f) | |
sorted_pages = sorted(data, key=lambda k: int(k['id'])) | |
posts = (x for x in sorted_pages if x['page_status'] in 'published') | |
for post in posts: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<title>Shop Scraper</title> | |
<link rel="stylesheet" type="text/css" href="http://www.vam.ac.uk/_designs/new-squiz/css/main.css" media="all" /> | |
<style> | |
.shop_widget a{ | |
background-size: cover; | |
background-repeat: no-repeat; |