jekyll-airtable-import 0.1.6 → 0.1.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9a166f5a2aee4abb6189cac0e09dbdfe75ed33543f6d30f9e5ca57125cdf90ca
4
- data.tar.gz: ada7d7b313ac24ae95fe1feda2ab05e82a4f8298842b70dea83b6b8f4b1ba4fe
3
+ metadata.gz: 466cb3b575e4774b3f376e426b493aa48f3d013741a0c68ef888889106cdc3b1
4
+ data.tar.gz: dac123033aa98814a3622c67ccf654b3dd0957ebe61f21cd6de278e346733276
5
5
  SHA512:
6
- metadata.gz: 230649fbb2017fc58203114db00dcfef3f73045ce24d5b0e68d23dd568ec14b847a3189a19c79cc1b720454d6e3a6008d3d3337da9bae792fa843361655368b7
7
- data.tar.gz: ce1fdfc3e307193b714d930952448ec8c5eecbce2d949526d4066943a3c9f45d8e1dee6f3c8518ff12c33a1a7d619bd291e8473621dfda2db072e22015550790
6
+ metadata.gz: 43bddc77a19ee9ddcd1366424d4f80b9470afef6651e096cf8e4d130a4aeb1564347e6d70e7c93765470aacbd1f6c5d8d44208d32aba9b2d3c23cf13008ecada
7
+ data.tar.gz: 9b1669a899386b52b6958e5fc626cd447f18e1b6d72222e5a4a31cf08b0b7534347617c3aaf1418f754fcd94382b191791b16f6355985c261ee43a6bcd9be43e
data/README.md CHANGED
@@ -29,7 +29,8 @@ your site will be built in.
29
29
  ### 2. Edit your `_config.yml` file
30
30
 
31
31
  To tell your Jekyll site which tables to import your site from by defining them
32
- in the `airtable` as a list of tables:
32
+ in the `airtable` as a list of tables:.
33
+
33
34
 
34
35
  ```yaml
35
36
  airtable:
@@ -77,8 +78,8 @@ Each import's key defines its key in the sites data or collection. Each item in
77
78
 
78
79
  | Field | Required? | Notes |
79
80
  | ----: | :-------: |---|
80
- | app | :heavy_check_mark: | The base ID for the Airtable. Starts with `app` and can be found in an Airtable URL |
81
- | table | :heavy_check_mark: | The table ID or name for the collection/data/ Starts with `tbl` and can be found in an Airtable URL |
81
+ | app | :heavy_check_mark: | The base ID for the Airtable. Starts with `app` and can be found in an Airtable URL. You can use evironment variables for this by prefixing `ENV_` to the defined environment variable. E.g. if you define `AIRTABLE_BASE_ID=app4ghFya5hfwmfVQ` you could put the line `app: ENV_AIRTABLE_BASE_ID` in the config. |
82
+ | table | :heavy_check_mark: | The table ID or name for the collection/data/ Starts with `tbl` and can be found in an Airtable URL. You can use evironment variables for this by prefixing `ENV_` to the defined environment variable. E.g. if you define `AIRTABLE_TABLE_POSTS=tbl4ghFya5hfwmfVQ` in the environment you could put the line `table: ENV_AIRTABLE_TABLE_POSTS` in the config. |
82
83
  | view | | The view ID (or name) for the collection/data/ Starts with `viw` and can be found in an Airtable URL |
83
84
  | fields | | A list of fields found in the headings of Airtable columns, defining the only fields to be imported |
84
85
  | collection | | If this is defined, the Airtable table will be imported into a collection rather than data. |
@@ -79,6 +79,7 @@ module Airtable
79
79
  def generate(site)
80
80
  return unless site.config['airtable']
81
81
  return unless ENV['AIRTABLE_API_KEY']
82
+ # return if site.config["airtable_no_links"]
82
83
  @site = site
83
84
  @conf = site.config['airtable']
84
85
  @conf.each do |name, conf|
@@ -75,13 +75,16 @@ module Airtable
75
75
  site.config['airtable'].each do |name, conf|
76
76
  conf ||= Hash.new
77
77
  if conf['app']
78
- @app_id = conf['app'] # Only update app if conf does
78
+ # Only update app if conf does
79
+ @app_id = conf['app'][0..3] == 'ENV_' ? ENV[conf['app'][4..-1]] : conf['app']
79
80
  end
80
81
  unless @app_id
81
82
  Jekyll.logger.warn @log_name, "No app ID for Airtable import of #{name}"
82
83
  next
83
84
  end
84
- @table_id = conf['table'] if conf['table']
85
+ if conf['table']
86
+ @table_id = conf['table'][0..3] == 'ENV_' ? ENV[conf['table'][4..-1]] : conf['table']
87
+ end
85
88
  unless @table_id
86
89
  Jekyll.logger.warn @log_name, "No table ID for Airtable import of #{name}"
87
90
  next
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-airtable-import
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6
4
+ version: 0.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - joe-irving
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-11-07 00:00:00.000000000 Z
11
+ date: 2023-03-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll