hugo-notion 0.1.0.pre.alpha.1 → 0.1.0.pre.alpha.2
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 +4 -4
- data/bin/huno +35 -0
- data/lib/hugo_notion/version.rb +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 911a882054fd1e8bd0aad7878f6e75948bc0b0a6d9ac3b433147b300e0942498
|
4
|
+
data.tar.gz: ab2c4b42f4cd5a10e50b23826cc638c4db1ef001208ad276c37b402f5738cbc8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d549fc486805ea9333bc763503261e60cf814be278d0cca1e047a7f076274564751d78cc6380f75b482db42580aea8a23f457c5e30646492b10b6e21937dcce4
|
7
|
+
data.tar.gz: f9b669857c40d138d3e9030094f582e18e93262b482a546333f032eff5c36d1b3383a00b8286d128cca24451254c13680f81ebd1c04b8b6e1aa1933ee4b31789
|
data/bin/huno
ADDED
@@ -0,0 +1,35 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require_relative '../lib/hugo_notion/synchronizer'
|
4
|
+
|
5
|
+
def do_exit
|
6
|
+
puts 'Exiting...'
|
7
|
+
exit
|
8
|
+
end
|
9
|
+
Signal.trap("TERM") { do_exit }
|
10
|
+
Signal.trap("INT") { do_exit }
|
11
|
+
|
12
|
+
if !ARGV[0]
|
13
|
+
puts "Please provide the URL of the Notion page you'd like to sync as the first argument"
|
14
|
+
end
|
15
|
+
notion_page_url = ARGV[0]
|
16
|
+
notion_page_id = URI(notion_page_url).path.match(/-(?<page_id>.*)\z/)['page_id']
|
17
|
+
|
18
|
+
destination_dir = Dir.pwd
|
19
|
+
if ARGV[1]
|
20
|
+
if Pathname.new(ARGV[1]).absolute?
|
21
|
+
destination_dir = ARGV[1]
|
22
|
+
else
|
23
|
+
destination_dir = File.join(Dir.pwd, ARGV[1])
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
loop do
|
28
|
+
puts "Syncing posts from Notion..."
|
29
|
+
Synchronizer.run(
|
30
|
+
notion_page_id: notion_page_id,
|
31
|
+
destination_dir: destination_dir
|
32
|
+
)
|
33
|
+
puts "Done."
|
34
|
+
sleep 10
|
35
|
+
end
|
data/lib/hugo_notion/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hugo-notion
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.0.pre.alpha.
|
4
|
+
version: 0.1.0.pre.alpha.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nisanth Chunduru
|
@@ -69,11 +69,13 @@ dependencies:
|
|
69
69
|
description: Write in Notion. Publish with Hugo.
|
70
70
|
email:
|
71
71
|
- nisanth074@gmail.com
|
72
|
-
executables:
|
72
|
+
executables:
|
73
|
+
- huno
|
73
74
|
extensions: []
|
74
75
|
extra_rdoc_files: []
|
75
76
|
files:
|
76
77
|
- README.md
|
78
|
+
- bin/huno
|
77
79
|
- lib/hugo_notion/synchronizer.rb
|
78
80
|
- lib/hugo_notion/version.rb
|
79
81
|
homepage: https://github.com/nisanthchunduru/hugo-notion
|